tui: allow staged subagent helpers before wiring

This commit is contained in:
Friel
2026-04-02 05:13:02 +00:00
parent 9618e3002b
commit 74644b13de

View File

@@ -935,6 +935,7 @@ impl SubagentRegistry {
.retain(|thread_id, _| !superseded.contains(thread_id));
}
#[cfg_attr(not(test), allow(dead_code))]
fn on_close_end(&mut self, event: &CollabCloseEndEvent) -> Option<Box<dyn HistoryCell>> {
let receiver_id = event.receiver_thread_id;
let info = self.agents.get_mut(&receiver_id)?;
@@ -953,6 +954,7 @@ impl SubagentRegistry {
None
}
#[cfg_attr(not(test), allow(dead_code))]
fn on_wait_end(&mut self, event: &CollabWaitingEndEvent) {
for (thread_id, status) in &event.statuses {
let Some(info) = self.agents.get_mut(thread_id) else {
@@ -1166,6 +1168,7 @@ impl SubagentRegistry {
}
}
#[cfg_attr(not(test), allow(dead_code))]
fn is_terminal_status(status: &AgentStatus) -> bool {
matches!(
status,
@@ -1176,6 +1179,7 @@ fn is_terminal_status(status: &AgentStatus) -> bool {
)
}
#[cfg_attr(not(test), allow(dead_code))]
fn terminal_summary(status: &AgentStatus) -> String {
match status {
AgentStatus::Completed(Some(message)) => {
@@ -2166,6 +2170,7 @@ impl App {
self.primary_thread_id.is_some() && self.active_thread_id == self.primary_thread_id
}
#[cfg_attr(not(test), allow(dead_code))]
fn emit_or_queue_subagent_history(&mut self, cell: Box<dyn HistoryCell>) {
if self.subagents_root_active() {
self.app_event_tx.send(AppEvent::InsertHistoryCell(cell));
@@ -2212,6 +2217,7 @@ impl App {
self.update_subagent_animation(root_active);
}
#[cfg_attr(not(test), allow(dead_code))]
fn process_subagent_side_effects(&mut self, thread_id: ThreadId, event: &Event) {
if self.primary_thread_id == Some(thread_id) {
self.subagents.set_root_thread(thread_id);