Skip to main content

Module response

Module response 

Source
Expand description

Response collection + error classification.

After the agent finishes (tmux session ends), this module:

  1. Reads the output file
  2. Parses the response JSON
  3. Classifies errors (timeout, usage limit, auth, tooling)
  4. 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§

ReviewIssue
A single issue found during review.
ReviewResponse
Review response from the review agent.

Enums§

RetryableError
Retryable error types that should trigger agent failover.
WeightSignal
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_recorded means the caller already ran record_credit_exhaustion; the generic failure_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.