Skip to main content

TOOL_ERROR_METADATA_KEY

Constant TOOL_ERROR_METADATA_KEY 

Source
pub const TOOL_ERROR_METADATA_KEY: &str = "sc.tool_error";
Expand description

TR-10: reserved ChatMessage.metadata key marking a Role::Tool result message as an ERROR result — the call it answers did not execute successfully. ReductionKind::ToolInputElided’s candidate rule needs this success/failure signal, and ChatMessage otherwise has no structural slot for it: a Claude tool_result wire block carries is_error (captured on import, session.rs), and the live agent knows is_error only transiently as Agent::run_tool’s return value (agent.rs) — neither previously survived onto the ChatMessage the reduction layer sees. Set at message-creation time by the importer/agent; the reduction layer reads it through tool_outcome.