Surface ACP delegate errors in the TUI.

c9a6c21bbd71 · AtlantisPleb · · parent 988cbfd40d31

Surface ACP delegate errors in the TUI.

Deploy story

What this commit did to the running system — joined from the forge receipt chain, the part a commit page elsewhere cannot show.

Not deployed through the forge lane

No push, promotion, build, or deploy receipt references this commit (receipts are scanned over a bounded recent window). Changes shipped by full node replacement carry their proof in the release gate receipt instead.

Changed files

  • modified crates/coder-lite/src/runtime.rs

Diff

1 file changed, +38 -10

crates/coder-lite/src/runtime.rs modified +38 -10

@@ -126,27 +126,55 @@ impl CoderRuntimeSession {

126 126
            if let Some((call_id, agent_id, task)) = pending_tool.take() {
127 127
                if let Some(agent) = self.agents.iter().find(|a| a.id == agent_id).cloned() {
128 128
                    let cwd = env::current_dir().unwrap_or_else(|_| PathBuf::from("."));
129
                    let mut header_sent = false;
129 130
                    let result = {
130 131
                        let tx = tx.clone();
131 132
                        AcpHarness {
132 133
                            command: agent.command,
133 134
                            args: agent.args,
134 135
                        }
135
                        .run(&task, &cwd, move |event| match event {
136
                            AcpEvent::Tool { title, .. } => {
137
                                let _ = tx.send(Control::Tool {
138
                                    agent: agent_id.clone(),
139
                                    title,
140
                                });
136
                        .run(&task, &cwd, |event| {
137
                            match event {
138
                                AcpEvent::Tool { title, .. } => {
139
                                    header_sent = true;
140
                                    let _ = tx.send(Control::Tool {
141
                                        agent: agent_id.clone(),
142
                                        title,
143
                                    });
144
                                }
145
                                AcpEvent::Text { chunk } => {
146
                                    let _ = tx.send(Control::ToolText(chunk));
147
                                }
148
                                _ => {}
141 149
                            }
142
                            AcpEvent::Text { chunk } => {
143
                                let _ = tx.send(Control::ToolText(chunk));
144
                            }
145
                            _ => {}
146 150
                        })
147 151
                        .await
148 152
                    };
149 153
154
                    match &result {
155
                        Ok(_) if !header_sent => {
156
                            let _ = tx.send(Control::Tool {
157
                                agent: agent_id.clone(),
158
                                title: "completed".to_string(),
159
                            });
160
                        }
161
                        Err(_) if !header_sent => {
162
                            let _ = tx.send(Control::Tool {
163
                                agent: agent_id.clone(),
164
                                title: "error".to_string(),
165
                            });
166
                            let _ = tx.send(Control::ToolText(
167
                                result.as_ref().err().unwrap().to_string(),
168
                            ));
169
                        }
170
                        Err(_) => {
171
                            let _ = tx.send(Control::ToolText(
172
                                result.as_ref().err().unwrap().to_string(),
173
                            ));
174
                        }
175
                        _ => {}
176
                    }
177
150 178
                    let _ = tx.send(Control::ToolDone);
151 179
                    let output = result.unwrap_or_else(|e| e.to_string());
152 180
                    self.history.push(Item::FunctionCallOutput {

This page updates live while a promote is in flight · changelog