App Server init/proxy failure blocks programmatic archival fallback
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.4k
- PR merge metrics
- PR metrics pending
Description
Summary
A Codex automation session completed repository cleanup but could not archive its own completed thread through the documented thread/archive RPC. The automation tool surface did not expose thread/archive, so it attempted the local App Server fallback. That path failed before the archive operation could be called.
This issue tracks the fallback-path failure and diagnostics. The direct feature request to expose current-thread archival is tracked separately in #44784.
Environment
codex-cli 0.152.0- Linux
4.4.302+ x86_64 - Hosted/containerized Codex automation environment
- No raw session JSONL, credentials, thread IDs, or local paths are included
Initial reproduction
- Complete a Codex automation task and clean up its Git worktree.
- Attempt to archive the completed thread through the documented App Server API.
- Initialize a separate App Server and call
thread/listto obtain the current thread ID.
Sanitized request:
printf '%s\n' \
'{"method":"initialize","id":1,"params":{"clientInfo":{"name":"cleanup-audit","title":"Cleanup audit","version":"1.0"}}}' \
'{"method":"initialized"}' \
'{"method":"thread/list","id":2,"params":{"limit":100}}' |
codex app-server --stdio
Observed result:
Error: failed to initialize sqlite state runtime under $CODEX_HOME: failed to initialize state runtime at $CODEX_HOME
Follow-up diagnostics
codex doctor --summaryreported the SQLite state databases as healthy.- It reported three thread-index inconsistencies: rollout files missing from the state DB or rows pointing to missing/unusable rollout files.
- A persistent App Server was already running.
- The separate
codex app-server --stdiofailure therefore did not establish database corruption or a root cause. codex app-server proxyagainst the persistent daemon completed without an RPC response, so the automation still could not obtain the current thread ID or callthread/archive.
Expected behavior
The App Server fallback should either:
- initialize and expose the underlying state correctly;
- provide an actionable diagnostic and safe recovery path; or
- provide a supported bridge to the persistent App Server instance.
Impact
When direct current-thread archival is unavailable, the documented App Server fallback is also unusable. Repository cleanup can complete while session cleanup remains a manual UI action.
Related
- #44784 tracks the direct, narrowly scoped enablement request.
- #30105 covers a similar generic App Server SQLite initialization symptom caused by concurrent access on macOS; this report does not assume the same root cause.
- #39130 covers a Windows archive file-move failure after an archive attempt; this report fails before
thread/archivecan run.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the failure with codex app-server --stdio, then compare its initialization path with codex app-server proxy and the results of codex doctor --summary. Done means the fallback initializes successfully, reports an actionable diagnostic and safe recovery path, or provides a supported bridge to the persistent App Server.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, sqlite
- Domain
- backend-api-design, cli, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100