Repository navigation
feat(task_step): a run keeps each server's fault log in its context (UGML-1130) - #990
Merged
cikowski merged 6 commits intoDec 3, 2026
Conversation
…UGML-1130) When the agent finishes (prompt_agent's conversation, always_on's finish), every env the run configured (server_config_changes or env_trigger_registrations) has each backing server that advertises urn:agentenv:get-fault-log/v1 read with its owner's control token. Per env, context.metadata["server_fault_logs"][env_id] keeps each server's entry count and dropped count (or its read error), the servers that keep no log, and the object URL of the full entries; load_server_fault_logs reads them back and marks a log that dropped entries incomplete. Reads take 15 s each and 60 s in all, and never fail the run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eys its file by a safe segment (UGML-1130) An env with two deployments in the run is recorded as an error naming their deploy steps, since no record says which one was configured, and neither is read. The stored file's key uses key_segment for the env id, so an id too long for a file name still stores. The error detail and id lengths are named constants. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hares a name (UGML-1130) Two backing servers of one name and kind (a multi env's gateway MCP server and an app its computer lists, or two such websites) both got the same key in services, so one log was dropped. The first keeps the key, as a named directive picks it; each later one is keyed <key>#2, #3. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…already has (UGML-1130) A server literally named like a generated key (mail#2) collided with the key given to a later server of the same name, so one log was overwritten. Every server's own key is now reserved first, and a later server takes the first free number. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ve configures (UGML-1130) The bare key of a name now goes to the server a named apply_server_config directive of that name targets (the name's first MCP server, else its first server). Every other server is keyed website:<name> or <name>, numbered from #2 until no server's name or earlier key has it, so keys cannot collide and a server literally named like a generated key keeps its own name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ookups (UGML-1130) A named apply_server_config directive on a plain env finds its server by name on the stored card (child_env_card), not in backing_servers, so a website the card lists is configured even when the definition also names a card-less MCP server of that name. The bare key went to that card-less server, filing the website's log under website:mail. The keys now call the step's own lookups instead of a copy of them: by name on the stored card for an env that runs no computers, else the broadcast's pick, now legacy_protocol.named_server, which _expand_directives calls too (no change to what it picks). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
agutmanstein-scale
approved these changes
Dec 3, 2026
agutmanstein-scale
left a comment
Collaborator
There was a problem hiding this comment.
Approving. Nothing existing breaks:
apply_server_config.legacy_protocol.named_serveris an exact extraction of the lookup the step already did (the MCP server of a name, else the first of it), so every directive configures the same server. The module is imported inside the function, as before.- Capture hooks.
prompt_agentandalways_ongain onecapture_server_fault_logscall after the trigger-state persist. It returns at once unless the run configured an env, gathers its reads withreturn_exceptions, and is capped atCAPTURE_BUDGET_SECONDS, so it never fails a run. - Run document.
server_fault_logsis a new env-keyed metadata key, and the entries go to the object store.
Deploy: a framework release, then the hosted worker's pin bump. Non-blocking: a configured run's prompt end can wait up to the 60 s budget when a server's fault-log endpoint is slow.
cikowski
deleted the
arete/tsk_01M8S4DBWXWJVAMXNMNTEZK04D/fault-row-16a-collect-each-serve
branch
December 3, 2026 01:52
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.
A verifier or rubric judge sees which faults a run armed (
server_config_changes) but not which fired. Servers that keep a fault log serve it aturn:agentenv:get-fault-log/v1(GET,{"entries", "dropped"}). This PR reads it into the run's context when the agent finishes (UGML-1130, Hub half).prompt_agent(after each conversation, a failed agent task included; a timeout or transport error raises before it) andalways_on(infinish) callcapture_server_fault_logsbeside the trigger state capture, for envs the run configured (server_config_changesorenv_trigger_registrations).metadata["server_fault_logs"][env_id]keeps each server'sentry_countanddropped(orerror),not_advertised, and theobject_urlof the full entries, which stay out of the run document. With no advertising server no file is written.apply_server_configdirective of that name configures, found with the step's own lookups: the stored card's child of that name on an env that runs no computers, elselegacy_protocol.named_server(its first MCP server, else its first server), which the step now calls too. Every other server iswebsite:<name>(a website) or<name>, numbered from#2until the key is unused, so no two servers share a key.load_server_fault_logsreturns the entries,complete: falsewhen any were dropped, and raisesLookupErrorwhen nothing was captured. An env deployed twice in one run is recorded as an error, since no record says which deployment was configured. The key is env-keyed for bundles.Rollout
Additive; unconfigured runs do no reads. Added time at prompt end: 2-3 ms in process against stubs, not measured on deployed servers. After merge: a framework release, then the hosted worker's framework pin bump. Revert: revert this PR.
Validation
Head
cee0e110. New:tst/unit/task_step/test_server_fault_logs.py(36 tests);tst/unit/bundle/resolve_test.pygains one fact.apply_server_configarms stub SDK servers behind the real gateway card, an SDK agent calls them, and the fired entry sits besideserver_config_changes. Removing either hook, the env filter, the budget guard, the key numbering or the control headers fails a test.apply_server_configstep on a website and its MCP twin (a named directive alone, with a broadcast, and on a computer, and a twin that serves no card) and on five more server lists; each name's bare key is the server its named directive configured. A check of 38,848 server lists (120,696 named directives, both lookup paths) found no mismatch and no shared key.27c255e3(3 failed, 22748 passed), plus a Playwright driver test that touches nothing here and passed 3 of 3 alone.ruff formatand mypy, which this repo's CI does not run.Quality bar
cee0e11027c255e3cee0e110cee0e110cee0e110d953565bit found one major, a website a named directive configures losing its key to an MCP twin with no card, fixed here by the shared lookups above, with a test)cee0e110cee0e110pr_gate.py checkcee0e110Every review major is fixed in this PR; none is deferred. Relaxations: none.
Not in this PR
fault_logrun context part (UGML-2133).server_config_changesdoes not name the server each change configured (item 18), so the keys repeat the step's lookup rather than read it from the record; the latest capture of an env wins even when it fails, and a failed object store write drops the counts (items 21-22); no key test case yet for a website named like another website's generated key.🤖 Generated with Claude Code
Confidence Score: 5/5

The PR appears safe to merge; no new actionable issue was found.Summary
The PR saves configured servers’ fault logs after agent work. Counts stay in the run context; full entries go into object storage.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR A[Agent finishes] --> B[Find configured environments] B --> C[Choose distinct server keys] C --> D[Read advertised fault logs] D --> E[Store full entries] E --> F[Keep counts and object URL in context]Reviews (9) · Last reviewed commit: "fix(task_step): fault log keys use apply..." · Reviewed by Greptile