fix(chat): reopening the panel fails to load history when the Gateway read limit refuses a burst

Aperta
#21 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
api, frontend

Direzione di ricerca

Start with the four failing specs in tests/e2e/live-selfhosted.spec.ts and tests/e2e/live-resilience.spec.ts, and the live setup in tests/e2e/support/live-gateway.md, then find where the panel loads history on open and handles a 429. The Gateway side is in internal/http/extension_api.go (SetRateLimiter, rateLimited) in the Dewee repo, so check whether the burst size is the cause before changing the extension. Done means a refused history load retries after Retry-After or is avoided, and the four tests pass against a Gateway built from dev.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

ai-handle bug

Problem

Four live e2e tests fail against a current Gateway built from nextlevelbuilder/dewee dev, on extension main (4b09bff) as well as on the connected-browser branch:

  • tests/e2e/live-selfhosted.spec.ts › E1 history survives reopening; a lost response reconciles without a duplicate send
  • tests/e2e/live-resilience.spec.ts › E reopening the panel mid-stream reconciles the running reply once
  • tests/e2e/live-resilience.spec.ts › E going offline mid-stream and back online reconciles without a re-send
  • tests/e2e/live-resilience.spec.ts › E a cancelled run stays cancelled after reopening, with one user turn

After the panel reopens it shows "Could not load this conversation. Retry". At the same moment the Gateway logs security.extension_api_rate_limited for the key on the shared read bucket (extension_read_key:), for chat/history, sessions/<key>/status and actions together. gateway.rate_limit_rpm is already 120 in the system config, and the failure reproduces when E1 runs alone after an idle minute.

So reopening the panel sends a burst of read requests that the per-key read bucket refuses, and the panel treats the refused history load as a hard failure instead of retrying after Retry-After.

Expected

  • Reopening the panel never shows "Could not load this conversation" because of a short read burst. Either the panel retries a 429 history load once after Retry-After, or it sends fewer reads on open (for example no parallel status + actions + history).
  • The live setup doc (tests/e2e/support/live-gateway.md) says what limit the live run needs, if a limit change is part of the fix.
  • The four tests pass against a Gateway built from dev.

Notes

  • The extension API limiter is in internal/http/extension_api.go (SetRateLimiter, rateLimited) in the Dewee repo. If the burst size of the read bucket is the real cause, open a linked Dewee issue instead of loosening the extension's behaviour.
  • Found while verifying #17; not caused by that branch.
Lingua principale
TypeScript
Stelle
2
Fork
1
Merge medio
2g 5h
PR unite (30g)
4

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

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 nextlevelbuilder/dewee-chrome-ext

Tutte le issue di nextlevelbuilder/dewee-chrome-ext

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.