Skip to content

fix(agents): extract intermediate agent text + pin chain tests - #1038

Merged
Spherrrical merged 2 commits into
katanemo:mainfrom
romamid:romamid/intermediate-agent-response
Oct 7, 2026
Merged

Spherrrical merged 2 commits into
katanemo:mainfrom
romamid:romamid/intermediate-agent-response

Conversation

@romamid

@romamid romamid commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Intermediate agent replies in a multi-agent chain are collected via collect_full_response. The non-streaming path previously returned the raw chat.completion JSON envelope instead of the assistant text, causing the next agent to sometimes receive a serialized object as context.
  • Extract /choices/0/message/content when present; fall back to the body when content is missing or the response is not JSON.
  • Add mockito unit tests for execute_agent_chain and select_agents that simulate the sequential chain (route order, named assistant injection, last-agent-wins, single-agent short-circuit, fallbacks).

Working on extending Plano to support better multi-agent composition on the agent path (specifically subagent orchestration). Follow-up work will stay opt-in and will not change the Plano-Orchestrator prompt / {"route": [...]} contract.

Testing

  • cargo test -p brightstaff --lib handlers::response
  • cargo test -p brightstaff --lib handlers::agents
  • future iteration: design a two-agent benchmarking listener to confirm intermediate context is working appropriate accordingly (communicated via plain text rather than json)

Recover the mockito harness so execute_agent_chain and select_agents
behavior can change safely based on subagent/orch work.
@romamid

romamid commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor Author

First iteration towards multi-agent composition. Design/optimization question: #1039

@Spherrrical
Spherrrical merged commit a031d31 into katanemo:main Oct 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants