Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 12 additions & 5 deletions apps/decodex/src/agent/app_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3062,15 +3062,22 @@ fn wait_for_turn_completion(
Some(target_turn_id),
),
)?,
JsonRpcMessage::Response(_) | JsonRpcMessage::Error(_) => {
eyre::bail!(
"Received an unexpected JSON-RPC response while waiting for turn completion."
);
},
JsonRpcMessage::Response(_) => ignore_orphan_turn_json_rpc_response(),
JsonRpcMessage::Error(_) => reject_unexpected_turn_json_rpc_error()?,
}
}
}

fn ignore_orphan_turn_json_rpc_response() {
tracing::debug!(
"Recorded and ignored orphan app-server JSON-RPC response while waiting for turn completion."
);
}

fn reject_unexpected_turn_json_rpc_error() -> crate::prelude::Result<()> {
eyre::bail!("Received an unexpected JSON-RPC error while waiting for turn completion.");
}

fn turn_wait_timeout_error(
target_thread_id: &str,
target_turn_id: &str,
Expand Down
Loading