Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

fix(frontend): /m replies paint only at turn end when the session is outside the user's default project

Chiusa Adatta ai principianti
#7,542 1 commento 1 reazione 0 assegnatari Vedi su GitHub

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

  1. Use an account that has more than one project.
  2. Open a session in a project that is not the account's default project, and send a message that produces a long reply.
  3. 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=0 returned 0 durable events and ready with watermark 0.
  • /events?after=0&project_id=<the session's project> returned 15 durable events and ready with 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

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Agenta-AI/agenta

Tutte le issue di Agenta-AI/agenta

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.