Skip to content

Commit 7a94ff9

Browse files
authored
chore: merge upstream t3code to ebdcda1 (pingdotgg#191)
Merges `pingdotgg/t3code` `78af372cf..ebdcda1` (39 commits) into the fork. The merge PR is not stacked; it branches from `main`. ## Resolution - **8 conflicts.** Each was resolved using the verdict `preflight.mjs` gave for it. The per-file details are in `docs/fork/upstream-merge-log.md`. - `apps/server/src/cli/pair.ts` stays deleted, as listed in `deletedUpstreamPaths`. - `ThreadPullRequestsPanel.tsx` takes upstream. Upstream pingdotgg#13061 now names the repository on each linked PR, so the fork's delta there has converged and the file is identical to upstream. - **New gate.** Upstream's chat code-block **Run** button (pingdotgg#13060) runs `scripts.run` with a synthetic `chat-code-block` id. The Moatless backend rejects that id with `ScriptNotFound`, so `ChatView` hides the button on environments that report `workspaceScripts`. This is recorded in the inventory (`host-run-scripts`) and in `gaps.md`. - **Lint.** Upstream pingdotgg#13371/pingdotgg#13397 made `shadcn(no-arbitrary-values)` a lint error, which flagged 130 hits in fork code, mostly `settings/moatless/**`. I mapped each one onto the type scale the same way upstream mapped its own: `text-[13px]` becomes `text-sm`, `[11px]` becomes `text-2xs`, `[10.5px]` and `[.65rem]` become `text-3xs`, and so on. Some Moatless settings text therefore renders at slightly different sizes. - **Type fix.** The fork's Mermaid `MarkdownCodeBlock` now passes upstream's required `isStreaming` prop. - **Lockfile.** `pnpm-lock.yaml` was re-derived with `install.mjs`. - **File counts.** 515 files landed, against 489 in the upstream range. The fork delta is 756 files. The gap is explained in the log entry. ## Verification - A full run of `verify.mjs` passes all 10 checks, tests included. - The unsupported-method derivation reports no ADD and no DROP. - `resolution-check.mjs` and `duplicate-adds.mjs` report nothing. ## Upstream feature classification ### Usable as-is - The sidebar Back button always returns to the main app (pingdotgg#13516), including Escape on settings. - Linked PRs show repository names (pingdotgg#13061). - Colors come from theme tokens, text uses scale values, and disabled controls have consistent opacity (pingdotgg#13371, pingdotgg#13397, pingdotgg#11441). - Working and monitoring threads fade in the sidebar again (pingdotgg#13506). Sidebar terminal pulses stay in sync (pingdotgg#12962). - Selected text stays visible on a revealed file line (pingdotgg#13548). - The usage page has a keybinding, `usage.open` (pingdotgg#9434). ### Unsupported in Moatless / needs implementation - **Per-thread auto-settle switch (pingdotgg#11846).** This adds the `thread.auto-settle.set` command, the `thread.auto-settle-set` event, and the `threadAutoSettleOptOut` capability. Moatless never auto-settles and does not report the capability, so the menu item stays hidden. - **Run a shell command from a chat code block (pingdotgg#13060).** Gated off on `workspaceScripts` environments. It needs `scripts.run` to accept an inline command. - **iPhone Duo 3D device controls (pingdotgg#12813).** Behind `FEATURES.deviceHub`, which is off. - **One-click Grok CLI update (pingdotgg#13523).** Provider management is behind `FEATURES.providerConfiguration`, which is off. - **Relay/tunnel cleanup and a managed endpoint reaper (pingdotgg#9386, pingdotgg#13528).** Also the forced relay deploy workflow (pingdotgg#13550). Relay is decided out of the fork. - **Desktop update reconnect (pingdotgg#12006).** Electron is not a target. ### Backend behavior to consider reproducing in Moatless - **Racy edits in review diffs (pingdotgg#12613).** The review index copy rounds its mtime down so that edits made in the same second as the copy still appear in the diff (`apps/server/src/vcs/GitVcsDriverCore.ts`). - **Codex 0.156 (pingdotgg#13481, pingdotgg#13480).** Codex 0.156 is now the minimum, and the app-server protocol was regenerated (`packages/effect-codex-app-server`). - **Claude banked resets (pingdotgg#13118).** Upstream shows and redeems them (`claudeResetCredits.ts`, `resetCreditCoordinator.ts`). Separately, Grok account emails are reported so usage limits merge across environments, and Grok accounts no longer vanish (pingdotgg#12588, pingdotgg#12799). Codex keeps its reset answer when the re-probe fails (pingdotgg#13363). - **ACP (pingdotgg#13386).** Keeps one answer when a running tool reports progress. - **Antigravity (pingdotgg#13388, pingdotgg#13389).** Stop ends commands that outlived their turn, and Windows unpacking stays under MAX_PATH. - **Streamed section titles (pingdotgg#13504).** A title waits for the text beneath it. - **OpenTelemetry (pingdotgg#13355, pingdotgg#13469).** The kill switch is honored, and a malformed `OTEL_RESOURCE_ATTRIBUTES` no longer stops startup. - **Settlement.** If Moatless ever adds automatic settlement, it must honor the per-thread opt-out from pingdotgg#11846. The gaps register (`docs/fork/gaps.md`) was updated for the auto-settle capability, the chat-run gate, and three runtime-fix bullets. ## Left undone - Four files that auto-merged cleanly carry small fork deltas with no path-policy entry: `AgentsPanel.tsx`, `ThreadTerminalDrawer.tsx`, `client-runtime/src/state/threadDetail.ts` and `threadReducer.test.ts`. - `preflight.mjs` labels a modify/delete conflict on a `deletedUpstreamPaths` entry as `[unlisted]`. That is a minor script bug and was not fixed here. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- Moatless task: https://moatless.soaplabstest.com/tasks/8f4381ee-c9ed-4fc5-9ffd-039ee15731ca
2 parents 04e0f32 + cf11588 commit 7a94ff9

515 files changed

Lines changed: 51701 additions & 24876 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/VOUCHED.td‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ github:realAhmedRoach
6868
github:Rishet11
6969
github:ryanrhughes
7070
github:saphid
71+
github:scratchyone
7172
github:sethwebster
7273
github:shiroyasha9
7374
github:shivamhwp

‎.github/workflows/deploy-relay.yml‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ on:
44
push:
55
branches:
66
- main
7+
# Alchemy does not redeploy the Worker when only a Config value read in its
8+
# Init changes (alchemy-run/alchemy#1831), so a changed repository variable
9+
# needs a forced deploy to reach production.
10+
workflow_dispatch:
11+
inputs:
12+
force:
13+
description: Redeploy every resource, including ones with no detected changes
14+
type: boolean
15+
default: true
716

817
permissions:
918
contents: read
@@ -17,6 +26,8 @@ concurrency:
1726
jobs:
1827
deploy_relay:
1928
name: Deploy production relay
29+
# A manual run from another branch would deploy that branch to production.
30+
if: github.ref == 'refs/heads/main'
2031
runs-on: blacksmith-8vcpu-ubuntu-2404
2132
timeout-minutes: 15
2233
environment:
@@ -28,6 +39,7 @@ jobs:
2839
RELAY_DOMAIN: ${{ vars.RELAY_DOMAIN }}
2940
RELAY_API_ZONE_NAME: ${{ vars.RELAY_API_ZONE_NAME }}
3041
RELAY_TUNNEL_ZONE_NAME: ${{ vars.RELAY_TUNNEL_ZONE_NAME }}
42+
RELAY_TUNNEL_CLEANUP_MODE: ${{ vars.RELAY_TUNNEL_CLEANUP_MODE }}
3143
CLERK_PUBLISHABLE_KEY: ${{ vars.CLERK_PUBLISHABLE_KEY }}
3244
CLERK_JWT_AUDIENCE: ${{ vars.CLERK_JWT_AUDIENCE }}
3345
APNS_ENVIRONMENT: ${{ vars.APNS_ENVIRONMENT }}
@@ -54,7 +66,7 @@ jobs:
5466
- --filter=t3code-relay...
5567
5668
- name: Deploy production relay stage
57-
run: vp run --filter t3code-relay deploy --stage prod --yes --no-input
69+
run: vp run --filter t3code-relay deploy --stage prod --yes --no-input ${{ inputs.force && '--force' || '' }}
5870
env:
5971
# The PublishClientConfig action writes the client env here instead
6072
# of the repo-root .env; nothing on the runner reads it.

‎.macroscope/check-run-agents/effect-service-conventions.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Effect Service Conventions
3-
model: gpt-5-6-sol
4-
effort: medium
3+
model: gpt-6-sol
4+
effort: max
55
input: incremental
66
tools:
77
- browse_code

‎.macroscope/check-run-agents/ui-consistency.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: UI Consistency
3-
model: gpt-5-6-sol
4-
effort: medium
3+
model: gpt-6-sol
4+
effort: max
55
input: incremental
66
tools:
77
- browse_code

‎apps/desktop/src/app/DesktopAppIdentity.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ const makeAssetsLayer = (png: Option.Option<string>) =>
7676
icns: Option.none(),
7777
png,
7878
}),
79-
resolveResourcePath: () => Effect.succeed(Option.none()),
79+
resolveResourcePath: () => Effect.succeedNone,
8080
} satisfies DesktopAssets.DesktopAssets["Service"]);
8181

8282
const makeEnvironmentLayer = (overrides: TestEnvironmentInput = {}) => {

‎apps/desktop/src/app/DesktopConnectionCatalogStore.test.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function makeSafeStorageLayer(available: boolean, failDecrypt: Ref.Ref<boolean>
4646
return decoded.slice("encrypted:".length);
4747
});
4848
},
49-
selectedStorageBackend: Effect.succeed(Option.none()),
49+
selectedStorageBackend: Effect.succeedNone,
5050
} satisfies ElectronSafeStorage.ElectronSafeStorage["Service"]);
5151
}
5252

‎apps/desktop/src/app/DesktopConnectionCatalogStore.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ const readDocument = (
205205
raw === null
206206
? Effect.succeed(Option.none<EncryptedConnectionCatalogDocument>())
207207
: decodeEncryptedConnectionCatalogDocumentJson(raw).pipe(
208-
Effect.map(Option.some),
208+
Effect.asSome,
209209
Effect.mapError(
210210
(cause) =>
211211
new DesktopConnectionCatalogStoreDocumentDecodeError({

‎apps/desktop/src/app/DesktopObservability.test.ts‎

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as NodeHttpClient from "@effect/platform-node/NodeHttpClient";
22
import * as NodeServices from "@effect/platform-node/NodeServices";
33
import { assert, describe, it } from "@effect/vitest";
4+
import * as ConfigProvider from "effect/ConfigProvider";
45
import * as Effect from "effect/Effect";
56
import * as FileSystem from "effect/FileSystem";
67
import * as Layer from "effect/Layer";
@@ -427,6 +428,36 @@ describe("DesktopObservability", () => {
427428
);
428429
});
429430

431+
it.effect("exports kill switch warnings through the configured logger", () => {
432+
const requests: Array<ExportedRequest> = [];
433+
return Effect.gen(function* () {
434+
const fileSystem = yield* FileSystem.FileSystem;
435+
const baseDir = yield* fileSystem.makeTempDirectoryScoped({
436+
prefix: "t3-desktop-observability-test-",
437+
});
438+
const environmentLayer = makeEnvironmentLayer(baseDir, true, {
439+
T3CODE_OTLP_LOGS_URL: "https://collector.example.com/v1/logs",
440+
});
441+
442+
yield* Effect.scoped(
443+
Effect.void.pipe(
444+
Effect.provide(DesktopObservability.layer.pipe(Layer.provideMerge(environmentLayer))),
445+
),
446+
);
447+
448+
assert.include(requests[0]?.body ?? "", "OTEL_SDK_DISABLED=1 was read as false");
449+
}).pipe(
450+
Effect.scoped,
451+
Effect.provide(
452+
Layer.mergeAll(
453+
NodeServices.layer,
454+
collectorLayer(requests),
455+
ConfigProvider.layer(ConfigProvider.fromEnv({ env: { OTEL_SDK_DISABLED: "1" } })),
456+
),
457+
),
458+
);
459+
});
460+
430461
it.effect("reads every signal endpoint from Settings when the environment names none", () => {
431462
const requests: Array<ExportedRequest> = [];
432463
return Effect.gen(function* () {
@@ -491,4 +522,37 @@ describe("DesktopObservability", () => {
491522
Effect.provide(Layer.mergeAll(NodeServices.layer, collectorLayer(requests))),
492523
);
493524
});
525+
526+
it.effect("stops every export when the OpenTelemetry SDK is disabled", () => {
527+
const requests: Array<ExportedRequest> = [];
528+
return Effect.gen(function* () {
529+
const fileSystem = yield* FileSystem.FileSystem;
530+
const baseDir = yield* fileSystem.makeTempDirectoryScoped({
531+
prefix: "t3-desktop-observability-test-",
532+
});
533+
const environmentLayer = makeEnvironmentLayer(baseDir);
534+
yield* writeObservabilitySettings(environmentLayer, {
535+
otlpTracesUrl: "https://settings.example.com/v1/traces",
536+
otlpLogsUrl: "https://settings.example.com/v1/logs",
537+
});
538+
539+
yield* Effect.scoped(
540+
Effect.logInfo("desktop log stays local when disabled").pipe(
541+
Effect.withSpan("desktop-disabled-test"),
542+
Effect.provide(DesktopObservability.layer.pipe(Layer.provideMerge(environmentLayer))),
543+
),
544+
);
545+
546+
assert.lengthOf(requests, 0);
547+
}).pipe(
548+
Effect.scoped,
549+
Effect.provide(
550+
Layer.mergeAll(
551+
NodeServices.layer,
552+
collectorLayer(requests),
553+
ConfigProvider.layer(ConfigProvider.fromEnv({ env: { OTEL_SDK_DISABLED: "true" } })),
554+
),
555+
),
556+
);
557+
});
494558
});

‎apps/desktop/src/app/DesktopObservability.ts‎

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
makeTraceSink,
55
otlpSerializationLayer,
66
} from "@t3tools/shared/observability";
7+
import * as OtelEnvironment from "@t3tools/shared/otelEnvironment";
78
import {
89
parsePersistedServerObservabilitySettings,
910
type PersistedServerObservabilitySettings,
@@ -353,12 +354,25 @@ const readPersistedObservabilitySettings: Effect.Effect<
353354
* resolve traces against one revision of the file and logs against another.
354355
*/
355356
const resolveOtlpEndpoints = Effect.gen(function* () {
357+
const otel = yield* OtelEnvironment.load;
358+
if (otel.disabled) {
359+
return {
360+
traces: undefined,
361+
metrics: undefined,
362+
logs: undefined,
363+
warnings: otel.warnings,
364+
resourceAttributes: otel.resourceAttributes,
365+
};
366+
}
367+
356368
const environment = yield* DesktopEnvironment.DesktopEnvironment;
357369
const persisted = yield* readPersistedObservabilitySettings;
358370
return {
359371
traces: Option.getOrUndefined(environment.otlpTracesUrl) ?? persisted.otlpTracesUrl,
360372
metrics: Option.getOrUndefined(environment.otlpMetricsUrl) ?? persisted.otlpMetricsUrl,
361373
logs: Option.getOrUndefined(environment.otlpLogsUrl) ?? persisted.otlpLogsUrl,
374+
warnings: otel.warnings,
375+
resourceAttributes: otel.resourceAttributes,
362376
};
363377
});
364378

@@ -671,7 +685,15 @@ const telemetryLayer = Layer.unwrap(
671685
// resource,
672686
// }).pipe(Layer.provide(serializationLayer));
673687

674-
return Layer.mergeAll(loggerLayer, tracerLayer);
688+
// Logged once the loggers above are installed, so the warnings use them.
689+
const otelWarningsLayer = Layer.effectDiscard(
690+
Effect.forEach(endpoints.warnings, (warning) => Effect.logWarning(warning)),
691+
);
692+
693+
return otelWarningsLayer.pipe(
694+
Layer.provideMerge(Layer.mergeAll(loggerLayer, tracerLayer)),
695+
Layer.provide(OtelEnvironment.layerResourceAttributes(endpoints.resourceAttributes)),
696+
);
675697
}),
676698
);
677699

‎apps/desktop/src/backend/DesktopBackendConfiguration.test.ts‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -946,6 +946,49 @@ describe("DesktopBackendConfiguration", () => {
946946
}).pipe(Effect.scoped, Effect.provide(NodeServices.layer)),
947947
);
948948

949+
it.effect("resolveWsl carries the kill switch into the distro", () =>
950+
Effect.gen(function* () {
951+
const fileSystem = yield* FileSystem.FileSystem;
952+
const baseDir = yield* fileSystem.makeTempDirectoryScoped({
953+
prefix: "t3-desktop-backend-config-test-",
954+
});
955+
956+
const previousWslEnv = process.env.WSLENV;
957+
const previousDisabled = process.env.OTEL_SDK_DISABLED;
958+
try {
959+
delete process.env.WSLENV;
960+
process.env.OTEL_SDK_DISABLED = "true";
961+
962+
yield* Effect.gen(function* () {
963+
const configuration = yield* DesktopBackendConfiguration.DesktopBackendConfiguration;
964+
const config = yield* configuration.resolveWsl({ port: 5050, distro: null });
965+
966+
assert.equal(config.env.OTEL_SDK_DISABLED, "true");
967+
assert.include((config.env.WSLENV ?? "").split(":"), "OTEL_SDK_DISABLED");
968+
}).pipe(
969+
Effect.provide(
970+
DesktopBackendConfiguration.layer.pipe(
971+
Layer.provideMerge(serverExposureLayer),
972+
Layer.provideMerge(DesktopAppSettings.layerTest()),
973+
Layer.provideMerge(DesktopWslServerTree.layerTest()),
974+
Layer.provideMerge(
975+
DesktopWslEnvironment.layerTest({
976+
isAvailable: true,
977+
windowsToWslPath: () => Option.some("/mnt/c/repo/apps/server/src/index.ts"),
978+
getDistroIp: () => Option.some("172.27.0.99"),
979+
}),
980+
),
981+
Layer.provideMerge(makeEnvironmentLayer(baseDir, { platform: "win32" })),
982+
),
983+
),
984+
);
985+
} finally {
986+
restoreEnv("WSLENV", previousWslEnv);
987+
restoreEnv("OTEL_SDK_DISABLED", previousDisabled);
988+
}
989+
}).pipe(Effect.scoped, Effect.provide(NodeServices.layer)),
990+
);
991+
949992
it.effect("resolveWsl preserves existing WSLENV entries when forwarding backend secrets", () =>
950993
Effect.gen(function* () {
951994
const fileSystem = yield* FileSystem.FileSystem;

0 commit comments

Comments
 (0)