mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-11-17 04:11:35 +00:00
Add ``resume_thread_id`` to CodexAppServerSession: when set, the first ensure_started() issues ``thread/resume`` (with the same cwd / personality / developerInstructions / model params thread/start sends) instead of starting an empty thread, and verifies codex handed back the requested id. A refused or mismatched resume raises the typed CodexThreadResumeError once; the next ensure_started() falls through to ``thread/start`` on the same handshaken client (initialize now runs once per client, not once per attempt). Why: the thread id lived in memory only, so every new AIAgent for the same Hermes session — a later API-server request or the first turn after a restart — started a fresh codex thread and the model lost its own memory of the conversation (#100531). The runtime decides the fail-closed policy; this adapter only speaks the wire contract (verified against codex-cli 0.147.0: thread/resume{threadId,...} -> result.thread.id; unknown id -> -32600 "no rollout found"; killed writer -> -32600 "already has an active writer"). Salvaged from #103352 (thread/resume + id cross-fill + mismatch guard).
2 lines
51 B
Text
2 lines
51 B
Text
benawad
|
|
# PR #103352 salvage (codex thread/resume)
|