Harden TUI subagent navigation (#39088)

## What changed

- Use `/subagents` consistently for the subagent picker and status UI, removing the `/agent` alias.
- Rejoin already-loaded subagent threads without overriding their existing settings.
- Route notifications and approval requests only to the active thread or its known subagents, discard unrelated startup events, and avoid replaying resolved approvals.

## Testing

- Add coverage for filtering buffered startup events, dropping resolved approvals, preserving owned subagent approvals, and resuming threads without setting overrides.

GitOrigin-RevId: b4e597f7cd4756faccf31d8b964e7a172f5ab0eb
This commit is contained in:
Eric Traut authored and copyberry committed 2026-08-17 22:31:13 +00:00
1 parent fc6268ad38
commit 0c14c73471
19 files changed
+401 -46

No files matched your search

@@ -313,7 +313,7 @@ impl ChatWidget {
SlashCommand::Side | SlashCommand::Btw => {
self.request_empty_side_conversation(cmd);
}
SlashCommand::Agent | SlashCommand::MultiAgents => {
SlashCommand::MultiAgents => {
self.app_event_tx.send(AppEvent::OpenAgentPicker);
}
SlashCommand::Permissions => {
@@ -1139,7 +1139,6 @@ impl ChatWidget {
| SlashCommand::Side
| SlashCommand::Btw
| SlashCommand::Keymap
| SlashCommand::Agent
| SlashCommand::MultiAgents
| SlashCommand::Permissions
| SlashCommand::ElevateSandbox
@@ -49,7 +49,7 @@ async fn parent_owned_thread_blocks_all_direct_input_entry_points() {
"/side inspect this",
"/archive",
"/rename",
"/agent parent",
"/subagents parent",
"/diff now",
"!echo blocked",
" !echo blocked",
@@ -891,11 +891,11 @@ async fn esc_with_pending_steers_overrides_agent_command_interrupt_behavior() {
}
chat.bottom_pane
.set_composer_text("/agent ".to_string(), Vec::new(), Vec::new());
.set_composer_text("/subagents ".to_string(), Vec::new(), Vec::new());
chat.handle_key_event(KeyEvent::new(KeyCode::Esc, KeyModifiers::NONE));
next_interrupt_op(&mut op_rx);
assert_eq!(chat.bottom_pane.composer_text(), "/agent ");
assert_eq!(chat.bottom_pane.composer_text(), "/subagents ");
}
#[tokio::test]