Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
f2b6235
feat(host-service): add account provenance to terminal binding schema
ozeitis Oct 9, 2026
abe4ca2
feat(desktop): choose an account for new agent terminals
ozeitis Oct 10, 2026
2d25d0e
feat(host-service): validate saved Claude and Codex conversation iden…
ozeitis Oct 10, 2026
c12a208
feat(desktop): resume ended native conversations with a selected account
ozeitis Oct 10, 2026
b778b1e
feat(host): persist saved native conversation ownership
ozeitis Oct 10, 2026
8e8b20a
fix(desktop): distinguish resume and usage header keys
ozeitis Oct 13, 2026
2322b1e
refactor(host-service): keep saved identity scoped to native history
ozeitis Oct 13, 2026
01db609
feat(host): persist saved native conversation ownership
ozeitis Oct 10, 2026
2952448
feat(desktop): discover and resume saved native Claude conversations
ozeitis Oct 10, 2026
a8b1cef
docs(host-service): describe saved Claude adoption boundaries
ozeitis Oct 11, 2026
9caab77
chore(i18n): normalize saved history catalogs after upstream refresh
ozeitis Oct 13, 2026
908941e
fix(desktop): reuse the builtin agent label in saved history
ozeitis Oct 13, 2026
6298521
fix(desktop): import saved history label through the public catalog
ozeitis Oct 13, 2026
f956529
fix(host-service): return the stored saved conversation revision
ozeitis Oct 13, 2026
349a9bf
test(host-service): cover saved history ownership and recovery persis…
ozeitis Oct 13, 2026
57a5dee
style(host-service): format migration recovery assertions
ozeitis Oct 13, 2026
c827765
fix(desktop): recover the durable successor after a lost resume response
ozeitis Oct 13, 2026
2c5d1de
fix(desktop): focus saved terminals across workspace pane areas
ozeitis Oct 13, 2026
dae241f
perf(host-service): validate exact recovery history in the host worke…
ozeitis Oct 13, 2026
c4efb8a
fix(desktop): recover the durable successor after a lost resume response
ozeitis Oct 13, 2026
619584a
test(desktop): type the recovered successor cache assertion
ozeitis Oct 13, 2026
fdca254
test(desktop): type the recovered successor cache assertion
ozeitis Oct 13, 2026
faa11c3
fix(host-service): compare saved account context across persistence r…
ozeitis Oct 13, 2026
101ad48
fix(host-service): compare durable account routing context
ozeitis Oct 13, 2026
1ff7c62
fix(host-service): compare durable account routing context
ozeitis Oct 13, 2026
3e44f79
fix(host-service): retain verified account attribution across hook races
ozeitis Oct 13, 2026
d3bb948
fix(i18n): clarify account sign-in and terminal terminology
ozeitis Oct 13, 2026
7504093
fix(host-service): prepare selected profile hooks and preserve ambien…
ozeitis Oct 13, 2026
cc7e338
fix(host-service): clean up refused new recovery terminals only
ozeitis Oct 13, 2026
6fc459e
merge qualified prerequisites for saved-base-qualified
ozeitis Oct 13, 2026
eb2e3cf
merge qualified prerequisites for exact-qualified
ozeitis Oct 13, 2026
144cab9
merge qualified prerequisites for saved-qualified
ozeitis Oct 13, 2026
f605268
fix(host-service): reconcile same-launch account capture
ozeitis Oct 14, 2026
3d02a45
fix(host-service): respect disabled hooks for account launches
ozeitis Oct 14, 2026
376379f
fix(desktop): trap focus in account terminal picker
ozeitis Oct 14, 2026
5c40d7a
fix(host-service): distinguish user preferences from managed account …
ozeitis Oct 14, 2026
f44cbc0
Merge branch 'work/pr8460' into work/pr8461
ozeitis Oct 14, 2026
7b1ddf1
fix(i18n): clarify Vietnamese account terminal labels
ozeitis Oct 14, 2026
4121446
fix(host-service): keep Claude recovery traversal within project roots
ozeitis Oct 14, 2026
4ed97b6
perf(host-service): compile native rollout filename pattern once
ozeitis Oct 14, 2026
e7ef953
fix(desktop): preserve definitive account resume refusals
ozeitis Oct 14, 2026
0cde9e8
Merge branch 'work/pr8461' into work/pr8463
ozeitis Oct 14, 2026
8b2cb9f
fix(host-service): handle missing saved histories and relative checkp…
ozeitis Oct 14, 2026
5db4aa1
test(host-service): prove account authorization rollback preserves sa…
ozeitis Oct 14, 2026
3268be9
fix(desktop): commit saved history busy callbacks before cleanup
ozeitis Oct 14, 2026
46db5d3
fix(i18n): refine saved conversation adoption copy
ozeitis Oct 14, 2026
c7af593
test: align review regression formatting with repository checks
ozeitis Oct 14, 2026
0ce9f39
test: align review regression formatting with repository checks
ozeitis Oct 14, 2026
88be4d6
Merge reviewed account-resume formatting prerequisite
ozeitis Oct 14, 2026
824c016
fix(host-service): preserve exact terminal attribution across restarts
ozeitis Oct 14, 2026
9fbc74f
Merge exact attribution hardening for PR8461
ozeitis Oct 14, 2026
1425947
Merge exact attribution hardening for PR8463
ozeitis Oct 14, 2026
f1f4369
fix(host-service): reconcile terminal account migrations with current…
ozeitis Oct 25, 2026
9f93a78
fix(host-service): reconcile saved conversation migrations with curre…
ozeitis Oct 25, 2026
6cc2faf
Merge current terminal provenance and preserve account launch UI
ozeitis Oct 25, 2026
8904f7d
fix(desktop): verify recommended launch picker and complete its trans…
ozeitis Oct 25, 2026
08b18a5
Reconcile saved conversation adoption with current launcher and gener…
ozeitis Oct 25, 2026
0a05741
fix(host-service): revalidate exact conversation history at resume ad…
ozeitis Oct 25, 2026
dadefc9
fix(desktop): retain linked saved-chat focus and upstream pane controls
ozeitis Oct 25, 2026
ebd1750
fix(host-service): preserve worker entrypoint while testing transcrip…
ozeitis Oct 25, 2026
eff6548
feat(host-service): reconnect exact live Claude background conversations
ozeitis Oct 25, 2026
1133339
fix(desktop): carry exact background recovery into saved conversations
ozeitis Oct 25, 2026
e531316
Merge current upstream sign-in and sidebar-group fixes
ozeitis Oct 25, 2026
4462cd7
Merge current upstream sign-in and sidebar-group fixes
ozeitis Oct 25, 2026
42ea6a2
Merge current upstream sign-in and sidebar-group fixes
ozeitis Oct 25, 2026
182d02d
Merge verified account freshness prerequisite
ozeitis Oct 25, 2026
0321ad1
fix(desktop): judge each account quota window by its own source and age
ozeitis Oct 25, 2026
80132a0
Merge verified account freshness prerequisite
ozeitis Oct 25, 2026
b304d7c
Merge refreshed account-picker clock fix
ozeitis Oct 25, 2026
4dbb213
fix(desktop): keep newly refreshed quota visible before the age timer
ozeitis Oct 25, 2026
5e55101
Merge refreshed account-picker clock fix
ozeitis Oct 25, 2026
678e237
Retain strict worker ownership proof assertions
ozeitis Oct 25, 2026
e12a3a6
test(host-service): assert both saved-history store bindings
ozeitis Oct 25, 2026
bc168a6
fix(host-service): compare saved history scan identity explicitly
ozeitis Oct 25, 2026
0d41189
fix(host-service): authorize only the exact reserved resume successor
ozeitis Oct 25, 2026
d8eb901
Retain exact reserved-successor authorization in the feature stack
ozeitis Oct 25, 2026
adbb88a
test(agent-setup): isolate Codex exit fixtures from delayed launch re…
ozeitis Oct 25, 2026
706ecf8
Keep independent wrapper lifecycle fixtures in the composed feature
ozeitis Oct 25, 2026
c0d2b20
Merge reviewed prerequisite fixes for #8460
ozeitis Oct 26, 2026
d8558bd
fix: address verified review findings for #8460
ozeitis Oct 26, 2026
4ed7ec2
Merge reviewed prerequisite fixes for #8461
ozeitis Oct 26, 2026
4007fe4
fix: address verified review findings for #8461
ozeitis Oct 26, 2026
1afe99f
Merge reviewed prerequisite fixes for #8463
ozeitis Oct 26, 2026
4c2da2f
style(desktop): format terminal-only quota refresh calls
ozeitis Oct 26, 2026
66239d5
Merge reviewed prerequisite fixes for #8461
ozeitis Oct 26, 2026
b382cee
Merge reviewed prerequisite fixes for #8463
ozeitis Oct 26, 2026
4a169a6
merge: reconcile account selection with current upstream
ozeitis Oct 26, 2026
92f6ff8
fix(accounts): expose quota refresh failures without blocking manual …
ozeitis Oct 26, 2026
2abcb7c
merge: propagate reviewed account selection prerequisites
ozeitis Oct 26, 2026
9bcfd7f
fix(accounts): preserve exact recovery across hooks and rejected auth…
ozeitis Oct 26, 2026
31c8178
merge: propagate reviewed exact recovery prerequisites
ozeitis Oct 26, 2026
5262ad3
chore(i18n): regenerate scoped contribution catalogs
ozeitis Oct 26, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .github/workflows/build-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ jobs:
sleep "$((attempt * 10))"
done

