fix(codex): gate history actions until native thread is ready (#1604)

* fix(codex): gate history actions until native thread is ready

* fix(codex): clear history capabilities during bootstrap

* style(codex): normalize CLI file line endings

* fix(codex): await history capability persistence

* fix(codex): restore goal status coverage

* fix(codex): await bootstrap metadata persistence

* chore: retrigger PR review

* fix(codex): scope metadata readiness flush

* fix(codex): gate metadata flush by stale history
This commit is contained in:
Ananovo
2026-10-28 12:06:08 +08:00
committed by GitHub
parent 7a320d793a
commit 0aec975434
7 changed files with 147 additions and 9 deletions
+10 -2
View File
@@ -170,13 +170,21 @@ export async function runSharedRuntime(options: SharedLaunchOptions, onReady?: (
const prepare = async (cwd: string, existingSessionId?: string, parent?: SharedCodexRoot): Promise<SharedCodexRoot> => {
assertRunning();
const shared = { flavor: 'codex', startedBy: options.startedBy ?? 'terminal', workingDirectory: cwd,
exportSessionEnv: false, reportStarted: false, metadataOverrides: { capabilities: { terminal: true, concurrentClients: true },
exportSessionEnv: false, reportStarted: false, metadataOverrides: { capabilities: {
terminal: true,
concurrentClients: true,
...(existingSessionId ? { conversationHistory: undefined } : {})
},
...(parent ? { forkedFrom: parent.session.sessionId } : {}) } } as const;
// reservedSessionId names one preallocated hub row — single-use. A second
// create()/fork must mint a fresh row, not re-adopt (#1911 Opus Major).
const reservedSessionId = takeReservedSessionId(options);
const bootstrap = existingSessionId
? await bootstrapExistingSession({ ...shared, sessionId: existingSessionId })
? await bootstrapExistingSession({
...shared,
sessionId: existingSessionId,
requireMetadataFlush: metadata => Boolean(metadata?.capabilities?.conversationHistory)
})
: await bootstrapSession({
...shared,
reservedSessionId,