agent_servers: Include result text in Claude error messages (#35156)
This will better surfaces issues that are classified as "success" but actually have a more meaningful error message attached. Release Notes: - N/A
This commit is contained in:
parent
a5b7cfd128
commit
c995d45bd9
1 changed files with 10 additions and 2 deletions
|
@ -414,11 +414,19 @@ impl ClaudeAgentSession {
|
|||
}
|
||||
}
|
||||
SdkMessage::Result {
|
||||
is_error, subtype, ..
|
||||
is_error,
|
||||
subtype,
|
||||
result,
|
||||
..
|
||||
} => {
|
||||
if let Some(end_turn_tx) = end_turn_tx.borrow_mut().take() {
|
||||
if is_error {
|
||||
end_turn_tx.send(Err(anyhow!("Error: {subtype}"))).ok();
|
||||
end_turn_tx
|
||||
.send(Err(anyhow!(
|
||||
"Error: {}",
|
||||
result.unwrap_or_else(|| subtype.to_string())
|
||||
)))
|
||||
.ok();
|
||||
} else {
|
||||
end_turn_tx.send(Ok(())).ok();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue