Skip to content

Fix disappearing user message and implement real-time SSE streaming#77

Merged
MinecraftFuns merged 7 commits intomainfrom
fix/chat-issues-and-e2e-5111495665824634712
Feb 27, 2026
Merged

Fix disappearing user message and implement real-time SSE streaming#77
MinecraftFuns merged 7 commits intomainfrom
fix/chat-issues-and-e2e-5111495665824634712

Conversation

@ToolchainLab
Copy link
Collaborator

This PR addresses two main issues:

  1. Disappearing User Message: The user's message would disappear after sending until a page reload. This was fixed by returning the persisted user message from the backend and updating the frontend state to replace the temporary optimistic message with the real one.
  2. Lack of Streaming: The SSE implementation was not streaming tokens in real-time. I implemented an on_token callback pattern in the backend agent engine and updated the specialist agents to stream tokens. The frontend now listens for message.chunk events and updates the UI incrementally.

Additionally, I added E2E test files for settings and updates walkthroughs to improve coverage.


PR created automatically by Jules for task 5111495665824634712 started by @ToolchainLab

- Backend: Update `SendMessageResponse` to include the confirmed user message.
- Backend: Implement `on_token` callback in `process_turn` and pass to specialist agents.
- Backend: Update `run_coach`, `run_intake`, `run_feedback` to stream tokens via `astream_events`.
- Frontend: Update `ChatThread` to replace temporary user message with server-confirmed one.
- Frontend: Update `ChatThread` to handle `message.chunk` SSE events for real-time streaming.
- E2E: Add tests for disappearing message fix and user story walkthroughs (settings, updates).

Co-authored-by: ToolchainLab <263750431+ToolchainLab@users.noreply.github.com>
@google-labs-jules
Copy link
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

google-labs-jules bot and others added 6 commits February 27, 2026 03:18
… fix CI issues

- Backend: Update `SendMessageResponse` to include the confirmed user message.
- Backend: Implement `on_token` callback in `process_turn` and pass to specialist agents.
- Backend: Update `run_coach`, `run_intake`, `run_feedback` to stream tokens via `astream_events`.
- Backend: Fix missing imports (`Callable`, `Coroutine`) in `engine.py`.
- Frontend: Update `ChatThread` to replace temporary user message with server-confirmed one.
- Frontend: Update `ChatThread` to handle `message.chunk` SSE events for real-time streaming.
- E2E: Add tests for disappearing message fix and user story walkthroughs (settings, updates).
- E2E: Fix `scripts/seed_e2e.py` to be idempotent to prevent CI failures.
- E2E: Use robust locators in `settings.spec.ts` and `updates.spec.ts`.

Co-authored-by: ToolchainLab <263750431+ToolchainLab@users.noreply.github.com>
- Refactor `run_coach`, `run_intake`, `run_feedback` to use shared `run_agent` in `api/app/agents/runner.py`.
- Fix E2E tests for settings (specific locator) and updates (idempotent seed).
- Fix backend unit test imports (`Callable`, `Coroutine`).
- Clean up unused imports.

Co-authored-by: ToolchainLab <263750431+ToolchainLab@users.noreply.github.com>
- Refactor `run_coach`, `run_intake`, `run_feedback` to use shared `run_agent` in `api/app/agents/runner.py`.
- Fix CI formatting failure by running `ruff format` (updated `api/app/routes.py`).
- Fix `web/e2e/settings.spec.ts` by waiting for "Notification Settings" button visibility.
- Fix `web/e2e/updates.spec.ts` by waiting for onboarding URL before interacting.
- Fix `F821` and `F401` linting errors in `api/app/agents/engine.py` (proper imports, remove unused).

Co-authored-by: ToolchainLab <263750431+ToolchainLab@users.noreply.github.com>
- Refactor `run_coach`, `run_intake`, `run_feedback` to use shared `run_agent` in `api/app/agents/runner.py`.
- Fix CI formatting failure by running `ruff format` (updated `api/app/routes.py`).
- Fix `web/e2e/settings.spec.ts` by waiting for "Notification Settings" button visibility.
- Fix `web/e2e/updates.spec.ts` by waiting for onboarding URL before interacting.
- Fix `F821` and `F401` linting errors in `api/app/agents/engine.py` (proper imports, remove unused).

Co-authored-by: ToolchainLab <263750431+ToolchainLab@users.noreply.github.com>
- Refactor `run_coach`, `run_intake`, `run_feedback` to use shared `run_agent` in `api/app/agents/runner.py`.
- Fix CI formatting failure by running `ruff format` (updated `api/app/routes.py`).
- Fix `web/e2e/settings.spec.ts` by waiting for "Notification Settings" button visibility and using `waitForResponse` to handle navigation.
- Fix `web/e2e/updates.spec.ts` by waiting for onboarding URL before interacting and using `waitForResponse` to handle navigation.
- Fix `F821` and `F401` linting errors in `api/app/agents/engine.py` (proper imports, remove unused).
- Fix `scripts/seed_e2e.py` to be idempotent.

Co-authored-by: ToolchainLab <263750431+ToolchainLab@users.noreply.github.com>
- Refactor `run_coach`, `run_intake`, `run_feedback` to use shared `run_agent` in `api/app/agents/runner.py`.
- Fix CI formatting failure by running `ruff format` (updated `api/app/routes.py`).
- Fix `web/e2e/settings.spec.ts` by waiting for "Notification Settings" button visibility and using `waitForResponse` to handle navigation.
- Fix `web/e2e/updates.spec.ts` by waiting for onboarding URL before interacting and using `waitForResponse` to handle navigation.
- Fix `F821` and `F401` linting errors in `api/app/agents/engine.py` (proper imports, remove unused).
- Fix `scripts/seed_e2e.py` to be idempotent.
- Add wait for dashboard redirect in user registration flow in `settings.spec.ts` and `updates.spec.ts` to ensure profile sync before joining project.

Co-authored-by: ToolchainLab <263750431+ToolchainLab@users.noreply.github.com>
@MinecraftFuns MinecraftFuns marked this pull request as ready for review February 27, 2026 04:28
@MinecraftFuns MinecraftFuns merged commit ab2a202 into main Feb 27, 2026
9 checks passed
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