Repository navigation
feat(task): a run's gateway and service-db env overrides travel with it to any runner - #255
Merged
Merged
Conversation
earakely-scale
approved these changes
Oct 19, 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.
First step towards
task runandeval runalways going through the configured[runner](discussed on #236).--gateway-env-idand--service-db-env-idsetget_config().default_gateway_env_id/default_service_db_env_idin the CLI's own process. A run that executes anywhere else, such as a Temporal or LittleHorse worker or any non-local runner, never sees them.They now travel like the other per-run overrides:
context.metadata["user_overrides"]asgateway_env_idandservice_db_env_id.Task.runscopes them to the run with aContextVar(run_env_ids), the same wayrun_scopescopes store routing.gateway_env_id(config)/service_db_env_id(config), which returns the run's override, else the configured default. That is four places in the gateway deploy and the local state store, plus the multi-env snapshot restore.Concurrent runs in one worker each see their own ids, and nothing changes outside a run.
agent-env env deployand the infra-env bootstrap still read the config, because they work outside a run.Test: two concurrent runs with different overrides each see their own ids, and the defaults are back after them.


Confidence Score: 5/5
The PR appears safe to merge; no blocking issue remains.Summary
Per-run gateway and service database choices now travel in task metadata instead of changing shared configuration.
The previous and current commits have different merge bases with the target commit, so this review used the full PR diff. No new actionable issues were found. Tests were inspected, not executed.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart LR A[CLI flags] --> B[Task context metadata] B --> C[Task.run] C --> D[run_env_ids scope] D --> E[Gateway deployment] D --> F[Local database setup] D --> G[Snapshot restore] C --> H[Restore outer choices]Reviews (3) · Last reviewed commit: "Merge branch 'main' into AlexS/per-run-i..." · Reviewed by Greptile