fix(frontend): /m replies paint only at turn end when the session is outside the user's default project
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 82/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- typescript
- Ambito
- frontend
Direzione di ricerca
Inizia da web/packages/agenta-chat/src/transport/sessionLiveEvents.ts e dal punto di chiamata di useSessionLivePreview che legge projectIdAtom. Segui il percorso dell’ID del progetto fino a connectSessionLiveEvents, poi controlla i pattern URL esistenti /sessions/watch e /sessions/streams/watch. Aggiungi un test unitario per sessionLiveEventsUrl; il lavoro è completato quando include l’ID del progetto della sessione e lo stream delle risposte in tempo reale per i progetti non predefiniti.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- TypeScript
- Stelle
- 4.8k
- Fork
- 690
- Merge medio
- 21h 53m
- PR unite (30g)
- 451
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Agenta-AI/agenta
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
Agenta-AI/agenta#7654 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
Agenta-AI/agenta#7468 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
(bug) The Stop button disappears for a moment before an approval card showsForse di nuovo libera @rishu685 l’ha presa 9 giorni fa e non c’è nessuna pull request aperta. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Agenta-AI/agenta#7446 · 2 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
Agenta-AI/agenta#7441 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
(bug) Settings > Usage opens AI providers when billing is offForse già presa @adityasingh345 l’ha presa 2 giorni fa. Apertabug frontend
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
Agenta-AI/agenta#7426 · 2 commenti · 2 reazioni ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Agenta-AI/agenta
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
TomerAberbach/profiler-md#733 ·
I maintainer di solito rispondono entro 1 giorno
-
bug priority: medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
brentspine/brents-toasts#143 ·
-
🐛 bug 🗺️ DB Models & Ops
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
LibreChat-AI/LibreChat#17214 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
Wavvon/Wavvon-clients#136 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
umami-software/umami#4637 ·
I maintainer di solito rispondono entro 3 giorni