Expand description
Response collection + error classification.
After the agent finishes (tmux session ends), this module:
- Reads the output file
- Parses the response JSON
- Classifies errors (timeout, usage limit, auth, tooling)
- Determines next action (success, reroute, needs_review)
Re-exports§
pub use crate::engine::cooldown::clear_expired_cooldowns;pub use crate::engine::cooldown::is_agent_in_cooldown;pub use crate::engine::cooldown::is_model_in_cooldown;pub use crate::engine::cooldown::record_agent_failure_with_message;pub use crate::engine::cooldown::record_model_failure;pub use crate::engine::cooldown::set_agent_cooldown;
Structs§
- Review
Issue - A single issue found during review.
- Review
Response - Review response from the review agent.
Enums§
- Retryable
Error - Retryable error types that should trigger agent failover.
- Weight
Signal - Outcome signal for the engine to update router weights.
Functions§
- get_
reroute_ chain - Get the reroute chain from store.
- handle_
failover - Handle failover for any retryable error type. Returns “new” on reroute (or
retryable exhaustion), “blocked” on hard exhaustion, “needs_review” when no
fallback agents are available.
credit_recordedmeans the caller already ranrecord_credit_exhaustion; the genericfailure_count:counter must not be bumped here or the next ordinary failure starts at the extended backoff tier (issue #3652). Rate-limit event DB recording is done by the caller (mod.rs) - infer_
review_ response - Public entry point for keyword-based review response inference.
- parse_
review_ response - Parse a review response from already-unwrapped text.
- pick_
fallback_ agent - Pick a fallback agent, avoiding agents already in the reroute chain and agents in cooldown.
- read_
output_ file - Read the agent’s output file, trying multiple locations.
- store_
failure_ memory - Store a memory entry for a failed attempt (without a full AgentResponse).
- store_
learnings_ from_ response - Extract learnings and store as memory for future attempts.
- update_
reroute_ chain - Update the reroute chain in store.
- wait_
for_ fallback_ backoff - Wait with exponential backoff before retrying with a fallback agent. Returns the delay applied in milliseconds.