Repository navigation
Description
Summary
In Codex Desktop on Windows, asking the agent in one task to archive another task fails with:
already has an active writer
Clarification from the user: At the time of the failed archive request, the target task appears idle/completed in the Desktop UI: no running work or unfinished work is shown. This describes the visible UI state; the underlying writer-lock state has not been independently inspected.
Manually archiving the target task through the Desktop UI succeeds without an error. The user reports that agent-requested cross-task archiving previously worked.
This report concerns the difference between agent-requested archiving and manual UI archiving. It does not ask to bypass an active writer lock.
Environment
Current installation, verified during the related diagnostic:
- Windows, local Codex Desktop project.
- Installed Windows package:
OpenAI.Codex 26.915.3509.0. - Desktop-managed CLI on PATH:
codex-cli 0.155.0-alpha.9.
The exact previously working version and the version at each historical archive attempt have not been established.
User-reported workflow
- Identify an existing task B that shows no running or unfinished work in the Desktop UI, then ask Codex in task A to archive it.
- Codex reports that the operation cannot complete because the target
already has an active writer. - Archive the target manually through the Desktop UI.
- Manual archiving succeeds with no error.
The user recalls this cross-task workflow working previously. The user confirms that the target appears idle/completed in the UI. The exact tool/command used by the failing agent, the backend writer ownership/state, and the underlying request trace have not been captured, so these steps describe the reported UI workflow rather than an independently verified minimal reproducer.
Expected behavior
For a user-authorized archive request, the agent should have a supported path that performs the same lifecycle coordination as the Desktop UI. If the target genuinely cannot be archived safely, explain the specific blocker and recovery path.
An agent-requested operation should not get stuck at a writer-conflict error while the corresponding manual UI action succeeds.
Actual behavior and impact
The agent reports an active-writer conflict, and the user has to archive the task manually. This interrupts cross-task cleanup and coordination that the user previously relied on.
Evidence boundary and related reports
- The archive behavior above is reported directly by the user; it was not replayed in the reporting task, to avoid archiving unrelated tasks just for reproduction.
- In a separate diagnostic on this installation, native task-management tools were absent from the active agent's callable registry. See our comment on [macOS 26.901 / 0.153.4] Persistent Desktop task loses thread-management tools; CLI fallback remains backend-readable #44044: [macOS 26.901 / 0.153.4] Persistent Desktop task loses thread-management tools; CLI fallback remains backend-readable #44044 (comment).
- A separate
codex exec resumefallback also encountered an active-writer conflict. That was a resume attempt, not an archive reproduction, and is not used as proof of this archive bug. - [Bug] Archiving a conversation fails with "failed to archive thread: 系统找不到指定的文件。 (os error 2)" when rollout_path is stored in extended-length form #39734 mentions archive-related active-writer conflicts, but its primary error is a Windows path/
os error 2problem. We have not established that it shares the same cause.
Please investigate whether the failing agent operation is routed through a separate writer owner or a fallback that lacks the Desktop UI's archive coordination. This is a diagnostic question, not an established root cause.
No task IDs, private paths, conversation contents, credentials, or raw logs are included. No locks or state databases were modified.
Activity
HenryFone commentedon Oct 1, 2026
Independent data point from Windows (Desktop 26.924.22138, CLI 0.158.0-alpha.2.1) that matches the cross-process writer-lock explanation above.
The lock is real and is held by the desktop app-server for threads that are visibly idle. While the app is running,
%USERPROFILE%\.codex\thread-writer-locks\<thread-id>.lockexists and a second-process archive fails with the same active-writer error. The lock file is opened with FILE_SHARE_DELETE, so a non-owner can rename it to<id>.lock.parked-<timestamp>without touching the running app. Immediately after that rename,codex archive <id>succeeded (exit 0), the DB row flipped to archived, and the rollout moved toarchived_sessions- also verified reversible.That supports the routing/ownership split: the owner-mediated path can coordinate teardown, while a second process correctly sees the foreign lock. What a contender is missing today is (1) structured "live owner" diagnostics and (2) an owner-side release/handoff operation, of the shape proposed in #45406. I am not suggesting the lock be weakened or force-deleted.
I packaged the rename + official-CLI flow as a stopgap for people blocked by this exact error (Windows, stdlib only, 127.0.0.1): https://github.com/HenryFone/codex-archive-manager. Scope is lock conflicts only; it does not touch the account/worktree preflight failures (#48367, #49116), and it never edits the SQLite DB by itself.