MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / wait_for_response

Function wait_for_response

src/sessions/codex_app_server.rs:289–307  ·  view source on GitHub ↗
(
    line_rx: &mpsc::Receiver<std::io::Result<String>>,
    deadline: Instant,
    id: i64,
)

Source from the content-addressed store, hash-verified

287}
288
289fn wait_for_response(
290 line_rx: &mpsc::Receiver<std::io::Result<String>>,
291 deadline: Instant,
292 id: i64,
293) -> Result<Value> {
294 loop {
295 let line = recv_line(line_rx, deadline)?;
296 let value: Value = serde_json::from_str(&line)?;
297 if value.get("id").and_then(Value::as_i64) != Some(id) {
298 continue;
299 }
300 if let Some(error) = value.get("error") {
301 return Err(TraceDecayError::Config {
302 message: format!("codex app-server request {id} failed: {error}"),
303 });
304 }
305 return Ok(value);
306 }
307}
308
309fn wait_for_turn_summary(
310 line_rx: &mpsc::Receiver<std::io::Result<String>>,

Callers 1

Calls 1

recv_lineFunction · 0.85

Tested by

no test coverage detected