Skip to content

Conversation

@kappa90
Copy link
Contributor

@kappa90 kappa90 commented Oct 31, 2025

Problem

To enable reusing the base assistant for Deep Research, we need to move the reducer/stream processor upstream, outside of Temporal, so that DR can call the agent using a ChildWorkflow and reducing the stream in a different way.

This is the third and last PR in a stack with the full change. Won't merge any PR in the stack until all are approved.

This PR has the full functionality and fixes all the tests

This PR refactors the Assistant API to use a more direct event streaming approach, simplifying the architecture by removing the intermediate event type layer, directly yielding AssistantDispatcherEvent.

Closes #12345

Changes

  • Refactored BaseAssistant to yield raw AssistantDispatcherEvent objects directly instead of wrapping them in event type tuples
  • Removed the AssistantGenerationStatusEvent and related status event handling as it's not relevant anymore
  • Simplified the AssistantSSESerializer to handle the new event structure
  • Updated the max_tools.py API endpoint to use the new message format

How did you test this code?

  • Added new unit tests for the AssistantSSESerializer in test_sse.py
  • Updated existing tests in test_stream_processor.py and test_redis_stream.py to work with the new event structure
  • Local testing
Copy link
Contributor Author

kappa90 commented Oct 31, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@kappa90 kappa90 marked this pull request as ready for review October 31, 2025 15:40
@kappa90 kappa90 requested a review from a team October 31, 2025 15:40
@github-actions
Copy link
Contributor

github-actions bot commented Oct 31, 2025

Size Change: 0 B

Total Size: 3.34 MB

ℹ️ View Unchanged
Filename Size
frontend/dist/toolbar.js 3.34 MB

compressed-size-action

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

36 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

2 snapshot changes in total. 0 added, 2 modified, 0 deleted:

  • chromium: 0 added, 2 modified, 0 deleted (diff for shard 2)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

@kappa90 kappa90 force-pushed the 10-31-feat_ph-ai_remove_stream_processing_from_assistant_class branch from 41ef5dc to 885c396 Compare October 31, 2025 17:21
@kappa90 kappa90 force-pushed the 10-30-feat_ph-ai_move_stream_processor_outside_temporal branch from 96868e7 to 1aedf73 Compare October 31, 2025 17:21
@posthog-bot
Copy link
Contributor

📸 UI snapshots have been updated

2 snapshot changes in total. 0 added, 2 modified, 0 deleted:

  • chromium: 0 added, 2 modified, 0 deleted (diff for shard 14)
  • webkit: 0 added, 0 modified, 0 deleted

Triggered by this commit.

👉 Review this PR's diff of snapshots.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants