Skip to content

pi_agent: loop + Agent SDK with events and tool hooks #21

Description

@maozhen520

Parent

What to build

End-to-end agent runtime behavior behind a fake StreamFn: pure loop + stateful Agent with prompt/continue/steer/follow_up, awaited subscribe settlement, fixed event sequence, AgentMessage→LLM Message projection, and tool before/after hooks under parallel|sequential batching.

Acceptance criteria

  • Dual public surface: agent loop and stateful Agent
  • Agent supports prompt / continue / steer / follow_up without concurrent prompt
  • Awaited ordered subscribe settles handlers before the runtime advances
  • Full agent/turn/message/tool event set emits in the settled order
  • Transcript stores AgentMessages; LLM Messages appear only at stream time via convert hooks
  • Tool batching supports parallel and sequential modes with before/after hooks
  • Stream function is injectable (no hard dependency on live LiteLLM inside tests)
  • Pytest verifies the above with a fake StreamFn

Blocked by

  • pi_llm: LiteLLM stream, tools assemble, credentials, errors

Metadata

Metadata

Assignees

Labels

ready-for-agentFully specified, ready for an AFK agent

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions