Repository navigation
feat(task_step): target a deployment by env_step_id in the env setup steps - #797
Merged
Merged
Conversation
…steps sync_env_clock, modify_env_tool_access and register_env_triggers took the first deployment of their env_id, so a task that deploys one env several times armed the clock, tool access and triggers on the first one only. They now take an optional env_step_id and resolve through deploy_agent's bound_deployment(), which load_artifact now uses as well. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
AhmedArifK
approved these changes
Nov 19, 2026
…bound to sync_env_clock had every agent registered with its env_id follow the clock it armed, so arming one of two deployments of an env moved the other deployment's agents onto it. DeployedAgent now records the env_step_id deploy_agent bound it with; sync_env_clock, late follow and follower retirement match on it, and the clock and follower records keep the deploy step. The load_artifact binding tests now run execute. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
@greptileai review — please re-review the latest commit (96fcda8), which addresses the clock-follower and binding-test comments. |
An agent deployed without env_step_id recorded no binding, so it counted as bound to any deployment of its env, and arming the clock of a later deployment of that env moved it off the one its tools use. DeployedAgent now keeps env_bindings, the deploy step of the deployment deploy_agent resolved for each env, and the clock matches on it; an agent with no recorded binding, as one agent-env didn't deploy, still follows any. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
@greptileai review |
psinghal20
approved these changes
Nov 19, 2026
Resolve the agent_clock_test helper conflict by keeping both the env_bindings argument and main's control_token. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Why
When a task deploys one env several times,
sync_env_clock,modify_env_tool_accessandregister_env_triggerseach took the first deployment of theirenv_id. The clock, tool-access and trigger setup landed on that first deployment only.What changed
env_step_id, carried through__init__,to_dictandfrom_dict. It names thedeploy_envstep whose deployment a step acts on. The steps resolve it throughdeploy_agent'sbound_deployment(), asset_env_clock_ratealready does.env_step_idthat names no deployment of the env raises.env_step_id, a single deployment resolves as before.env_step_idraise, asdeploy_agentandload_artifactalready did.load_artifactdrops its own copy of that resolver and callsbound_deployment().DeployedAgentrecordsenv_bindings: for each env, the deploy step of the deploymentdeploy_agentresolved, with or withoutenv_step_id. An agent with no recorded binding, such as one agent-env didn't deploy, follows any deployment.sync_env_clock, late-deployed agents picking up the clock, and follower retirement all match on it, and the clock and follower records keep the deploy step. Before this, setting the clock on one deployment moved the other deployment's agents onto it.Behaviour change: a stored task that deploys one
env_idmore than once and runs one of these steps withoutenv_step_idnow fails instead of using the first deployment. Such a task already has to setenv_step_idondeploy_agent, which raises the same error.Tests
tst/unit/task_step/test_env_setup_steps_env_binding.py, run for each of the three steps:env_step_idenv_step_idand ambiguity without one, both raising before any requestenv_step_idround tripload_artifactbinding tests runexecutewith the artifact store and env loading mocked.agent_clock_test.pyadds tests with two deployments of one env and an agent bound to each. One test deploys an agent withoutenv_step_id, then adds a second deployment and arms its clock; the agent stays on the first.sync_env_clock,modify_env_tool_accessandregister_env_triggerstests.main, in files this PR does not touch: 2 intest_mcp_cli_builder.py(the generated CLI's interpreter has noclick) and 1 intest_disk_recipe.py.Rollout
The hub picks this up only after an agent-env release and an agentenvhub-sdk pin bump.
🤖 Generated with Claude Code


Confidence Score: 5/5
The PR appears safe to merge; no new blocking issues were found.Summary
Adds deployment-specific environment setup and keeps agents on the clock of their bound deployment.
No new actionable issues found.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR S[Setup step with env_step_id] --> R[bound_deployment] R --> D[Selected environment deployment] A[deploy_agent] --> R A --> B[Saved agent env_bindings] D --> C[Deployment clock] B --> F[Match agent to deployment] C --> F F --> G[Agent follows its bound clock]Reviews (9) · Last reviewed commit: "Merge origin/main into claude/env-step-i..." · Reviewed by Greptile