Repository navigation
[sentry:7848997515] The TUI's agent:<id> action refused an empty model list by throwing a plain Error('Load a text model in Models before opening an agent.') from src/tui/workspace/serve - #102
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The TUI's
agent:<id>action refused an empty model list by throwing a plainError('Load a text model in Models before opening an agent.')from src/tui/workspace/server/agent-actions.ts:26. That refusal is a user-facing precondition, but the action boundary in WorkspaceApp reports every escaped exception throughcaptureFailure(... { component: 'tui', operation: 'workspace.action' }), andexpectedFailurein src/telemetry/failures.ts is false for an untagged Error, so the deliberate refusal arrived in Sentry as an unexpected failure with noerror_code(matching the event'sfailure_reason: unknown,failure_category: unknown). Fix: the guard is kept, but the empty list now writes the existing message into workspace state and returns a handled action inside the same try/finally, sobusystill clears and the user still sees the text — the same shape as the two sibling preconditions above it and as ADR 2026-11-02-keep-managed-model-refusals-local prescribes. Lookup failures still propagate:listChatModelsthrows on non-ok responses, and the control test asserts that rejection is still reported. Only src/tui/workspace/server/agent-actions.ts changed; the probe src/tui/workspace/server/agent-actions.test.ts (already carried from diagnosis) passes after the patch — 2/2 tests in the isolated check.Evidence:
Event release atc@0.2.18#b869424b124d resolves to base sha b869424 with an empty release_diff, so the recorded frames are current-base lines.
Event frame src/tui/workspace/actions.ts:62:13 is the
if (await agentAction(id, ctx)) returncall insideactivate; frame src/tui/workspace/server/agent-actions.ts:26:37 was the single throw statement on that line.src/tui/workspace/server/agent-actions.ts:11-22 already handles the setup and daemon/API preconditions by
patch({ message })plusreturn true, so an exception for the empty model list was inconsistent with its own neighbours.src/telemetry/failures.ts
expectedFailurereturns false for a plain Error (no AtcError, no AtomicCoreError, no cancellation, no reported marker), so the refusal was reported as unexpected witherror_codederived from an absent code.src/terminal-service/client.ts
listChatModelsreturns[]only for a successful response with no model ids and throws on non-ok responses, so the empty-list branch cannot mask an HTTP or credential failure.docs/decisions/2026-11-02-keep-managed-model-refusals-local.md records the same class of defect and the same remedy for the managed-model refusal.
Isolated check after the patch: src/tui/workspace/server/agent-actions.test.ts, 2 passed / 0 failed — 'refuses to open an agent when no model is loaded without throwing' and 'keeps a failed model lookup reported instead of turning it into a refusal'. On the base the first failed with
promise rejected "Error: Load a text model in Models before…" instead of resolving, while the control test passed, isolating the refusal path.Regression tests: src/tui/workspace/server/agent-actions.test.ts
Full CI and human review are required.
Report: http://127.0.0.1:8080/tenants/707d0855-80ab-4e1f-a156-f1c4546cbf52/runs/a89dc7c0-479c-4a4c-8f5d-be26cc7f17f0
Sentry: https://atomic-chat.sentry.io/issues/7848997515/