fix(tui): surface classified turn-error detail instead of bare request failed - #78809
fix(tui): surface classified turn-error detail instead of bare request failed#78809AnalogHubris wants to merge 2 commits into
Conversation
|
Reviewed since this builds on the compose split from the #64182 thread, and the boundary claim holds up in the code. I checked for it specifically: no classify_api_error calls, no reason derivation, the helper only surfaces facts that already exist (result fields, the agent's _summarize_api_error formatter, route attrs). Enrichment stays in the classifier where #58524 puts the plugin seam, and this composes with it for free: anything a plugin classifier adds to the summary shows up in these frames with no changes here. The never-raises property also holds, which matters since _fail_inflight_turn calls this bare inside error handling. Whole body wrapped with a double fallback that survives even a throwing str. Good. One small naming ask: _classify_turn_error_message doesn't classify, and that's its best property. A name like _summarize_turn_error_message keeps the seam legible to the next reader, so nobody later "fixes" it by making it classify. One forward-looking note, not a blocker: content-wise this is a privacy improvement over bare str(exc), which dumped the whole raw error. But once this payload gets persisted or carried into a turn_failed hook (#56720), the Privacy: docstring convention from the taxonomy draft should travel with it, since error text can still carry a provider dump. Ran tests/tui_gateway/test_classified_turn_error.py on this head locally: 3 passed. |
|
This was generated by AI during triage. Summary: Problems:
Solution: Checked against |
…t failed TUI/desktop error frames often showed a generic "request failed" while the classified detail (provider, model, base_url, HTTP status, failure_reason, fallback) only reached agent.log. Add _classify_turn_error_message and use it in _fail_inflight_turn, message.complete error payloads, and compute_host turn.error frames. Composes with NousResearch#56720 turn_failed and NousResearch#58524 classify_api_error (NousResearch#64182 item 3). Observer-side framing only — no delivery-path mutation.
Rename _classify_turn_error_message → _summarize_turn_error_message so the helper is not later "fixed" into a classifier (webdevtodayjason). Render fallback chains as `model (provider) → …` instead of a Python list-of-dicts repr, matching agent/agent_init.py.
6da9532 to
14043de
Compare
|
Addressed both review notes on this head (
|
Summary
When a turn fails, TUI/desktop frames often showed a bare
request failedwhile the classified detail (provider, model, base_url, HTTP status,failure_reason, fallback chain) only reachedlogs/agent.log.Changes
_classify_turn_error_message(error, agent)— prefersagent._summarize_api_error, keepsfailure_reason, decorates with live route facts_fail_inflight_turnuses the classifier (so resume snapshots carry the same detail)_run_prompt_submitpasses the full result dict and aligns visibleError: …text with the classified messagecompute_hostturn.errorframes use the same classifierObserver-side framing only — no delivery-path mutation. Composes with:
turn_failed(carry classified payload out)classify_api_error(plugin owns enrichment)Test plan
tests/tui_gateway/test_classified_turn_error.py(3)tests/tui_gateway/test_failed_turn_retention.pystill green (8)Related