Skip to content

Status overlay prefers stale GJC history over active Codex pane #31

Description

@Cheol-H-Jeong

Problem

In the k-pol nmux-linux window, the main pane was switched from GJC to Codex, but nmux-linux still rendered the status overlay as if GJC owned the project.

Observed live state:

  • tmux list-panes for nmux-linux:7 showed the main pane command as node with title ⠸ k-pol.
  • The process tree under the main pane was:
    • /bin/bash
    • node /home/cheol/.local/bin/codex
    • OpenAI Codex vendor binary
  • The right status pane still showed:
    • 작업 소스 gjc · k-pol
    • 메인 pane node
    • stale GJC user-command history

Expected

When the active main pane process tree contains Codex, nmux-linux should:

  • identify the main pane as agent:codex in the status overlay;
  • prefer Codex rollout/plan data for that project;
  • avoid showing stale GJC command history just because old .gjc transcripts exist for the same cwd.

Root cause

pickActiveTaskSource() unconditionally prioritizes readGjcSource() before all other task sources. This was correct when GJC was the primary agent, but it breaks mixed-agent panes: a project with historical GJC transcripts will mask a currently running Codex TUI forever.

taskOverlayStatusContext() also hides process-tree agent detection by default behind NMUX_TASK_OVERLAY_DETECT_AGENT=1, so a Codex node wrapper appears as generic node in the overlay.

Fix direction

  • Detect the active main-pane agent from the process tree by default.
  • Pass that active agent into task-source selection.
  • If the active agent is non-GJC, prefer its source and do not fall back to stale GJC history.
  • Keep the existing GJC-first behavior only when GJC is the active agent or no active agent is known.

Verification target

Add tests proving that an active Codex pane selects Codex source over stale GJC source, and that node /path/to/codex is identified as Codex.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions