(bug) A refused template load shows a raw JSON error and replays the same request forever
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
- #7117 di @lorenzozanee — chiusa senza merge
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Stack tecnologico
- python, typescript
Direzione di ricerca
Start with web/packages/agenta-entities/src/workflow/state/loadTemplate.ts and the existing cleanup primitive in agenta-entities/src/session/api/api.ts; then trace error extraction through web/packages/agenta-shared/src/utils/extractApiErrorMessage.ts and the two router exception definitions. Check the linked PR #7117 and its discussion before proceeding. Done means terminal conflicts clear the stored intent, the API message reaches the toast, and both routers use the same conflict code, with tests covering those cases.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
When creating an agent from a template is refused with a 409, the toast shows the raw error body, and the app keeps the stored request, so pressing Create again sends the same request under the same key and gets the same refusal. The only way out is to close the tab.
What the user sees
The toast reads:
Status code: 409
Body: {
"detail": {
"code": "template_load_conflict",
...
}
}
The sentence the API wrote for this case never reaches the screen, and the raw JSON is not something a user can act on.
Steps to reproduce
- Start creating an agent from a gallery template.
- Make the template load answer 409.
- Press Create again, and reload the page and press Create again.
Expected: a readable message saying what went wrong, and a way to start over.
Actual: the raw body above, on every attempt, for as long as the tab is open.
Where it comes from
Read on release/v0.119.1.
The stored intent survives the failure. web/packages/agenta-entities/src/workflow/state/loadTemplate.ts writes {key, request} into sessionStorage before the call, and clears it only on success, or when the user explicitly cancels through abandonAgentTemplateLoad. Every later attempt reads the stored intent back, including after a page reload, so a deterministic refusal is a dead end for that project and template.
The message is lost in the client. The generated client collapses the response into an AgentaApiError whose message is built from the status code and the serialized body (web/packages/agenta-api-client/src/generated/errors/AgentaApiError.ts). extractApiErrorMessage (web/packages/agenta-shared/src/utils/extractApiErrorMessage.ts) finds no detail.message on that error object and falls back to error.message, which is that assembled string. web/packages/agenta-home-ui/src/useCreateAgent.ts toasts the result. The string template_load_conflict appears nowhere in web/.
The two routers that can raise this also disagree on the code. The agent templates router answers template_load_conflict (api/oss/src/apis/fastapi/agent_templates/exceptions.py) and the sessions router answers idempotency_key_reused for the same condition, so a client cannot branch on the code.
Note that PR #7026 changes this file for a different case: an edited prompt now mints a new key instead of replaying the old body. That does not cover a refusal on an unchanged body, which is the case here.
Proposed fix
- Clear the stored intent in
loadTemplate.tswhen the response carries a terminal conflict code, before rethrowing, so the next attempt starts a new creation instead of replaying a dead one. The primitive already exists one endpoint over, inagenta-entities/src/session/api/api.ts. - Render the message the API sent, by reading
detail.messageoff the error body rather than letting the toast fall back to the assembled error string. - Make the two routers answer the same code for the same condition, so a client can branch on it.
- Lingua principale
- TypeScript
- Stelle
- 4.8k
- Fork
- 690
- Merge medio
- 20h 5m
- PR unite (30g)
- 420
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 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 già presa @rishu685 l’ha presa 6 giorni fa. 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 frontend
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
Agenta-AI/agenta#7426 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
No CI job runs the mobile app's unit testsForse già presa @Mahaboob-Ashraf l’ha presa 6 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
Agenta-AI/agenta#7326 · 2 commenti · 1 reazione ·
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 82/100
I maintainer di solito rispondono entro 1 giorno
-
high priority
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
CI-CMG/deep-sea-corals-exb#84 · 1 commento ·
-
Create/import wallet form shows raw "password must be at least 1 characters" instead of the translated messageForse già presa @CapThunder19 l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
joinmarket-webui/jam#1538 ·
I maintainer di solito rispondono entro 1 giorno
-
t0ggles
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
nolimits4web/swiper#8240 · 1 commento ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno