Repository navigation
Description
Approving a run returns failure after recording the decision when its resume enqueue fails
Confirmed at 480ee6a3e6d33c3414a2c0f8a52fded1ddc4ca2d. Suggested severity: P2.
A valid consequential approval has taken effect despite a failed response. A reviewer can act on the mistaken belief that approval was refused. The polling backstop can recover execution, so this is not a claim that the run is permanently stuck.
Reproduce:
- Create a live connector-operation approval through the real approval gate, with its run waiting.
- Make the continuation enqueue reject after the decision transaction commits, using a controlled local pg-boss send failure.
- POST executing to the approval decision route, read back the approval, retry the decision, then evaluate the same operation through the gate.
Expected: The result must distinguish a committed approval from a refused decision. A resume-notification failure must not make an already recorded approval look as though it was not accepted; retry should provide an accurate outcome.
Actual: The route returns HTTP500 after the approval, audit and hint have committed. Readback is executing. Retrying returns409 ALREADY_RESOLVED and does not enqueue the continuation. The next gate poll still returns allow, so the approved operation can proceed after the user was told the request failed.
Controls: Normal approve and reject return200 and record exactly one continuation for the intended run. Duplicate decisions return409 without a second job. Concurrent approve/reject yields one200 and one409, one audit and one job. Actual cancelRun withdraws the approval and a late decision cannot schedule work.
Source:
- services/platform/backend/domains/approvals/service.ts:134-252
- services/platform/backend/domains/approvals/routes.ts:56-86
- services/platform/backend/domains/automations/store.ts:2510-2525
Observed: decision HTTP500; persisted status executing; retry HTTP409 ALREADY_RESOLVED; zero recorded resume jobs; later gate result allow for that same approval. The normal approve/reject controls each record one job with the exact organization/run identity.
Frozen proof: /Users/yannick/.codex/notes/tale-1000-additional/approvals-wave01/frozen/batch-01/approval-api.ts, approval-api-results.json and approval-api.log; SHA-256 hashes in sha256.json. Nine grouped native probes passed. Retained isolated database: tale_approvals_w01_20260928_mul2shar.
python3 /Users/yannick/.codex/notes/tale-1000-additional/approvals-wave01/run-approval-api.pyThe launcher allocates a new retained fixture database and config directory on each replay, using the existing private QA connection environment. It does not reset prior data.
Limits: Real Hono approval routes, role/membership checks, real approval gate, SQL transactions, audit/outbox, cancelRun and enqueue transaction façade. Synthetic auth session; pg-boss send replaced with inert fixture-table recorder via real transaction adapter. No worker, connector, sandbox or provider execution. Gate allow means admission only, not a performed write. Fresh retained fixture DB and config directory. The injected failure is the final pg-boss send seam, not a real scheduler outage. Actual worker/connector execution is deliberately absent; a later gate allow proves admission only.
Deduplication: No same committed-decision/failed-enqueue response root found. #2009/#2056 concern expected validation/permission refusals thrown as opaque errors in retired Convex handlers; this fixture commits a valid decision, then reports500 and later admits the operation. Parent owns final acceptance/live dedup. Cached1028 all-state issue bodies, baseline102 and the current additional ledger were inspected; parent owns final review/publication.
Independent review
Read actual transaction and post-commit poke implementation; independently replayed all nine native groups using a separate retained database/output directory. The failed response, committed executing status, retry409, and later gate admission are observed. Polling recovery is explicitly retained; no permanently stuck run or actual connector write is claimed.
The affected source files are unchanged between the tested revision and current main d351611bd as checked before publication. Checked all-state issue bodies and the separate baseline of 102 reports; this entry is additional to that baseline.
Activity