Add keyboard based fast switching between agents in TUI#13923
Conversation
Add multi-agent footer labels, spawn-ordered agent cycling, and OS-specific next/previous shortcuts in the TUI. Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Co-authored-by: Codex <noreply@openai.com>
Clarify the footer terminology introduced by the multi-agent navigation change so reviewers can read the touched code in isolation. Define the status line, instructional footer, and contextual footer locally and explain how the active agent label fits into that model. Co-authored-by: Codex <noreply@openai.com>
refactor: extract agent navigation state from App Move the multi-agent picker ordering, adjacent-thread navigation, and active-agent label derivation into a dedicated app::agent_navigation module so App no longer owns another chunk of pure state-management logic. This code previously landed in app.rs, which is already large enough that adding more stateful UI logic there makes review and maintenance harder. Pulling the pure navigation rules into a small module gives those invariants a tighter home, keeps the tests next to the behavior, and makes App call into the logic instead of continuing to grow as a god class. The new module keeps the stable first-seen thread order, exposes the picker and footer label helpers, and carries focused tests next to the implementation. App now delegates to that module and keeps the UI side effects and backend coordination. Add repo guidance to prefer extracting new modules once Rust files grow large, with concrete examples from the high-touch TUI orchestration files that tend to accumulate unrelated behavior. Co-authored-by: Codex <noreply@openai.com>
ProblemMulti-agent sessions in the TUI already let users spawn and inspect parallel The implementation also added more state-management logic to What This DeliversThis PR adds direct keyboard navigation between agent threads in the TUI, Users can now:
The PR also:
Mental modelThe app now tracks two closely related ideas for multi-agent sessions:
Fast switching uses that stable first-seen order, not thread-id sorting, so The footer follows the thread whose transcript is actually being displayed, not The footer itself now has a clearer model:
Non-goalsThis PR does not change how agent threads are created, resumed, or closed. It The TradeoffsUsing stable spawn order makes navigation predictable and preserves muscle Extracting the pure navigation logic into a sibling module slightly increases The active-agent label only appears when the footer is showing contextual Architecture
ObservabilityThere is no new runtime logging. The behavior is covered through unit tests and The main invariants exercised here are:
Tests
|
|
Follow-up updates in this PR:
|
Summary
/agentpicker and add snapshot/regression coverageTesting