fix(frontend): /m replies paint only at turn end when the session is outside the user's default project
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- frontend
Research direction
Start with web/packages/agenta-chat/src/transport/sessionLiveEvents.ts and the useSessionLivePreview call site that reads projectIdAtom. Trace how the project ID reaches connectSessionLiveEvents, then check the existing /sessions/watch and /sessions/streams/watch URL patterns. Add a unit test for sessionLiveEventsUrl; done means it includes the session’s project ID and live replies stream for non-default projects.
Written by the indexing model from the issue text.
Description
Symptom
In /m, an agent reply does not stream. The page shows nothing while the model writes, and then it shows the whole reply at once when the turn ends. The network tab shows the /invoke response streaming text deltas the whole time (for example 271 deltas over 2 seconds), so the model and the runner stream correctly.
It happens only when the session belongs to a project that is not the user's default project. A user with one project sees a normal streaming reply.
Steps to reproduce
- Use an account that has more than one project.
- Open a session in a project that is not the account's default project, and send a message that produces a long reply.
- The reply appears in one step at the end of the turn.
Cause
With the shared session reader on (AGENTA_SESSIONS_SHARED_READER, on by default since v0.115), the client ignores the text in the /invoke stream and renders live text from GET /api/sessions/{session_id}/events, which it opens with a native EventSource. sessionLiveEventsUrl in web/packages/agenta-chat/src/transport/sessionLiveEvents.ts builds that URL without project_id:
`${getAgentaApiUrl()}/sessions/${encodeURIComponent(sessionId)}/events?after=${Math.max(0, after)}`
An EventSource does not go through the API client that adds project_id, so the auth middleware resolves the user's default project. The endpoint then subscribes to the live channel of the wrong project and replays the wrong project's records. The other EventSource URLs (/sessions/watch, /sessions/streams/watch) already pass project_id.
Evidence from the oss preview stage, with the same browser cookie session and a session in a non-default project:
/events?after=0returned 0 durable events andreadywith watermark 0./events?after=0&project_id=<the session's project>returned 15 durable events andreadywith watermark 25.- A frame published to the session's live channel reached a client that used an API key (which is bound to the right project) at once, and never reached the browser page.
The text appears at turn end because the page then reloads the records through the records/query path, which does pass the project.
Suggested fix
Pass the project to the live events URL. useSessionLivePreview already reads projectIdAtom, so it can hand projectId to connectSessionLiveEvents, and sessionLiveEventsUrl can append &project_id=.... A unit test on sessionLiveEventsUrl would pin it.
- Dominant language
- TypeScript
- Stars
- 4.8k
- Forks
- 690
- Avg merge
- 19h 47m
- Merged PRs (30d)
- 431
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Agenta-AI/agenta
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Agenta-AI/agenta#7468 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
(bug) The Stop button disappears for a moment before an approval card showsPossibly taken @rishu685 claimed this 3 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Agenta-AI/agenta#7446 · 2 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Agenta-AI/agenta#7441 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
bug frontend
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Agenta-AI/agenta#7426 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
No CI job runs the mobile app's unit testsPossibly taken @Mahaboob-Ashraf claimed this 3 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Agenta-AI/agenta#7326 · 2 comments · 1 reaction ·
Maintainers usually reply within 1 day
All issues in Agenta-AI/agenta
Similar issues
-
area:deploy task
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
wilanis/wilanis-js#1017 ·
Maintainers usually reply within 1 day
-
documentation v2
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
modelcontextprotocol/servers#5133 ·
Maintainers usually reply within 1 day
-
budget bug feature frontend good-issue medium needs-review OSCI'26 payments
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
SatyamPandey-07/WorkSphere#5990 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
lugassawan/swe-workbench#799 ·
Maintainers usually reply within 1 day
-
bug good first issue javascript
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
yukikotani231/sqlsift#326 ·
Maintainers usually reply within 1 day