--agent is only consulted inside the --materialize-only branch, but clap also accepts it with --once. The one-shot path then calls the unselected whole-catalog reconciler and can launch every missing sibling while appearing targeted.
This was observed on st2 0.1.0+33d159b and remains accepted on current main 58c4851 after #50. #50 provides the correct exact task selector (--task); this issue is about making the older materialization-only selector fail closed outside its valid mode.
Minimal deterministic reproduction
A two-agent catalog uses harmless exec tasks (true) plus a recording pty shim that returns an empty list. Run:
st2 up --catalog "$catalog" --host repro --once --agent one
Both repro.one.work and repro.two.work appear under launched, and both workspaces are materialized. The shim records one pty list --json; no real PTY registry is involved.
The source-level reproducer passes at 33d159b:
running 1 test
test agent_selector_does_not_scope_once_reconciliation ... ok
test result: ok. 1 passed; 0 failed
Expected
--agent is a materialization-only selector. Using it without --materialize-only must refuse before workspace writes or runner inspection, and the diagnostic should point operators to --task for targeted one-shot reconciliation.
Actual
--agent is silently ignored by --once, which performs whole-catalog discovery, materialization, runner listing, planning, and execution.
RCA
src/main.rs::up filters found.specs by agent only inside if materialize_only { ... return Ok(()) }. The later if once branch calls unfiltered up_once(root, ...). Clap declares neither requires = "materialize_only" nor an equivalent runtime refusal.
Principled fix
Make --agent require --materialize-only, keep --task as the sole selected reconcile API, and add CLI proofs that the invalid combination refuses before workspace mutation and pty list.
Posted on behalf of @schickling
| field |
value |
agent_name |
co2-bear |
agent_session_id |
a078daee-6f98-4916-91a8-d21291407789 |
agent_tool |
Codex CLI |
agent_tool_version |
0.145.0 |
agent_runtime |
Codex CLI 0.145.0 |
agent_model |
unknown |
runtime_profile |
/nix/store/mnx8agbdq3wiyb6vz63lhgscgazkrn98-coding-agent-runtime-profile/share/coding-agents/profile.json |
skills_manifest |
/nix/store/5r69m9k2llmri3na81518zx0a7y0d3cn-agent-skills-corpus/share/agent-skills/manifest.json |
worktree |
dotfiles/schickling/2026-07-20-cos-misc |
machine |
dev3 |
tooling_profile |
dotfiles@0fb7e03 |
--agentis only consulted inside the--materialize-onlybranch, but clap also accepts it with--once. The one-shot path then calls the unselected whole-catalog reconciler and can launch every missing sibling while appearing targeted.This was observed on
st2 0.1.0+33d159band remains accepted on current main58c4851after #50. #50 provides the correct exact task selector (--task); this issue is about making the older materialization-only selector fail closed outside its valid mode.Minimal deterministic reproduction
A two-agent catalog uses harmless
exectasks (true) plus a recordingptyshim that returns an empty list. Run:st2 up --catalog "$catalog" --host repro --once --agent oneBoth
repro.one.workandrepro.two.workappear underlaunched, and both workspaces are materialized. The shim records onepty list --json; no real PTY registry is involved.The source-level reproducer passes at
33d159b:Expected
--agentis a materialization-only selector. Using it without--materialize-onlymust refuse before workspace writes or runner inspection, and the diagnostic should point operators to--taskfor targeted one-shot reconciliation.Actual
--agentis silently ignored by--once, which performs whole-catalog discovery, materialization, runner listing, planning, and execution.RCA
src/main.rs::upfiltersfound.specsbyagentonly insideif materialize_only { ... return Ok(()) }. The laterif oncebranch calls unfilteredup_once(root, ...). Clap declares neitherrequires = "materialize_only"nor an equivalent runtime refusal.Principled fix
Make
--agentrequire--materialize-only, keep--taskas the sole selected reconcile API, and add CLI proofs that the invalid combination refuses before workspace mutation andpty list.Posted on behalf of @schickling
agent_nameagent_session_idagent_toolagent_tool_versionagent_runtimeagent_modelruntime_profileskills_manifestworktreemachinetooling_profile