- name: Build macOS executable verifier
if: startsWith(matrix.target, 'darwin-')
working-directory: packages/macos-process-metrics
run: npx --yes node-gyp@12.4.0 rebuild

- name: Build distribution
working-directory: packages/cli
env:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
import { expect, test } from "bun:test";
import { continueNativeBackground } from "./continue-native-background";

const input = {
workspaceId: "workspace",
terminalId: "old",
expectedRevision: "captured-source",
};
test("Continue prefers the existing background view and never requests another account", async () => {
let reads = 0;
let resumes = 0;
const result = await continueNativeBackground(input, {
reconnect: async () => ({
reconnected: true,
terminalId: "view",
label: "Claude",
}),
source: async () => {
reads++;
return null;
},
resume: async () => {
resumes++;
return { resumed: false };
},
});
expect(result).toEqual({ terminalId: "view", label: "Claude" });
expect(reads).toBe(0);
expect(resumes).toBe(0);
});
test("a cleanly ended conversation can resume only its same immutable original account", async () => {
const requested: unknown[] = [];
const result = await continueNativeBackground(input, {
reconnect: async () => ({ reconnected: false }),
source: async () => ({
provider: "claude",
ready: true,
revision: input.expectedRevision,
account: { selection: "/original/profile", identity: "exact-original" },
}),
resume: async (request) => {
requested.push(request);
return { resumed: true, terminalId: "exact-replay", label: "Claude" };
},
});
expect(result?.terminalId).toBe("exact-replay");
expect(requested).toEqual([
{
...input,
account: { selection: "/original/profile", identity: "exact-original" },
},
]);
});
test("changed or incomplete source context cannot become a default-account resume", async () => {
for (const saved of [
null,
{
provider: "claude",
ready: false,
revision: input.expectedRevision,
account: { selection: null, identity: "account" },
},
{
provider: "claude",
ready: true,
revision: "changed",
account: { selection: "/different", identity: "new" },
},
]) {
let resumes = 0;
expect(
await continueNativeBackground(input, {
reconnect: async () => ({ reconnected: false }),
source: async () => saved,
resume: async () => {
resumes++;
return { resumed: false };
},
}),
).toBeNull();
expect(resumes).toBe(0);
}
});
test("a lost attachment response cannot fall through and launch a second worker", async () => {
let resumes = 0;
await expect(
continueNativeBackground(input, {
reconnect: async () => {
throw new Error("offline");
},
source: async () => null,
resume: async () => {
resumes++;
return { resumed: false };
},
}),
).rejects.toThrow("offline");
expect(resumes).toBe(0);
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
interface Input {
workspaceId: string;
terminalId: string;
expectedRevision: string;
}
interface Successor {
terminalId: string;
label: string;
}
interface Account {
selection: string | null;
identity: string;
}
interface ContinueNativeIO {
reconnect(
input: Input,
): Promise<
| { reconnected: false }
| ({ reconnected: true } & Successor)
| ({ reconnected: false; attachmentPending: true } & Successor)
>;
source(input: { workspaceId: string; terminalId: string }): Promise<{
provider: string;
ready: boolean;
revision: string;
account: Account | null;
} | null>;
resume(
input: Input & { account: Account },
): Promise<{ resumed: false } | ({ resumed: true } & Successor)>;
}
export async function continueNativeBackground(
input: Input,
io: ContinueNativeIO,
): Promise<Successor | null> {
const live = await io.reconnect(input);
if (live.reconnected || "attachmentPending" in live)
return { terminalId: live.terminalId, label: live.label };
const saved = await io.source(input);
if (
!saved?.ready ||
saved.provider !== "claude" ||
saved.revision !== input.expectedRevision ||
!saved.account
)
return null;
const result = await io.resume({
...input,
account: {
selection: saved.account.selection,
identity: saved.account.identity,
},
});
return result.resumed
? { terminalId: result.terminalId, label: result.label }
: null;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
import { expect, test } from "bun:test";
import { resumeWithBackgroundReconnect } from "./resume-with-background-reconnect";

function fixture() {
let resumes = 0;
let attaches = 0;
const input = { workspaceId: "workspace", terminalId: "original" };
const resume = async () => {
resumes++;
return { resumed: false as const };
};
const recovery = {
capabilities: async () => ({ version: 1, claudeLiveAttach: true }),
source: async () => ({ provider: "claude", revision: "a".repeat(64) }),
reconnect: async (_input: typeof input & { expectedRevision: string }) => {
attaches++;
return {
reconnected: true as const,
terminalId: "existing-worker-view",
label: "Claude",
};
},
};
return { input, resume, recovery, counts: () => ({ resumes, attaches }) };
}
test("Continue focuses the confirmed existing worker and never launches a resume", async () => {
const f = fixture();
expect(
await resumeWithBackgroundReconnect(
f.input,
"claude",
f.recovery,
f.resume,
),
).toEqual({
resumed: true,
terminalId: "existing-worker-view",
label: "Claude",
});
expect(f.counts()).toEqual({ resumes: 0, attaches: 1 });
});
test("older hosts fall back only on a missing additive capability", async () => {
const f = fixture();
f.recovery.capabilities = async () => {
throw { data: { code: "NOT_FOUND" } };
};
expect(
await resumeWithBackgroundReconnect(
f.input,
"claude",
f.recovery,
f.resume,
),
).toEqual({ resumed: false });
expect(f.counts()).toEqual({ resumes: 1, attaches: 0 });
});
test("transport, permission and malformed capability failures never launch another worker", async () => {
for (const error of [
new Error("offline"),
{ data: { code: "UNAUTHORIZED" } },
{ code: "NOT_FOUND" },
]) {
const f = fixture();
f.recovery.capabilities = async () => {
throw error;
};
await expect(
resumeWithBackgroundReconnect(f.input, "claude", f.recovery, f.resume),
).rejects.toBe(error);
expect(f.counts().resumes).toBe(0);
}
});
test("verification failure after supported capability never falls through", async () => {
const f = fixture();
f.recovery.reconnect = async () => {
throw new Error("worker changed");
};
await expect(
resumeWithBackgroundReconnect(f.input, "claude", f.recovery, f.resume),
).rejects.toThrow("worker changed");
expect(f.counts().resumes).toBe(0);
});
test("an explicit no-background result preserves ordinary resume", async () => {
const f = fixture();
const recovery = {
...f.recovery,
reconnect: async () => ({ reconnected: false as const }),
};
expect(
await resumeWithBackgroundReconnect(f.input, "claude", recovery, f.resume),
).toEqual({ resumed: false });
expect(f.counts().resumes).toBe(1);
});
test("an unconfirmed view is opened but never presented as confirmed identity", async () => {
const f = fixture();
const recovery = {
...f.recovery,
reconnect: async () => ({
reconnected: false as const,
attachmentPending: true as const,
terminalId: "pending-view",
label: "Claude",
}),
};
expect(
await resumeWithBackgroundReconnect(f.input, "claude", recovery, f.resume),
).toMatchObject({ resumed: true, terminalId: "pending-view" });
expect(f.counts().resumes).toBe(0);
});
test("Codex does not receive Claude capability or attachment calls", async () => {
const f = fixture();
f.recovery.capabilities = async () => {
throw new Error("should not run");
};
await resumeWithBackgroundReconnect(f.input, "codex", f.recovery, f.resume);
expect(f.counts()).toEqual({ resumes: 1, attaches: 0 });
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
interface ResumeInput {
workspaceId: string;
terminalId: string;
}
type ResumeResult =
| { resumed: false }
| { resumed: true; terminalId: string; label: string };
interface BackgroundRecovery {
capabilities(): Promise<{ version: number; claudeLiveAttach: boolean }>;
source(
input: ResumeInput,
): Promise<{ provider: string; revision: string } | null>;
reconnect(input: ResumeInput & { expectedRevision: string }): Promise<
| { reconnected: false }
| { reconnected: true; terminalId: string; label: string }
| {
reconnected: false;
attachmentPending: true;
terminalId: string;
label: string;
}
>;
}
function missingProcedure(error: unknown): boolean {
if (!error || typeof error !== "object" || !("data" in error)) return false;
const data = error.data;
return (
!!data &&
typeof data === "object" &&
"code" in data &&
data.code === "NOT_FOUND"
);
}
/** Network/verification failures never fall through to a second worker launch. */
export async function resumeWithBackgroundReconnect(
input: ResumeInput,
provider: string,
recovery: BackgroundRecovery,
resume: (input: ResumeInput) => Promise<ResumeResult>,
): Promise<ResumeResult> {
if (provider !== "claude") return resume(input);
let capability: Awaited<ReturnType<BackgroundRecovery["capabilities"]>>;
try {
capability = await recovery.capabilities();
} catch (error) {
if (missingProcedure(error)) return resume(input);
throw error;
}
if (capability.version !== 1 || !capability.claudeLiveAttach)
return resume(input);
const source = await recovery.source(input);
if (!source || source.provider !== "claude") return resume(input);
const result = await recovery.reconnect({
...input,
expectedRevision: source.revision,
});
if (result.reconnected || "attachmentPending" in result)
return {
resumed: true,
terminalId: result.terminalId,
label: result.label,
};
return resume(input);
}
Loading
Loading