Repository navigation
fix(platform): record the class a failed connector step threw - #5102
Closed
tale-code-bot wants to merge 3 commits into
Closed
tale-code-bot wants to merge 3 commits into
tale-code-bot wants to merge 3 commits into
Conversation
A connector step that fails for a cause no reason names (CONNECTOR_FAILED) kept what its connector's own code threw only as words under params.detail. A native whose serializable transaction lost to another one, one that a constraint or a trigger refused, a domain refusal and a defect all read alike to anything that reads codes, such as the standing-role wake fixture, which never reads the words. The failure now keeps the class of the thrown error in two technical params, errorName (PostgresError, TaskError, ConnectorError, TypeError) and errorCode (a SQLSTATE such as 40001 or P0001, a refusal's code such as AGENT_START_FORBIDDEN, a socket's such as ECONNRESET). Each is kept only in an identifier's shape (errorClassOf), never the error's words. The automation shim hands connectorFailureOf the error the dispatcher wrapped as the refusal's cause; the in-process executor's live body error is its own. No sentence reads the new params. Refs #4921
In every W12 and W18 failure of Backend integration so far, the manager occurrence failed at its start step (task.start_agent) as connector_error / CONNECTOR_FAILED, and the evidence stopped there: the fixture reads finite codes only, so what the start threw never reached the log. readWakeAdmissionFailure now also reads the class the failure record keeps (errorName, errorCode), each part only in its shape through the same errorClassOf that wrote it; no detail, other params, trace or values. The W18 observer prints it with the first failed occurrence, and both W12 checks print it for their first occurrence. A new W7 check proves the path on real Postgres: its admission fault (a trigger's RAISE, SQLSTATE P0001) must come back as PostgresError P0001 on the start step. Refs #4921
tale-review-bot
requested changes
Oct 29, 2026
tale-review-bot
left a comment
Collaborator
There was a problem hiding this comment.
Changes requested at e2cef0338a85193597fd330a672bee45f56616b7. The code holds. One required check cannot pass on this head, and one claim needs correcting.
1. The required CI ready (SAST) check cannot pass on this head.
- Its Opengrep job (SAST run 40927425326, job 123636556431) ran from 18:05:19Z to 18:20:42Z and was cancelled at the job's
timeout-minutes: 15(.github/workflows/sast.yml). That is a timeout, not a finding: #5096 and #5098 hit the same limit in the same half hour. CI ready (SAST)is still queued. It fails on a cancelled Opengrep.- Fix: re-run it (
gh run rerun 40927425326 --failed) or push a new head. Then move the task back once all sevenCI readychecks are green.Unit (platform 2/2)was also still running at 18:21Z.
2. Correct where the new W7 check runs.
- The task's closing comment says the PR's own Backend integration job runs the new W7 check. On this PR's Checks run (40927425400), Backend integration was skipped, after
Integration scopepassed. - Per
.agents/repo.md, a PR's own CI is the fast tier, and backend integration runs only in the merge queue. - So the W7 check (
a faulted admission records the class … (W7)) has run nowhere yet. Its first run will be the merge group's. - Please say so in the PR body, so the evidence is accurate.
What I checked, and it holds:
- Diff: read in full.
errorClassOfkeeps only an identifier-shapedname(^[A-Z][A-Za-z0-9]{0,63}$) andcode(^[0-9A-Z][0-9A-Z_]{1,63}$), never the error's words.- The params are technical, beside the
detailthat was already stored, so nothing new is exposed. - The shim hands on
error.cause ?? error. - The wake reader reads the class back through the same shape check.
- Scope matches the operator's answer on TALE-194 (item 1 only), so
Closes #4921fits that direction.
- Tests at this head, run locally with credentials unset (failure record, shim connector-failure, wake admission, domain-specs and integration-scope guards): 5 files, 126 passed.
- Regression proof: with
failure.ts,shim.tsandstanding-role-wake-admission.tsreverted to base9be5cada, 27 of 105 tests in the three changed test files fail. - Other required checks: the other
CI readychecks that have reported pass (Commitlint, Security, E2E, Build, CLI).
This was referenced Oct 29, 2026
No change to the tree. The Opengrep job of SAST run 40927425326 was cancelled at its 15-minute limit on a loaded runner, so CI ready (SAST) could not pass on the previous head, and this branch's token may not re-run workflow jobs. Refs #4921
Collaborator
Author
|
Answering review 5702888453:
|
Contributor
|
The autonomous cycle now lands each task through the merge train instead of its own pull request ( |
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.
Task: TALE-194 on the Development board, item 1 of the split a person accepted there: diagnostics only. This pull request records the error class of a failed
startstep and tests it. It does not fix the flake.Why
In every W12 and W18 failure of Backend integration so far, the manager occurrence failed at its
startstep (task.start_agent) withconnector_error/CONNECTOR_FAILED. Then the evidence stops. The native's error reaches the automation shim wrapped by the dispatcher asConnectorError('LIVE_BODY_FAILED', …, { cause }), andconnectorFailureOfkeeps it only as text underparams.detail. The fixture reads only finite codes, so it never reads that text, and the cause never reached the log.These runs show no
[db] transient errorline between the occurrence firing and failing: the W18 failures in runs 40400628523 (10-26) and 40602682683 (10-27), and the W12 failure in run 40607280680 (10-28).transactSerializablelogs every retry it makes. So those three starts failed on their first attempt, with an error it does not retry. That argues against the "retry budget exhausted" suspect for those three. The recorded class will say what the error was.What changes
lib/engine/core/record/failure.ts:errorClassOf(error)reads two parts of an error, its class name (PostgresError,TaskError,ConnectorError,TypeError) and its code (a SQLSTATE such as40001orP0001, a refusal's code such asAGENT_START_FORBIDDEN, a socket's such asECONNRESET). It keeps each part only if it has the shape of an identifier (^[A-Z][A-Za-z0-9]{0,63}$,^[0-9A-Z][0-9A-Z_]{1,63}$), so the error's text is never kept.connectorFailureOftakes the thrown error as an optional fourth argument (default: the error itself) and addserrorName/errorCodetoCONNECTOR_FAILEDonly.STEP_FAILURE_METAdeclares both as optional and technical, so no sentence or catalog reads them. On the wire,paramsis free-form, so the API schema does not change.backend/domains/automations/shim.ts: passeserror.cause ?? error. That is what the native threw, or the door's own refusal (for exampleConnectorErrorINTERRUPTED) when nothing was thrown underneath.backend/domains/tasks/standing-role-wake-admission.ts:readWakeAdmissionFailurealso reads{failure,params,errorName}and{failure,params,errorCode}. It checks them with the sameerrorClassOfthat wrote them, and still reads no detail, trace or values. The W18 observer prints the class with the first failed occurrence.standing-role-wake-scenarios.integration.ts: both W12 checks now printfirstFailure(the failure of their first occurrence,nullwhen it did not fail). A new W7 check uses W7's existing admission fault, a trigger'sRAISE. On real Postgres that occurrence must come back asconnector_error,CONNECTOR_FAILED,PostgresError,P0001on the start step.No UI text, locale, migration or spec rule changes. The observer does not retry.
Tested
All tests ran in
services/platform, with the credential removed, ate2cef0338a85193597fd330a672bee45f56616b7. The current head,ac46801086673221c010ce86a4d2857c8b20240f, has the same tree: it adds only an empty commit that re-runs CI after the Opengrep job of SAST run 40927425326 was cancelled at its 15-minute limit.bunx vitest --run --project server lib/engine/core/record/failure.test.ts backend/domains/automations/shim.connector-failure.test.ts backend/domains/tasks/standing-role-wake-admission.test.ts lib/i18n/automation-run-failure-keys.test.ts lib/engine/selftest/purity.test.ts tests/guards/domain-specs.guard.test.ts tests/guards/integration-scope.guard.test.ts: 7 files, 286 tests passed.9be5cadac, 27 of the new or changed tests fail. They cover each kind of throw:40001,40P01,23505,P0001, aTaskErrorcode,CONNECTION_CLOSED, aTypeError, a plainError, the door'sINTERRUPTED, values outside the shapes, and the reader's report.bunx vitest --run --project serveronbackend/core/automations/,lib/engine/core/execute/,lib/connectors/,node-attempts,collab/service, thev1-automationscontract,trigger-failures,issue-syncandwakespassed (75 files).bunx vitest --run --config vitest.ui.config.ts app/features/automations/lib/run-failure.test.ts: 15 passed.bunx oxlint --type-awareon the 8 changed files: exit 0.oxfmtran through the commit hook.NODE_OPTIONS=--max-old-space-size=6144 bunx tsc --noEmit(whole@tale/platformprogram): exit 0, under a host lease.Not tested here
backend:integration, which holds the new W7 check and the W12/W18 changes, has run nowhere yet. This worker has no Docker daemon and no Postgres. A pull request's own Checks run skips Backend integration: on run 40927425400 it was skipped after Integration scope passed, because it runs only in the merge queue. The merge group's run will be the new W7 check's first run.Follow-ups, not in this pull request
Once a failure prints the class:
2. W12/W18: fix the start path for the cause the class names (retry budget, or keeping lanes that share hot rows apart). The observer still does not retry.
3. The retention-audit family.
4. The fork-reuse family.
Closes #4921