Skip to content

Fix #88: wire issue-source resolution into the .agent start-parallel-agents mirror - #92

Closed
laird wants to merge 1 commit into
merge/issue-71-masterfrom
feature/issue-88
Closed

Fix #88: wire issue-source resolution into the .agent start-parallel-agents mirror#92
laird wants to merge 1 commit into
merge/issue-71-masterfrom
feature/issue-88

Conversation

@laird

@laird laird commented Jul 29, 2026

Copy link
Copy Markdown
Owner

Closes #88

Stacked on #87. .agent/scripts/issue-source-lib.sh does not exist on master — it arrives via #87 — so this branch is cut from merge/issue-71-master and based on it. Merge #87 first; this PR's diff then shows only the new work.

Root cause

#87 mirrored issue-source-lib.sh into .agent/scripts/, but its only consumer on that side still never called it. .agent/scripts/start-parallel-agents.sh had zero references to the library: no --issue-source / --issue-dir flags, no resolve_effective_issue_source, no issue_env_exports.

Consequences, stated precisely (this is not an unconditional break like #71):

  • Capability gap. Antigravity had no way to pin a backend for a swarm run.
  • Correctness risk, confined to file-backend runs with an explicit directory. Workers still source issue-config.sh, which resolves .autocoder.json per worktree — so the common case lands on the right backend by accident of shared config, not by propagation. But --issue-dir names a directory that exists nowhere in config, so the dispatcher's choice never reached the workers. .agent/workflows/fix.md branches on $ISSUE_SOURCE (lines 412, 454), so the value does matter to worker behaviour.

Changes

.agent/scripts/start-parallel-agents.sh

  • source issue-source-lib.sh
  • parse --issue-source / --issue-dir; document both in the header comment and in --help
  • call resolve_effective_issue_source once in the dispatcher, after CURRENT_BRANCH
  • add send_issue_env_tmux / send_issue_env_cmux, invoked at all five launch sites (3 tmux, 2 cmux)

send_issue_env_cmux is defined inside the cmux branch because it depends on cmux_send_cmd, which is itself local to that branch — the mirror does not use mux-send-lib.sh's send_cmux_command here.

Both helpers are invoked outside the existing if [ "$AGENT" = "claude" ] guard that wraps the ANTIGRAVITY_* coordination exports. Every agent framework reads ISSUE_SOURCE; only the coordination vars are Claude-specific. This matches the plugins copy, which does the same.

tests/test_agent_mirror_parity.sh

This pair cannot join the byte-identical SHARED list: the two sides legitimately differ (tmux/cmux launch mechanics, ANTIGRAVITY_* vs CLAUDE_CODE_* env names), so a diff check would fail permanently and train everyone to ignore the guard. Behavioural assertions instead, applied symmetrically to both sides:

  • --help output (actually executed — a flag can be documented in a comment and still not be parsed) must mention --issue-source and --issue-dir
  • the source must contain issue-source-lib.sh, --issue-source), --issue-dir), resolve_effective_issue_source, and issue_env_exports — each of the three stages is a separate way to be half-wired

Verification

The new guard is load-bearing. Reverting only .agent/scripts/start-parallel-agents.sh to its pre-fix content and re-running:

FAIL: mirror start-parallel-agents.sh does not document --issue-source
FAIL: mirror start-parallel-agents.sh does not document --issue-dir
FAIL: mirror start-parallel-agents.sh is missing issue-source-lib.sh
FAIL: mirror start-parallel-agents.sh is missing --issue-source)
FAIL: mirror start-parallel-agents.sh is missing --issue-dir)
FAIL: mirror start-parallel-agents.sh is missing resolve_effective_issue_source
FAIL: mirror start-parallel-agents.sh is missing issue_env_exports
Results: 26 passed, 7 failed

With the fix restored: 33 passed, 0 failed.

Full shell suite: 18/18 pass. bash -n over every script and py_compile over every Python script: clean. --help runs cleanly on both sides.

pytest is not installed in this environment, so the 4 Python tests were not run locally; CI installs pytest and runs them.

🤖 Generated with Claude Code

…agents mirror

PR #87 mirrored issue-source-lib.sh into .agent/scripts/, but its only
consumer there still never called it. The Antigravity swarm launcher had
no --issue-source/--issue-dir flags, never resolved a backend, and
launched every worker without ISSUE_SOURCE/ISSUE_DIR_PATH — so with
`--issue-dir` the dispatcher's chosen issue store never reached the
workers, which fell back to whatever .autocoder.json said.

.agent/scripts/start-parallel-agents.sh:
- source issue-source-lib.sh
- parse --issue-source / --issue-dir, and document both in the header
  comment and --help output
- call resolve_effective_issue_source once in the dispatcher
- add send_issue_env_tmux / send_issue_env_cmux and invoke them at all
  five launch sites (3 tmux, 2 cmux), unconditionally rather than behind
  the existing `AGENT = claude` coordination guard, since every agent
  framework reads ISSUE_SOURCE

tests/test_agent_mirror_parity.sh:
This pair cannot join the byte-identical SHARED list — the two sides
legitimately differ (tmux/cmux mechanics, ANTIGRAVITY_* vs
CLAUDE_CODE_* env names), so a diff check would fail permanently and be
ignored. Added behavioural assertions instead: both sides must document
both flags in real --help output, and both must parse them, resolve the
backend, and emit issue_env_exports.

Verification:
- Mutation check: reverting only the mirror turns the new guard red
  (26 passed / 7 failed); with the fix, 33 passed / 0 failed.
- Full shell suite: 18/18 pass.
- bash -n over all scripts + py_compile: clean.
- pytest not installed locally; CI runs it.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant