Skip to content

fix(tui): keep subagent labels in collab events#1

Open
iqdoctor wants to merge 2 commits into
mainfrom
fix/subagent-event-labels
Open

fix(tui): keep subagent labels in collab events#1
iqdoctor wants to merge 2 commits into
mainfrom
fix/subagent-event-labels

Conversation

@iqdoctor
Copy link
Copy Markdown
Member

@iqdoctor iqdoctor commented May 26, 2026

What

Preserve subagent nickname/role metadata in collab agent tool-call state so TUI transcript rows can render readable labels such as Hume [code-reviewer] instead of raw thread IDs.

Why

Reference: openai#24581.

The /agents picker can show readable subagent labels, but live history rows like Spawned ... and Waiting for 2 agents can still fall back to UUIDs because the app-server ThreadItem::CollabAgentToolCall path drops metadata before the TUI caches receiver threads.

How

  • Adds optional agentNickname / agentRole to CollabAgentState.
  • Copies metadata from spawn-end, wait-begin, and wait-end collab events into app-server thread items and replay history.
  • Lets the TUI cache or upgrade receiver metadata from metadata-bearing collab notifications before rendering live and replayed tool-call rows.
  • Keeps raw thread IDs as the fallback when no metadata exists.

Validation

  • cargo fmt --all
  • git diff --check

Local Rust test/check execution is blocked in this environment by missing OpenSSL development files:

openssl-sys: Could not find directory of OpenSSL installation
The file `openssl.pc` needs to be installed and the PKG_CONFIG_PATH environment variable must contain its parent directory.

Notes

External code contributions are by invitation only per docs/contributing.md; this PR is opened as a concrete implementation reference for the linked bug report and can be closed if maintainers prefer to land an owner-authored fix.

@iqdoctor
Copy link
Copy Markdown
Member Author

Updated PR after Scholastic/code-review gates.

What changed:

  • Propagates subagent nickname/role through live app-server collab events and persisted thread-history replay.
  • Keeps legacy begin events content-free unless metadata exists; synthetic PendingInit is only used to carry receiver metadata.
  • Documents wait-end authority with tests: when agent_statuses is present it drives receiver ids/status/metadata, including empty legacy statuses.
  • Regenerated app-server schema fixtures for optional agentNickname/agentRole.
  • Fixed a TUI helper compile issue by avoiding mixed-type or-pattern bindings.

Validation:

  • cargo fmt --all
  • git diff --check
  • cargo test -p codex-app-server-protocol collab -- --nocapture (13 passed)
  • just test -p codex-app-server-protocol (219 passed incl. schema fixtures)
  • cargo check -p codex-tui --tests
  • cargo test -p codex-tui collab_receiver_notification -- --nocapture (2 passed)

Gates:

  • Scholastic: initial REQUEST_CHANGES, repaired; re-run APPROVE.
  • Code-review: initial REQUEST_CHANGES, repaired; re-run APPROVE/CLEAR.

Note: Cargo.lock drift from cargo was reverted; PR intentionally excludes Cargo.lock.

@iqdoctor iqdoctor force-pushed the fix/subagent-event-labels branch from bb67064 to 8230ebf Compare May 29, 2026 23:10
@iqdoctor iqdoctor force-pushed the fix/subagent-event-labels branch from 8230ebf to aa907ec Compare May 29, 2026 23:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant