Repository navigation
fix(agent-task): always report why the agent runtime failed and keep its transcript - #2590
Merged
Merged
Conversation
…its transcript
A runtime that exited non-zero or returned an unreadable native result produced
success:false with no failure object, no transcript and no tool observability.
- project every agent-runtime failure into failure{stage:agent,code,message}
with diagnostics, exit code and stream tails; skip verification after it
- raise the native result bound from 1 MiB to 32 MiB (long runs embed the full
agent loop output and were silently discarded) and report the actual size
- discover the runtime transcript when the native result carries no ref
- raise the tool-observability bound from 64 to 512 calls so long runs keep
write evidence; let the transcript source exceed the 4 MiB upload bound
chubes4
added a commit
to Automattic/docs-agent
that referenced
this pull request
Nov 15, 2026
…e user packages (#189) - WP Codebox v0.33.6 (4875fb1) reports failure{stage:agent,code,message} for every failed agent runtime and uploads the transcript and tool observability on failure (Automattic/wp-codebox#2590) - advance DOCS_AGENT_PACKAGE_REVISION to 667a3d7 (#188) with the new user bootstrap and maintenance package digests
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.
Problem
Docs Agent runs 43729752419 (community bootstrap) and 43729756527 (shop maintenance) on v0.33.5 failed after ~3 minutes of agent execution with
workspace_apply.status: skipped,write_tool_calls.source: none, no transcript, and on the shop run nofailureobject at all.Root cause
readNativeResultrejects native results over 1 MiB (result-too-large) and replaces the whole result with a bare{success:false, diagnostics}. The nativeagent-task-run/v1result embeds the full recipe run, including the agent loop output and itsmessages(everyworkspace_readpayload). At 12 turns that fit; with fix(agent-task): honor caller max_turns over package defaults and report turn-cap stops #2589 honoringmax_turns: 40the result outgrew 1 MiB. The metadata, sandbox write ledger, tool observability and transcript refs were all thrown away with it.execution.code === 0butruntimeResult.success !== true, the executor built nofailureat all, and the uploaded reviewer projection dropsruntime_resultand the execution tails. So the reason never reached the uploaded result. (The community run only showed a downstream verification failure, because verification still ran after the failed runtime.)Fix
agent-runtime-failure.mjs: every non-zero exit or non-successful runtime yieldsfailure{stage:"agent", code, classification, message}, plus diagnostics, exit code, runtime/terminal status, provider error and stream tails on non-zero exits. Verification is skipped after a failed runtime so it can't mask the cause.MAX_NATIVE_RESULT_BYTESgoes from 1 MiB to 32 MiB, and the error now reports the actual size.runtime-*/files/transcript.json(best effort; it never masks the failure). The uploader accepts transcript sources above the 4 MiB per-file bound, because it only stages a bounded projection.Tests
tests/agent-runtime-failure.test.ts(new unit test)tests/execute-native-agent-task-lifecycle.test.mjsgains two new modes:runtime-failed: a schema-valid failed result with a provider diagnostic.result-missing: the CLI exits 1 without writing a result.Both assert the agent-stage failure in the executor result and in the uploaded result, the discovered transcript, and more than 64 tool calls surviving in the uploaded transcript.
Existing agent-task, reusable-workflow, max-turns, interruption and apply-outcome tests pass locally.
AI assistance: Extra Chill Bot (Claude), via a Roadie subagent.