Repository navigation
[sentry:7852274027] ATOMIC-CHAT-SERVER-1X (atc@0.2.18 core 0.23.4; atc@0.2.21 core 0.24.8, whose dist 55067cf0 equals the base) reports component=chat, operation=chat.stream, source=event_li - #115
Open
Ooooze wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
ATOMIC-CHAT-SERVER-1X (atc@0.2.18 core 0.23.4; atc@0.2.21 core 0.24.8, whose dist 55067cf equals the base) reports component=chat, operation=chat.stream, source=event_listener with the generic boundary message and empty frames. ChatJobs.run (src/workspace-service/chat/chat-jobs.ts) is the only producer of that pair; its request runs under AbortSignal.any([job.controller.signal, AbortSignal.timeout(600000)]). When that ten-minute bound expires the controller is untouched, so the catch took the failed path: it called captureFailure and put the platform text 'The operation was aborted due to timeout' into view.error. The rejection is a DOMException, not an Error, so failureReport produced type Error with no frames, no error_code and no diagnostic tags, and the bounded observer (which also requires
error instanceof Error) matched nothing — exactly the reported shape. The identical 600-second bound on the same endpoint is already answered in src/workspace-service/snapshot/public-api.ts by converting AbortError/TimeoutError into an ATC_USAGE refusal, with a comment stating the boundary cannot classify a bare abort; connectors/connector-http.ts has the same notion in timedOut. Fix: a module-local deadlineExpired(error) walks the error and its causes for name AbortError/TimeoutError; in the catch, when the job controller is not aborted and that check passes, the job still ends failed but view.error becomes 'The answer did not finish within ten minutes. Check the loaded model and its engine log.' and captureFailure is skipped. Every other failure keeps the previous captureFailure/contextExceeded path, and a client cancel or the 60 s read lease still yields stopped with no report. Contract, dependencies and telemetry configuration are unchanged. Verification: the carried probe src/workspace-service/chat/chat-jobs-deadline.test.ts now passes all three of its cases — the deadline answers with the readable message and no capture; a deliberate stop stays stopped with no error and no capture; a TypeError wrapping an ECONNRESET cause is still reported once with diagnostic_cause_code ECONNRESET. The saved plan's files list did not include a docs/decisions ADR, so the ADR write was refused as out-of-plan; the rationale lives in the code comment and is still owed per AGENTS.md rule 12.Evidence:
Event facts for all three events: component=chat, operation=chat.stream, source=event_listener, exception type Error, value 'chat chat.stream: unknown', frames [], failure_category=unknown, and no error_code, diagnostic_code or diagnostic_cause_code.
src/workspace-service/chat/chat-jobs.ts is the only captureFailure caller with {component:'chat', operation:'chat.stream'}; the sibling calls in the same method use history.load/history.save.
release diff for atc@0.2.21 dist 55067cf is empty against base 55067cf, so those events come from the code read here; atc@0.2.18 has the same deadline and boundary.
src/workspace-service/snapshot/public-api.ts withinDeadline converts a bare AbortError/TimeoutError on the same /chat/completions call into an ATC_USAGE refusal for the same 600000 ms bound, the established pattern this fix follows.
src/workspace-service/connectors/connector-http.ts timedOut already walks name and cause for TimeoutError/AbortError, the same shape as the new deadlineExpired helper.
Probe after the fix: src/workspace-service/chat/chat-jobs-deadline.test.ts passes 3/3 — 'answers its own ten-minute deadline instead of reporting an unexpected failure' (state failed, error matches /did not finish within ten minutes/, capture not called), 'keeps a deliberate stop out of the reports and the error' (state stopped, error undefined, capture not called), 'still reports a genuine stream failure with its transport cause' (one capture, diagnostic_cause_code ECONNRESET).
Before the fix the same test's first case failed with capture receiving {error: Error('Unexpected failure in chat.stream'), tags: {component: chat, operation: chat.stream, error_code: undefined}} — the Sentry tag set and message.
Broader chat-service tests could not be run: the check tool accepts only the saved plan's test path. The three carried cases cover the changed branch and both control paths.
Regression tests: src/workspace-service/chat/chat-jobs-deadline.test.ts
Full CI and human review are required.
Report: http://127.0.0.1:8080/tenants/707d0855-80ab-4e1f-a156-f1c4546cbf52/runs/c47c9551-d1fc-4b0c-b137-8c922ca704ae
Sentry: https://atomic-chat.sentry.io/issues/7852274027/