Skip to content

Conversation

@keugenek
Copy link
Contributor

image

// Phase 1: AgentMessage with ToolUse -> emit ToolResult
// IMPORTANT: We check if self.recipient is None OR matches the event's recipient
// This is crucial because:
// 1. Some ToolProcessors (like for task execution) have recipient: None to process all tools
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, can we make ToolProcessor echo the recipient based on who spawned the task? Maybe that's part of #462 though

let events = self.event_store.load_events::<Event>(&query, None).await?;
let mut thread = Thread::fold(&events);

// Check recipient filter
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part looks brittle. Maybe it should be a lambda function if we really, really need it?

.run(stream_id.to_owned(), AGGREGATE_ID.to_owned())
.await

if planning {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hope it is for the demo only :D

- Replace tokio::select! with tokio::try_join! to keep both pipelines running
- Add comprehensive logging to ThreadProcessor for debugging
- Add thread state validation before generating completions
- Handle UserInputRequested events in Thread::apply to fix message sequencing

The issue was that UserInputRequested events weren't being treated as assistant messages,
causing the thread to reject subsequent user messages with 'WrongTurn' error.
@keugenek keugenek closed this Oct 20, 2025
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.

3 participants