mirror of
https://github.com/wu736139669/hapi.git
synced 2026-11-27 05:41:23 +00:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user