Stop the turn when a delegate child refuses with 'Upgrade your plan to continue'.

06a9c88d4204 · AtlantisPleb · · parent 2d0c10979fb4

Stop the turn when a delegate child refuses with 'Upgrade your plan to continue'.

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, +14 -0

crates/coder-lite/src/runtime.rs modified +14

@@ -128,6 +128,7 @@ impl CoderRuntimeSession {

128 128
                }
129 129
            }
130 130
131
            let mut turn_failed = false;
131 132
            if let Some((call_id, agent_id, task, raw_args)) = pending_tool.take() {
132 133
                if let Some(agent) = self.agents.iter().find(|a| a.id == agent_id).cloned() {
133 134
                    let _ = tx.send(Control::Tool {

@@ -160,6 +161,15 @@ impl CoderRuntimeSession {

160 161
                    };
161 162
162 163
                    match &result {
164
                        Ok(answer)
165
                            if answer
166
                                .to_lowercase()
167
                                .contains("upgrade your plan to continue") =>
168
                        {
169
                            let _ = tx.send(Control::ToolTitle("refused".to_string()));
170
                            let _ = tx.send(Control::ToolText(answer.clone()));
171
                            turn_failed = true;
172
                        }
163 173
                        Ok(_) if !header_sent => {
164 174
                            let _ = tx.send(Control::ToolTitle("completed".to_string()));
165 175
                        }

@@ -168,6 +178,7 @@ impl CoderRuntimeSession {

168 178
                            let _ = tx.send(Control::ToolText(
169 179
                                result.as_ref().err().unwrap().to_string(),
170 180
                            ));
181
                            turn_failed = true;
171 182
                        }
172 183
                        _ => {}
173 184
                    }

@@ -180,6 +191,9 @@ impl CoderRuntimeSession {

180 191
                        output: FunctionOutput::Text(output),
181 192
                        status: None,
182 193
                    });
194
                    if turn_failed {
195
                        break;
196
                    }
183 197
                    continue;
184 198
                } else {
185 199
                    let msg = format!("unknown ACP agent: {}", agent_id);

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