Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Codex active run tracking can remain stuck after SubagentStop or turn_aborted #170

Open

Description

Summary

After updating to Workmux 0.1.211, Codex status tracking can leave stale active run IDs in the Workmux Codex runtime state. When this happens, the sidebar/pane remains stuck on working even though the visible Codex work has already completed or been interrupted.

This looks like a remaining edge case in the active-run tracking added for nested Codex agents, related to #154.

Environment

  • Workmux: 0.1.211
  • Codex CLI: 0.133.0
  • Multiplexer: tmux
  • Workmux Codex hooks installed from the bundled template

Observed behavior

A Workmux sidebar entry stayed in working indefinitely.

Inspecting the Workmux runtime state showed a non-empty active set under the Codex status runtime directory for that tmux pane. The corresponding Codex transcript metadata showed those turn IDs were no longer active:

  • some had ended with turn_aborted / interrupted
  • some were thread-spawned subagent turns that ended with task_complete

There were no visible active Codex turns corresponding to those stale active IDs, but Workmux continued to derive working from the non-empty active set.

Why this may leak active IDs

From Workmux 0.1.211 source:

  • src/state/codex_status.rs tracks active Codex runs by session_id:turn_id.
  • It accepts these events for run-id detection: UserPromptSubmit, PreToolUse, PermissionRequest, PostToolUse, and Stop.
  • The bundled Codex hook template registers UserPromptSubmit, PostToolUse, and Stop.

From Codex 0.133.0 source/behavior:

  • thread-spawned child agents complete with SubagentStop, not normal Stop
  • SubagentStop payloads include agent_id / agent_type
  • interrupted turns can end as turn_aborted without running the normal stop hook path

This means Workmux can add a run ID on UserPromptSubmit/PostToolUse, but miss the corresponding cleanup when the turn ends through SubagentStop or turn_aborted. Also, adding a SubagentStop hook alone may not be sufficient in the current implementation because codex_status.rs rejects payloads containing agent_id or agent_type.

Expected behavior

Any run ID added to the pane active set should eventually be removed when that Codex turn completes, the subagent completes, or the turn is interrupted/aborted. The pane/sidebar should not remain working when all tracked Codex turns are done.

Possible fix direction

A few possible approaches:

  • handle SubagentStop as a cleanup event for session_id:turn_id
  • include a bundled SubagentStop Workmux hook if needed
  • allow SubagentStop payloads with agent_id / agent_type for cleanup
  • add cleanup/reconciliation for turn_aborted or stale active IDs

I can provide more anonymized runtime-state details if helpful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /