fix(workflow-executor): say why an automated inbox read or route failed - #1942
Merged
Scra3 merged 1 commit intoSep 30, 2026
Conversation
A 404 on an inbox route listed this cycle is logged at Warn with the operation and the server's reason. A refused segment read logs its HTTP status, the agent's error message (cut at 500 chars, never the raw body) and the parameters of the read. An unreadable inbox listing fails the cycle instead of reading as an environment with no inbox. fixes PRD-1300 fixes PRD-1301 fixes PRD-1302 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
7 new issues
|
|
Coverage Impact This PR will not change total coverage. Modified Files with Diff Coverage (3)
🛟 Help
|
matthv
approved these changes
Sep 30, 2026
matthv
left a comment
Member
There was a problem hiding this comment.
LGTM. One gap: no test pins pageNumber / notIn when a later padded page fails (e.g. not_in refused, page 1 ok, page 2 fails), so a stale pageNumber: 1 would pass.
Scra3
merged commit Sep 30, 2026
7e9a283
into
feature/prd-1183-runtime-automation-poller
37 checks passed
Scra3
added a commit
that referenced
this pull request
Oct 2, 2026
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.

fixes PRD-1300
fixes PRD-1301
fixes PRD-1302
Why
Three failures of the automation poller left nothing to act on in the customer's runtime logs:
GET /automated-inboxes, then answering 404 on its ownassignmentsorsyncroute, was logged at Info with no reason. A route missing behind a proxy, a path prefix or a version skew looks exactly like that, and the inbox is then never swept again.Agent responded with HTTP 400. A renamed segment, a lost permission and an unsupported operator all read the same.[], so a server-side reshape read as an environment with no automated inbox at all.What
404 on an inbox route:
AutomatedInboxGoneErrornow carries theoperationthat answered 404 (listAutomatedInboxAssignmentsorsyncAutomatedInbox) and the server'sdetail(errors[0].detail). The poller logs it at Warn:Automated inbox listed this cycle but its route answered 404, dropping it for this cycle. The inbox is still dropped for this cycle only.Refused segment read: the
Could not read … of an automated inboxlog now carries:httpStatus, from the classification fix(workflow-executor): tell the orchestrator why an automated inbox could not read its segment #1938 already sends to the orchestrator;agentError, the agent's error message;requestedPageSize,pageNumber,paddedPageReason,notIn, ormembershipChunk/membershipChunksfor the reconciliation.The three fallback Warns (
not_inrefused, later padded page failed, capabilities unreadable) carry the same fields.Unreadable listing:
listAutomatedInboxesthrowsUnreadable automated inbox listing from <forestServerUrl>: <zod issues>, so the cycle fails asAutomation poll cycle failed, likelistAssignmentsdoes. One unreadable config inside a readable envelope is still skipped on its own. A 404 on the listing route still returns[](an orchestrator older than automated inboxes).The lease heartbeat is independent of the sweep, so a failed cycle keeps the lease, and the next sweep runs one interval later. The existing test
should keep polling after a cycle that threwcovers this.No server ↔ runtime contract change.
Security
agentErrorcomes from agent-client'sextractErrorDetail. It holds only the recognised error fields (errors[0].detail/message/title,error,message), flattened to one line and cut at 500 characters. It never holds the rawresponseText(tested with an HTML body) or any header or token.Unlike #1926, this detail is now logged on a 4xx too, because a 4xx is exactly the case this fixes. It is logged only by the poller, in the customer's own runtime logs.
AgentPortError.messagestill carries the agent detail on 5xx only (a test guards this), and the user message is unchanged. At worst, a 4xx detail echoes a filter value or a record id, which the poller already logs elsewhere.How it was checked
return [], a 5xx gate on the detail, 0-based chunk index…), and every one fails at least one test.workflow-executorsuite green (2021 tests), lint and typecheck clean.Definition of Done
General
Security
🤖 Generated with Claude Code
Note
Add operation and agent-detail context to automated inbox read/route failures
describeAgentFailurehelper in automation-poller.tsagentErrorDetailin errors.ts is now public and extracts sanitized structured detail fromAgentPortErrorcauses or 4xx responses without falling back to raw response textAutomatedInboxGoneErrornow carries the failed operation name and extracted detail; the poller logs it at Warn before dropping the inbox for the cyclelistAutomatedInboxesreject with the Forest server URL and schema message instead of resolving to an empty inbox list — seeparseConfigsin forest-server-automation-port.tsMacroscope summarized c580544.