Skip to content

Commit 0b9244a

Browse files
committed
fix(anthropic): narrow adopted history for import
The coordinator migration hoisted history to an optional outer binding; afterCreate needs the definite array from the create scope. Also drop the retired session-catalog max-lines ratchet entry.
1 parent 1deff69 commit 0b9244a

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

‎config/max-lines-baseline.txt‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ extensions/codex/src/conversation-binding.ts
6666
extensions/codex/src/migration/provider.test.ts
6767
extensions/codex/src/migration/session-binding-sidecars.ts
6868
extensions/codex/src/session-catalog.test.ts
69-
extensions/codex/src/session-catalog.ts
7069
extensions/codex/src/supervision-tools.ts
7170
extensions/comfy/image-generation-provider.test.ts
7271
extensions/comfy/workflow-runtime.ts

‎extensions/anthropic/session-catalog.ts‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1838,12 +1838,15 @@ async function continueClaudeSession(
18381838
throw new ClaudeCatalogParamsError("Claude session transcript is unavailable");
18391839
}
18401840
}
1841-
history = await readBoundedClaudeHistory({
1841+
// Narrowed local: afterCreate below needs a definite array, while the outer
1842+
// `history` stays optional so complete() can link without a reread on races.
1843+
const loadedHistory = await readBoundedClaudeHistory({
18421844
runtime: api.runtime,
18431845
hostId,
18441846
threadId,
18451847
allowProcessHomeFallback,
18461848
});
1849+
history = loadedHistory;
18471850
const config = currentClaudeSessionCatalogConfig(api);
18481851
const adoptingAgentId = agentId;
18491852
// Adopt onto the model this agent actually routes to the CLI backend; the
@@ -1873,7 +1876,7 @@ async function continueClaudeSession(
18731876
},
18741877
afterCreate: async (entry) => {
18751878
await importClaudeHistory({
1876-
items: history,
1879+
items: loadedHistory,
18771880
threadId,
18781881
sessionId: entry.sessionId,
18791882
sessionKey: entry.key,

0 commit comments

Comments
 (0)