Skip to content

[Windows Desktop] Agent-requested cross-task archive fails with "already has an active writer", while manual UI archive succeeds #46433

Open

Description

@li2go

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

  1. 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.
  2. Codex reports that the operation cannot complete because the target already has an active writer.
  3. Archive the target manually through the Desktop UI.
  4. 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

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

  1. added
    bug
    app
    windows-os
    session
    on Sep 18, 2026
  2. HenryFone commented on Oct 1, 2026

    @HenryFone

    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>.lock exists 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 to archived_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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    appbugsessionwindows-os

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions