Fix Codex continuation after workspace archive - #4512
Merged
Conversation
This was referenced Sep 8, 2026
Contributor
|
| Filename | Overview |
|---|---|
| packages/server/src/server/agent/agent-manager.ts | Reorders archive and restore lifecycle operations so native synchronization occurs only after the runtime releases its writer. |
| packages/server/src/server/agent/agent-manager.test.ts | Adds focused regression coverage proving native archive and restore release loaded session writers. |
| packages/server/src/server/daemon-e2e/agent-archive.native.real.e2e.test.ts | Adds opt-in real Codex coverage for continuation across ordinary and legacy archive states and extracts the scenario mechanics from the test body. |
Sequence Diagram
sequenceDiagram
participant Client
participant Manager as AgentManager
participant Runtime
participant Codex as Native Codex Session
participant Store as Agent Storage
Client->>Manager: Archive workspace
Manager->>Store: Mark record archived
Manager->>Runtime: Close runtime / release writer
Manager->>Codex: Archive native session
Client->>Manager: Restore workspace
Client->>Manager: Load archived history
Manager->>Runtime: Close any loaded archived runtime
Manager->>Codex: Unarchive native session
Manager->>Store: Clear archived state
Client->>Manager: Send follow-up
Manager->>Codex: Resume same native session
Reviews (2): Last reviewed commit: "Keep archive QA mechanics in a scenario ..." | Re-trigger Greptile
12 tasks
dwyanewang
added a commit
to dwyanewang/paseo
that referenced
this pull request
Sep 9, 2026
Review main da8c1b5..c172076 against all six overlays. Keep each overlay; provider-history was rebased and updated through 310d340 to preserve read-only archived history alongside getpaseo#4512.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linked issue
Observed during hosted continuation QA in getpaseo/hub#123. Related to #4353 and #4473; this focused archive fix does not replace the provider history refactor.
Type of change
Reasoning
After a GitHub follow-up restored an archived workspace, the same Codex agent failed with
thread … already has an active writer. Paseo called native archive before closing its runtime, so Codex rejected archive. Loading that archived conversation then acquired a writer before native unarchive.Close the runtime before native archive. Before native unarchive, release any runtime loaded for archived history. This also repairs continuation of existing records left native-active by older daemons; no stored data or protocol migration is required.
Goals
Non-goals
QA
RECALLED=ARCHIVE_CEDAR_7429.PASEO_NATIVE_ARCHIVE_QA=1 npx vitest run src/server/daemon-e2e/agent-archive.native.real.e2e.test.ts --bail=1: 2 passed.npx vitest run src/server/agent/agent-manager.test.ts --bail=1: 180 passed, including native writer ownership regression.2ec6e916-2419-449b-b988-a7b1c0b92e68and sessionce8d11ac-b9ea-5fcc-abe5-672dfc6e1276; executions046aee71-1034-5bd8-b6a0-19f3f50dbd47→d272d06e-9703-5de8-8f38-cabb2251f2c8. Both replied, finished, and archived. The main development daemon was not restarted and still requires this update.Checklist
npm run typecheckpassesnpm run lintpassesnpm run formatpasses