Skip to main content

Module agent_advisor

Module agent_advisor 

Source
Expand description

Concrete AdvisorAgent adapter over crate::Agent.

The SDK exposes the AdvisorAgent trait (so tests/SDK consumers can hand-roll a fake), but every real consumer that drives an oxicode_agent::Agent repeats the same 5-method mapping. This adapter removes that boilerplate — the host wiring and SDK consumers both use AgentAdvisor::new.

Method mapping (verified against Agent):

  • promptAgent::continue_with (preserves advisor context across turns; run_with_channel auto-resets the cancel flag, so a prior abort does not strand the next prompt)
  • abortAgent::cancel
  • resetAgent::reset
  • rollback_toAgent::update_state(|s| s.messages.truncate(count))
  • message_countAgent::state().messages.len()

Structs§

AgentAdvisor
An AdvisorAgent backed by a concrete Agent.

Type Aliases§

AdvisorPromptHook
Hook fired after each successful advisor prompt, with the advisor agent. The host uses it to persist advisor turns to <session>/__advisor.jsonl.