Repository navigation
Conversation
…'s faults A trigger can now call a backing server's advertised config extension (for example set-errors/v1 or set-latency/v1) with args, so a call to one tool, a point in virtual time or a state change can take another server down and a later trigger can bring it back by sending clearing args. - server_config action: service (a server's name, or * for every server), uri, args (templated like a tool action's), tolerate_unadvertised. Each server's outcome (applied, skipped or failed) follows apply_server_config; a name the gateway has no server for fails even when tolerated. - The gateway calls each server at its own address, read from its card, so the action still works once a bundle's lock has closed every route but /mcp. A broadcast tries every server before the action fails. - Each fire writes a server_config event to the env trajectory with each server's outcome. - Cards advertise the server_config trigger feature, and register_env_triggers refuses an older gateway that lacks it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…plied Greptile round 1 on #1009: - The client does not follow redirects, so a 3xx reply means the config handler never ran: any reply but 2xx now fails that server. - The reply excerpt and detail lengths are named class constants. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…E3CRQ1961WP0MKN/fault-row-15-gateway-server-conf
…tatus alone, as now stated and tested Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cikowski
marked this pull request as draft
December 6, 2026 14:22
This branch has not been deployed
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.
What and why
Faults (forced errors, latency) were set once, before the agent starts, so a task could not say "after the first send, mail is down for two hours". A trigger can now call a backing server's advertised config extension (such as
urn:agentenv:set-errors/v1) with aserver_configaction, and a later one clears it with clearing args (error_rate: 0.0).service(a name, or*for all),uri, templatedargs,tolerate_unadvertised. Action, state and time triggers, withdelay,barrierandunless.servicenames (an MCP server before a website of that name), or every backing server for*; no target fails the action. Each target's card is read live when the action fires. A 404, or a card that does not advertise theuri, is skipped whentolerate_unadvertisedis set or the target is a website that*reaches, and fails otherwise. Any other card failure (an error status, a timeout, a malformed card) or no endpoint for theurifails. Otherwiseargsgo to the advertised endpoint: a 2xx reply applies, whatever its body; any other reply fails. Every target is tried; the action fails if any target failed. This is the trigger's own rule;apply_server_config's differs in places./svcroutes, which a bundle's lock closes.server_configevent to the env trajectory.fetch_child_cardalso leaves out a card that is not a JSON object.Rollout
The gateway advertises a
server_configtrigger feature; the client'sregister_env_triggersrefuses such a trigger on a gateway without it. Existing triggers are unchanged. Rollback: revert; a task using the action is then refused at registration.Validation
Head
3daf9c3a0f643a0122b53c469cba59cfe663860e. 48 new tests:tst/unit/env/gateway/triggers_server_config_socket_test.py: real loopback servers; anotes_savecall takes mail down and a time trigger 2h later restores it (sends[ok, fail, fail, ok]), also behind a stand-in guard that 404s every route but/mcp.tst/unit/env/gateway/triggers_server_config_test.py: outcome rules (a 2xx applies whatever its body:[no-content]and[plain-text]fail if the reply is parsed as JSON), failures and their events (a redirected reply fails:[redirected]fails on the old>= 400check), templating, state, unless, refused shapes.tst/unit/task_step/test_register_env_triggers.py: an older gateway is refused.With
src/reverted to main367eeea, 43 of the 48 fail (the other 5 are existing card-omission cases).Quality bar
Head
3daf9c3a0f643a0122b53c469cba59cfe663860e. Quality profile: rigorous (eng-standards Q1-Q13).ruff check, unit tierpytest tst/unit packages/agentenv-protocol/tests)3daf9c3origin/main367eeeadc74fd7;3daf9c3changes only a docstring3daf9c33daf9c33daf9c33daf9c3pr_gate.py check3daf9c3Relaxations: none.
For the docs
The trigger page should cover the
server_configaction: its fields (serviceor*,uri, templatedargs,tolerate_unadvertised;serviceanduriare literal;verify,asandtoare refused), the rule above (the trigger's own, notapply_server_config's), clearing by args, theserver_configtrajectory event, and theserver_configtrigger featureregister_env_triggerschecks.Not in this PR
reveal_toolsin an extension's reply; control tokens for computer children.invoke_extension(the setup step's path) still treats a 3xx reply as applied; a separate change.Known limitations (each has a follow-up):
atmarks can apply out of order; anchor a clear on its arm withafter:.after:clear and fires again on the next provoking call, because dependents resolve only on success, as on main.extensionsis an object or a string reads as not advertising theuri(skipped when lenient), not as malformed._configure_server's control flow and its place inGateway, the args check shared with the tool action, andfetch_child_cardlogging a non-object card as malformed JSON.🤖 Generated with Claude Code
Confidence Score: 5/5

The PR appears safe to merge, with no new actionable issues in the latest change.Summary
Adds the
server_configtrigger action to arm or clear faults on backing servers. The latest change only corrects_configure_server’s docstring; no new actionable issues were found.Diagram
sequenceDiagram participant T as Trigger engine participant G as Gateway participant S as Backing server T->>G: Run server_config G->>S: Read live card G->>S: Call advertised extension directly S-->>G: HTTP status G-->>T: Per-server outcomes T->>G: Record server_config eventReviews (12) · Last reviewed commit: "docs(gateway): _configure_server states ..." · Reviewed by Greptile