Skip to main content

AgentDisplay

Trait AgentDisplay 

Source
pub trait AgentDisplay {
    // Required methods
    fn start(&mut self);
    fn update(&mut self, activity: &str);
    fn finish_success(&mut self);
    fn finish_error(&mut self, error: &str);
    fn finish_with_outcome(&mut self, outcome: Outcome);
    fn agent_name(&self) -> &str;
    fn elapsed_secs(&self) -> u64;
    fn iteration_info(&self) -> Option<&IterationInfo>;
    fn set_iteration_info(&mut self, info: IterationInfo);
}
Expand description

Common interface for agent display components.

This trait defines a unified contract for how all agents report their status, ensuring consistent display across Runner, Reviewer, Corrector, and Commit phases.

All implementors should provide:

  • Agent name identification
  • Elapsed time tracking
  • Activity preview updates
  • Iteration/progress context

Required Methods§

Source

fn start(&mut self)

Start the display for an agent operation. Called when the agent begins its work.

Source

fn update(&mut self, activity: &str)

Update the display with current activity information.

§Arguments
  • activity - Brief description of current activity (will be truncated if too long)
Source

fn finish_success(&mut self)

Mark the operation as successfully completed. Stops any timers and displays a success message.

Source

fn finish_error(&mut self, error: &str)

Mark the operation as failed. Stops any timers and displays an error message.

§Arguments
  • error - Description of what went wrong
Source

fn finish_with_outcome(&mut self, outcome: Outcome)

Mark the operation as completed with a specific outcome. Allows for more detailed completion information than simple success/failure.

§Arguments
  • outcome - The outcome information including success status and message
Source

fn agent_name(&self) -> &str

Get the agent’s display name

Source

fn elapsed_secs(&self) -> u64

Get the elapsed time in seconds since the operation started

Source

fn iteration_info(&self) -> Option<&IterationInfo>

Get the current iteration information, if any

Source

fn set_iteration_info(&mut self, info: IterationInfo)

Set the iteration information for progress context

Implementors§