Provider reactor — agent lifecycle orchestration #12
Labels
No labels
area:config
area:contracts
area:engine
area:eventsourcing
area:frontend
area:git
area:ipc
area:persistence
area:provider
area:scaffold
area:terminal
type:user-story
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
charles/peon#12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
User story
As a user starting a turn, I want the ProviderReactor to automatically spawn the appropriate AI agent when a turn begins, stream its responses back as domain events, and handle completion/failure, so that the full turn lifecycle is automated.
Acceptance criteria
ProviderReactor (
orchestration/reactors/provider_reactor.rs)ReactortraitProviderManagerand a weak ref toOrchestrationEngineTurnStartedevent:ProviderAdapterfromProviderManagertokio::taskthat callsadapter.start_session()ProviderEvent, dispatchesOrchestrationCommand::IngestProviderEventback to the engineTurnInterruptedevent:adapter.interrupt(thread_id)to kill the agent processIngestProviderEvent(TurnComplete)if not already sentTurnFailedevent with the error messageIngestProviderEvent handling (in Decider)
ProviderEvent::TextDelta→MessageChunkReceivedeventProviderEvent::ToolCall→MessageAppended(ToolCall)eventProviderEvent::ToolResult→MessageAppended(ToolResult)eventProviderEvent::ThinkingDelta→MessageAppended(ThinkingBlock)orMessageChunkReceivedProviderEvent::TurnComplete→TurnCompleted+ThreadStatusChanged(Idle)ProviderEvent::Error→TurnFailed+ThreadStatusChanged(Error(...))ProviderEvent::AwaitingApproval→ThreadStatusChanged(AwaitingApproval)Tests
Out of scope
References
Dependencies
issue-11-provider-adapter(then rebase ontoissue-7-enginechain)