GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Merge remote-tracking branch 'origin/main' into fix/preserve-pre-wake… · pingdotgg/t3code@06ad0e4

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • apps
    • desktop/src
      • app
        • DesktopObservability.test.ts
        • DesktopObservability.ts
      • preview
        • BrowserSession.test.ts
        • BrowserSession.ts
    • mobile/src
      • features
        • threads
          • thread-list-v2-items.tsx
          • threadListV2.test.ts
          • threadListV2.ts
        • usage
          • UsageAccessCard.tsx
          • UsageRouteScreen.tsx
      • i18n/translations
        • de.json
        • en.json
        • es.json
        • fr.json
        • ja.json
        • ko.json
        • pl.json
        • pt-BR.json
        • ru.json
        • sv.json
        • zh.json
      • lib
        • enrichedLinkPresentation.test.ts
        • enrichedLinkPresentation.ts
      • state
        • threads.ts
        • usage.ts
        • use-composer-drafts.test.ts
        • use-thread-pr.demand.test.tsx
    • server
      • package.json
      • src
        • htmlRender
          • HtmlRender.test.ts
          • HtmlRender.ts
        • mcp
          • ThreadMetadataMcpService.ts
          • linkOrigin.test.ts
        • orchestration-v2
          • Adapters
            • AcpAdapterV2.test.ts
            • ClaudeAdapterV2.ts
          • CheckpointCaptureService.test.ts
          • CheckpointCaptureService.ts
          • ProjectionStore.ts
          • PullRequestSyncReactor.test.ts
          • PullRequestSyncReactor.ts
          • ThreadSearch.test.ts
          • ThreadSearch.ts
          • assistantStreaming.test.ts
          • assistantStreaming.ts
          • pullRequestWatch.test.ts
          • pullRequestWatch.ts
        • provider
          • ClaudeProvider.ts
          • Drivers
            • AntigravityUsage.ts
            • ClaudeDriver.ts
            • ClaudeHome.test.ts
            • ClaudeHome.ts
          • ProviderInstanceRegistry.test.ts
          • ProviderInstanceRegistry.ts
          • ProviderRegistry.test.ts
          • providerMaintenanceRunner.test.ts
          • providerMaintenanceRunner.ts
        • usage
          • UsageService.test.ts
          • UsageService.ts
        • vcs
          • GitVcsDriverCore.ts
    • web
      • src
        • cloud
          • linkEnvironment.test.ts
        • components
          • ComposerPromptEditorTiptap.input.browser.test.tsx
          • Sidebar.logic.test.ts
          • Sidebar.logic.ts
          • chat
            • ThreadDetailsPanel.tsx
            • ThreadDetailsUsage.tsx
          • files
            • FilePreviewPanel.test.ts
            • extendedDocumentPreview.ts
          • onboarding
            • WelcomePage.import.browser.test.tsx
            • WelcomePage.tsx
          • settings
            • ConnectionsSettings.logic.test.ts
            • EnvironmentRow.tsx
            • ProjectSettingsPanel.browser.test.tsx
            • ProjectsSettings.tsx
            • ProviderInstanceCard.tsx
            • ProviderSettingsPanel.tsx
            • RenameEnvironmentDialog.tsx
            • SavedEnvironmentRows.tsx
            • providerStatus.test.ts
            • providerStatus.ts
            • settingsSearch.test.ts
            • settingsSearch.ts
          • sidebar
            • SidebarThreadRow.tsx
          • usage
            • UsageAccessDialog.browser.test.tsx
            • UsageAccessDialog.tsx
            • UsageAccessReads.tsx
            • UsagePage.tsx
        • composer-markdown-source.ts
        • composerDraftStore.test.ts
        • diffPanelStore.test.ts
        • diffPanelStore.ts
        • i18n/translations
          • de.json
          • en.json
          • es.json
          • fr.json
          • ja.json
          • ko.json
          • pl.json
          • pt-BR.json
          • ru.json
          • sv.json
          • zh.json
        • state
          • threads.ts
          • usage.ts
      • test
        • fakeEnvironment.ts
  • docs
    • internals
      • 09_connection-runtime.md
    • user
      • usage.md
  • packages
    • client-runtime/src
      • connection
        • onboarding.test.ts
        • onboarding.ts
        • registry.test.ts
        • registry.ts
        • routes.ts
        • supervisor.test.ts
        • supervisor.ts
      • diffFileOrder.test.ts
      • diffFileOrder.ts
      • operations
        • commands.performance.test.ts
        • commands.test.ts
      • rpc
        • client.test.ts
        • session.test.ts
        • session.ts
      • state
        • connections.ts
        • models.ts
        • presentation.ts
        • pullRequests.test.ts
        • server.test.ts
        • server.ts
        • serverUsage.test.ts
        • shell-sync.test.ts
        • threadSearch.test.ts
        • threadSearch.ts
        • threadShell.test.ts
        • threadShell.ts
        • threads-atoms.test.ts
        • threads-sync.test.ts
        • usageAccess.test.ts
        • usageAccess.ts
        • vcs.test.ts
        • vcsAction.test.ts
      • work-log
        • commandLabel.test.ts
        • commandLabel.ts
        • embeddedScripts.test.ts
        • embeddedScripts.ts
      • workflows.test.ts
      • workflows.ts
    • contracts/src
      • orchestrationV2.ts
      • providerInstance.ts
      • providerUsageLimits.ts
      • usage.ts
    • provider-acp/src/server
      • adapter.test.ts
      • adapter.ts
    • provider-core/src/server
      • driver.ts
      • instanceEnvironment.test.ts
      • usageLimits.ts
    • provider-cursor
      • package.json
    • provider-grok/src/server
      • driver.ts
    • provider-opencode/src/server
      • driver.test.ts
      • driver.ts
    • shared/src
      • appImageRuntimeEnv.ts
      • git.test.ts
      • git.ts
      • markdownLinks.ts
      • sourceControl.test.ts
      • sourceControl.ts
      • terminalOutput.test.ts
      • terminalOutput.ts
      • threadLinks.test.ts
      • threadLinks.ts
      • usageLimitsCopy.ts
    • source-control-bitbucket/src/server
      • BitbucketApi.test.ts
      • BitbucketApi.ts
    • source-control-forgejo/src/server
      • ForgejoIssueTracker.test.ts
      • ForgejoIssueTracker.ts
  • patches
    • @[email protected]
  • pnpm-lock.yaml
  • pnpm-workspace.yaml

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree
Open diff view settings
Collapse file

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

Copy file name to clipboardExpand all lines: apps/desktop/src/app/DesktopObservability.test.ts
+75Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import * as ConfigProvider from "effect/ConfigProvider";
66
import * as Effect from "effect/Effect";
77
import * as FileSystem from "effect/FileSystem";
88
import * as Layer from "effect/Layer";
9+
import * as PlatformError from "effect/PlatformError";
910
import * as Schema from "effect/Schema";
1011
import * as HttpClient from "effect/http/HttpClient";
1112
import * as HttpClientResponse from "effect/http/HttpClientResponse";
@@ -302,6 +303,80 @@ describe("DesktopObservability", () => {
302303
}).pipe(Effect.scoped, Effect.provide(NodeServices.layer)),
303304
);
304305

306+
it.effect("keeps earlier backups while the active log cannot be renamed", () =>
307+
Effect.gen(function* () {
308+
const fileSystem = yield* FileSystem.FileSystem;
309+
const directory = yield* fileSystem.makeTempDirectoryScoped({
310+
prefix: "t3-desktop-rotating-locked-test-",
311+
});
312+
const filePath = `${directory}/server-child.log`;
313+
yield* fileSystem.writeFileString(`${filePath}.1`, "previous");
314+
yield* fileSystem.writeFileString(`${filePath}.2`, "oldest");
315+
const writer = yield* DesktopObservability.makeRotatingLogFileWriter({
316+
filePath,
317+
maxBytes: 4,
318+
maxFiles: 2,
319+
}).pipe(
320+
Effect.provideService(FileSystem.FileSystem, {
321+
...fileSystem,
322+
rename: (source, target) =>
323+
source === filePath
324+
? Effect.fail(
325+
PlatformError.systemError({
326+
_tag: "PermissionDenied",
327+
module: "FileSystem",
328+
method: "rename",
329+
pathOrDescriptor: source,
330+
}),
331+
)
332+
: fileSystem.rename(source, target),
333+
}),
334+
);
335+
336+
for (let attempt = 0; attempt < 3; attempt += 1) {
337+
yield* writer.writeText("12345\n");
338+
}
339+
340+
assert.deepEqual(
341+
[
342+
yield* fileSystem.readFileString(`${filePath}.1`),
343+
yield* fileSystem.readFileString(`${filePath}.2`),
344+
],
345+
["previous", "oldest"],
346+
);
347+
}).pipe(Effect.scoped, Effect.provide(NodeServices.layer)),
348+
);
349+
350+
it.effect("keeps a log left staged by an interrupted rotation as a backup", () =>
351+
Effect.gen(function* () {
352+
const fileSystem = yield* FileSystem.FileSystem;
353+
const directory = yield* fileSystem.makeTempDirectoryScoped({
354+
prefix: "t3-desktop-rotating-staged-test-",
355+
});
356+
const filePath = `${directory}/server-child.log`;
357+
yield* fileSystem.writeFileString(filePath, "active");
358+
yield* fileSystem.writeFileString(`${filePath}.rotating`, "staged");
359+
yield* fileSystem.writeFileString(`${filePath}.1`, "previous");
360+
const writer = yield* DesktopObservability.makeRotatingLogFileWriter({
361+
filePath,
362+
maxBytes: 8,
363+
maxFiles: 3,
364+
});
365+
366+
yield* writer.writeText("12345\n");
367+
368+
assert.deepEqual(
369+
[
370+
yield* fileSystem.readFileString(`${filePath}.1`),
371+
yield* fileSystem.readFileString(`${filePath}.2`),
372+
yield* fileSystem.readFileString(`${filePath}.3`),
373+
yield* fileSystem.exists(`${filePath}.rotating`),
374+
],
375+
["active", "staged", "previous", false],
376+
);
377+
}).pipe(Effect.scoped, Effect.provide(NodeServices.layer)),
378+
);
379+
305380
it.effect("stops every export when the OpenTelemetry SDK is disabled", () => {
306381
const requests: Array<ExportedRequest> = [];
307382
return Effect.gen(function* () {
Collapse file

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

Copy file name to clipboardExpand all lines: apps/desktop/src/app/DesktopObservability.ts
+14-6Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,8 @@ export const makeRotatingLogFileWriter = Effect.fn("makeRotatingLogFileWriter")(
271271
}
272272
});
273273

274-
const rotate = Effect.gen(function* () {
274+
const staged = `${input.filePath}.rotating`;
275+
const publishStaged = Effect.gen(function* () {
275276
yield* fileSystem.remove(withSuffix(maxFiles), { force: true }).pipe(Effect.ignore);
276277
for (let index = maxFiles - 1; index >= 1; index -= 1) {
277278
const source = withSuffix(index);
@@ -280,11 +281,18 @@ export const makeRotatingLogFileWriter = Effect.fn("makeRotatingLogFileWriter")(
280281
yield* fileSystem.rename(source, withSuffix(index + 1));
281282
}
282283
}
283-
const currentExists = yield* fileSystem
284-
.exists(input.filePath)
285-
.pipe(Effect.orElseSucceed(() => false));
286-
if (currentExists) {
287-
yield* fileSystem.rename(input.filePath, withSuffix(1));
284+
yield* fileSystem.rename(staged, withSuffix(1));
285+
});
286+
287+
const rotate = Effect.gen(function* () {
288+
const exists = (filePath: string) =>
289+
fileSystem.exists(filePath).pipe(Effect.orElseSucceed(() => false));
290+
// A log left staged by an interrupted rotation becomes a backup first.
291+
if (yield* exists(staged)) yield* publishStaged;
292+
// Move the active log aside before touching backups: while it cannot move, none is aged out.
293+
if (yield* exists(input.filePath)) {
294+
yield* fileSystem.rename(input.filePath, staged);
295+
yield* publishStaged;
288296
}
289297
yield* Ref.set(currentSize, 0);
290298
}).pipe(
Collapse file

‎apps/desktop/src/preview/BrowserSession.test.ts‎

Copy file name to clipboardExpand all lines: apps/desktop/src/preview/BrowserSession.test.ts
+21Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -809,6 +809,27 @@ describe("BrowserSession", () => {
809809
}).pipe(Effect.provide(layer)),
810810
);
811811

812+
it.effect("cuts a long certificate name without splitting an emoji", () =>
813+
Effect.gen(function* () {
814+
const browserSessions = yield* BrowserSession.BrowserSession;
815+
const partition = yield* browserSessions.getPartition("scope-a");
816+
yield* browserSessions.getSession("scope-a");
817+
const browserSession = sessions.get(partition);
818+
819+
showMessageBox.mockReset();
820+
showMessageBox.mockReturnValue(1);
821+
const longName = `${"a".repeat(119)}\u{1F600} dev certificate`;
822+
const prompt = certificateError(browserSession, {
823+
url: "https://localhost:18443/",
824+
certificate: { ...selfSignedCertificate, subjectName: longName },
825+
});
826+
assert.isFalse(yield* prompt.trusted);
827+
const detail = showMessageBox.mock.calls[0]?.[0].detail ?? "";
828+
const issuedTo = detail.split("\n").find((line) => line.startsWith("Issued to: "));
829+
assert.strictEqual(issuedTo, `Issued to: ${"a".repeat(119)}…`);
830+
}).pipe(Effect.provide(layer)),
831+
);
832+
812833
it.effect("asks before trusting an untrusted certificate and remembers the approval", () =>
813834
Effect.gen(function* () {
814835
const browserSessions = yield* BrowserSession.BrowserSession;
Collapse file

‎apps/desktop/src/preview/BrowserSession.ts‎

Copy file name to clipboardExpand all lines: apps/desktop/src/preview/BrowserSession.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ const CERTIFICATE_APPROVALS_FILE = "t3code-certificate-approvals.json";
163163
/** Server-chosen certificate names must not add lines or flood the prompt. */
164164
const promptCertificateName = (name: string): string => {
165165
const flat = name.replace(/\s+/g, " ").trim();
166-
return flat.length > 120 ? `${flat.slice(0, 120)}…` : flat;
166+
return flat.length > 120 ? `${flat.slice(0, 120).replace(/\p{Surrogate}$/u, "")}…` : flat;
167167
};
168168

169169
const promptCertificateDate = (seconds: number): string =>
Collapse file

‎apps/mobile/src/features/threads/thread-list-v2-items.tsx‎

Copy file name to clipboardExpand all lines: apps/mobile/src/features/threads/thread-list-v2-items.tsx
+18Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,24 @@ interface StatusLabel {
100100
readonly iconTintClassName: string;
101101
}
102102
const STATUS_LABEL_BY_STATUS: Partial<Record<ThreadListV2Status, StatusLabel>> = {
103+
connecting: {
104+
label: msg("Connecting", { $context: "connection status" }),
105+
icon: "wifi.slash",
106+
className: "text-foreground-muted",
107+
iconTintClassName: "accent-foreground-muted",
108+
},
109+
reconnecting: {
110+
label: msg("Reconnecting", { $context: "connection status" }),
111+
icon: "wifi.slash",
112+
className: "text-foreground-muted",
113+
iconTintClassName: "accent-foreground-muted",
114+
},
115+
offline: {
116+
label: msg("Offline", { $context: "connection status" }),
117+
icon: "wifi.slash",
118+
className: "text-foreground-muted",
119+
iconTintClassName: "accent-foreground-muted",
120+
},
103121
approval: {
104122
label: msg("Approval", { $context: "thread status, waiting for approval" }),
105123
icon: "exclamationmark.shield",
Collapse file

‎apps/mobile/src/features/threads/threadListV2.test.ts‎

Copy file name to clipboardExpand all lines: apps/mobile/src/features/threads/threadListV2.test.ts
+82Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,74 @@ describe("layoutThreadListV2RowMenuActions", () => {
153153
});
154154

155155
describe("resolveThreadListV2Status", () => {
156+
it.each(["preparing", "queued", "starting", "running", "waiting"] as const)(
157+
"qualifies a cached %s runtime while reconnecting",
158+
(status) => {
159+
const thread = presentThreadShell(
160+
environmentId,
161+
makeRawThreadShell({
162+
status,
163+
activeRunId: RunId.make("run-disconnected"),
164+
latestRunId: RunId.make("run-disconnected"),
165+
}),
166+
);
167+
expect(resolveThreadListV2Status({ ...thread, connectionPhase: "reconnecting" })).toBe(
168+
"reconnecting",
169+
);
170+
},
171+
);
172+
173+
it.each(["failed", "completed", "cancelled", "interrupted"] as const)(
174+
"preserves a cached %s outcome while disconnected",
175+
(status) => {
176+
const thread = presentThreadShell(
177+
environmentId,
178+
makeRawThreadShell({
179+
status,
180+
latestRunId: RunId.make("run-ended"),
181+
latestRunCompletedAt: DateTime.makeUnsafe(NOW),
182+
lastVisitedAt: DateTime.makeUnsafe("2026-06-01T23:59:00.000Z"),
183+
}),
184+
);
185+
const disconnected = { ...thread, connectionPhase: "reconnecting" as const };
186+
expect(resolveThreadListV2Status(disconnected)).toBe(
187+
status === "failed" ? "failed" : "ready",
188+
);
189+
expect(threadHasUnseenCompletion(disconnected)).toBe(threadHasUnseenCompletion(thread));
190+
},
191+
);
192+
193+
it.each([
194+
["connecting", "connecting"],
195+
["reconnecting", "reconnecting"],
196+
["offline", "offline"],
197+
["error", "offline"],
198+
["unsupported", "offline"],
199+
["available", "offline"],
200+
["connected", "working"],
201+
[undefined, "working"],
202+
] as const)(
203+
"presents cached running work with connection phase %s",
204+
(connectionPhase, expected) => {
205+
const thread = makeThread({
206+
id: ThreadId.make("disconnected"),
207+
title: "Disconnected",
208+
runtime: {
209+
status: "running",
210+
activeRunId: RunId.make("run-disconnected"),
211+
providerInstanceId: ProviderInstanceId.make("codex"),
212+
providerName: "Codex",
213+
lastError: null,
214+
updatedAt: NOW,
215+
},
216+
connectionPhase,
217+
});
218+
expect(resolveThreadListV2Status(thread)).toBe(expected);
219+
expect(resolveThreadListV2Status({ ...thread, hasPendingApprovals: true })).toBe("approval");
220+
expect(resolveThreadListV2Status({ ...thread, hasPendingUserInput: true })).toBe("input");
221+
},
222+
);
223+
156224
it("presents decoded thread waits as Waiting while preserving requests and older servers", () => {
157225
const raw = makeRawThreadShell({
158226
status: "running",
@@ -1781,6 +1849,20 @@ describe("Working section beta", () => {
17811849
expect(off.workingCount).toBe(0);
17821850
});
17831851

1852+
it("preserves pins and Working membership across connection loss and recovery", () => {
1853+
const before = build({ workingShelfExpanded: true });
1854+
for (const connectionPhase of ["reconnecting", "offline", "connected"] as const) {
1855+
const layout = build({
1856+
workingShelfExpanded: true,
1857+
threads: threads.map((thread) => ({ ...thread, connectionPhase })),
1858+
});
1859+
expect(ids(layout)).toEqual(ids(before));
1860+
expect(layout.workingCount).toBe(before.workingCount);
1861+
expect(layout.items[0]?.thread.id).toBe("pinned-working");
1862+
expect(layout.items[0]?.thread.runtime?.status).toBe("running");
1863+
}
1864+
});
1865+
17841866
it("keeps an inactive row in Working during the shared grace and returns it on expiry", () => {
17851867
vi.useFakeTimers();
17861868
vi.setSystemTime(new Date(NOW));
Collapse file

‎apps/mobile/src/features/threads/threadListV2.ts‎

Copy file name to clipboardExpand all lines: apps/mobile/src/features/threads/threadListV2.ts
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
type SnoozePreset,
1515
} from "@t3tools/client-runtime/state/thread-settled";
1616
import type { EnvironmentThreadShell } from "@t3tools/client-runtime/state/shell";
17+
import { resolveThreadConnectionStatus } from "@t3tools/client-runtime/state/models";
1718
import {
1819
threadSearchMatchKey,
1920
threadSearchSubject,
@@ -51,6 +52,9 @@ import {
5152
export const threadListInboxReturns = createInboxReturnTracker();
5253

5354
export type ThreadListV2Status =
55+
| "connecting"
56+
| "reconnecting"
57+
| "offline"
5458
| "approval"
5559
| "input"
5660
| "request"
@@ -262,6 +266,8 @@ export function resolveThreadListV2Status(
262266
| "pendingGuestMessageCount"
263267
| "runtime"
264268
| "blockedOnThreadWait"
269+
| "connectionPhase"
270+
| "pendingBackgroundTasks"
265271
>,
266272
): ThreadListV2Status {
267273
if (thread.hasPendingApprovals || thread.pendingSubagentRequest === "approval") {
@@ -274,6 +280,8 @@ export function resolveThreadListV2Status(
274280
if ((thread.pendingGuestMessageCount ?? 0) > 0) {
275281
return "request";
276282
}
283+
const connectionStatus = resolveThreadConnectionStatus(thread);
284+
if (connectionStatus !== null) return connectionStatus;
277285
if (thread.runtime?.status === "running" && thread.blockedOnThreadWait === true) {
278286
return "waiting";
279287
}

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.