Skip to content

fix(bin): omit agy --effort for Opus to prevent Gemini fallback - #5

Merged
davidtandoh merged 3 commits into
mainfrom
fm/antigravity-setup
Sep 17, 2026
Merged

davidtandoh merged 3 commits into
mainfrom
fm/antigravity-setup

Conversation

@davidtandoh

Copy link
Copy Markdown
Owner

Intent

Implement the narrow launch fix and regression tests so requesting Opus cannot silently fall back to Gemini because of an unsupported effort flag.
Approved with: sure. what's up with the kiro herdr integrations as well as quota axi too
Approval context: approval to implement the narrow launch fix and regression tests, commit, validate through no-mistakes, push and open a PR. No merge or installation grant.

What Changed

  • bin/fm-spawn.sh: effort_flag_for_harness now omits --effort for the agy model claude-opus-4-6-thinking and prints a stderr notice, because native agy rejected that combination and selected Gemini instead. The requested effort still lands in task metadata, and every other model keeps the existing low|medium|high pass-through and xhigh/max record-and-omit behavior; no capability is inferred from model names.
  • tests/fm-agy-harness.test.sh: adds two regression tests. One spawns Opus at every effort level plus the default and asserts the model is kept, --effort is absent from the launch, metadata retains the model and effort, and the notice appears only when an effort was requested. The other asserts a synthetic future-model and the default selection still pass --effort 'high' through with no omission notice. The fake agy models listing gains both ids.
  • Docs: the agy harness adapter reference and docs/verification/agy.md describe the model-scoped effort behavior, record the attributed 2026-09-17 parent-session observation of the fallback and interactive Opus selection, and list what remains unexercised for Opus (automatic native launch after the omission, full lifecycle acceptance, quota routing).

Risk Assessment

✅ Low: A narrow exact-model guard at the single shared effort-flag boundary with a stderr notice, preserved metadata, unchanged behavior for every other model, and behavioral regression tests driven through the real spawn interface; no unrequired components or intent contradictions found.

Testing

I ran the real bin/fm-spawn.sh through its command line in isolated temporary homes. The test harness supplied fake tmux and agy binaries, so no real pane or model session was started. For Opus with low, medium, high, xhigh, max and default effort, the launch kept --model 'claude-opus-4-6-thinking' and carried no --effort. Every explicit effort printed the notice, and the meta file kept the requested effort. The default-effort case printed no notice. A Gemini model, a synthetic future-model and default model selection still carried --effort. An Opus-named id missing from the listing was still refused before launch. The same drive against the base commit's spawn script showed the bug: Opus launched with --effort 'high' and no notice, and the new test failed there. tests/fm-agy-harness.test.sh passed in full on the target commit. A read-only probe of the installed agy 1.2.5 confirmed that claude-opus-4-6-thinking is a listed model id and that --effort accepts low, medium or high. A real Opus agy session was not launched. There is no UI surface, so the evidence is command-line transcripts. My temporary copy at /tmp/fm-agy-tkZjGw is still there because the destructive-command guard refused removal outside the worktree. The worktree is clean.

  • Live validation: ✅ go - 7 of 8 scenarios driven live against the product
Scenario Result Live Evidence
User spawns an agy crewmate with --model claude-opus-4-6-thinking --effort high: the launch typed into the pane keeps the Opus model flag and carries no --effort ✅ pass live transcript-fix.log. Real bin/fm-spawn.sh was driven through its CLI, with tmux and agy replaced by the repo test harness fakes. The launch shows --model 'claude-opus-4-6-thinking' only.
The Opus effort omission is not silent: spawn prints a notice naming the model and the requested effort, and task metadata still records effort=high and the Opus model ✅ pass live transcript-fix.log: the notice line plus the meta file showing model=claude-opus-4-6-thinking and effort=high.
Every effort value (low, medium, high, xhigh, max) and default effort with Opus yields no --effort flag, and default effort prints no spurious notice ✅ pass live test_agy_opus_effort_is_recorded_and_disclosed_but_omitted in fm-agy-harness-test.log, plus the Opus/xhigh drive in transcript-fix.log.
Regression reproduction: the same Opus + effort spawn against the base commit's fm-spawn.sh passes --effort through with no notice, and the new test fails there ✅ pass live transcript-base.log: the launch shows --model 'claude-opus-4-6-thinking' --effort 'high', and the new test reports not ok - Opus launch carried an incompatible effort flag.
Adversarial: non-Opus models (gemini-3.8-flash-high, a suffix-free synthetic future-model, default model) keep --effort pass-through and get no unsupported-effort notice ✅ pass live transcript-fix.log drives for gemini-3.8-flash-high/high and future-model/medium, plus test_agy_other_model_effort_behavior_is_preserved.
Adversarial: an Opus-looking id missing from the agy listing (claude-opus-9-not-listed) is still refused before pane creation, so the special case does not bypass model validation ✅ pass live transcript-fix.log: exit=1 with error: agy model 'claude-opus-9-not-listed' is not listed by 'agy models', and nothing typed into the pane.
The special-cased model id matches what the installed agy actually lists, and --effort is limited to low|medium|high ✅ pass live real-agy-readonly.log: agy 1.2.5 agy models lists claude-opus-4-6-thinking, and --help documents --effort (low|medium|high).
End-to-end with real agy: a crewmate launched with Opus and no --effort actually runs on Claude Opus rather than falling back to Gemini ⏸️ untested no Confirming this needs a real authenticated agy session in a tmux or herdr pane. That would spend the user's Antigravity quota, send a prompt to an external service, and write conversation and trust st…
Evidence: Fixed spawn transcript (target commit)

Source: Fixed spawn transcript (target commit)

=== fm-spawn.sh ... --harness agy --model claude-opus-4-6-thinking --effort high exit=0 --- spawn output (notices): notice: agy model 'claude-opus-4-6-thinking' does not support --effort; recording requested effort 'high' but omitting the flag to avoid model fallback --- agy flags typed into the pane: --model 'claude-opus-4-6-thinking' --- task metadata: model=claude-opus-4-6-thinking effort=high === ... --model gemini-3.8-flash-high --effort high exit=0 --- spawn output (notices): (none) --- agy flags typed into the pane: --model 'gemini-3.8-flash-high' --effort 'high'

=== fm-spawn.sh drive-claude-opus-4-6-thinking-high-72683 <proj> --harness agy --model claude-opus-4-6-thinking --effort high
exit=0
--- spawn output (notices):
notice: agy model 'claude-opus-4-6-thinking' does not support --effort; recording requested effort 'high' but omitting the flag to avoid model fallback
--- agy flags typed into the pane:
--model 'claude-opus-4-6-thinking' 
--- task metadata:
model=claude-opus-4-6-thinking
effort=high

=== fm-spawn.sh drive-claude-opus-4-6-thinking-xhigh-72683 <proj> --harness agy --model claude-opus-4-6-thinking --effort xhigh
exit=0
--- spawn output (notices):
notice: agy model 'claude-opus-4-6-thinking' does not support --effort; recording requested effort 'xhigh' but omitting the flag to avoid model fallback
--- agy flags typed into the pane:
--model 'claude-opus-4-6-thinking' 
--- task metadata:
model=claude-opus-4-6-thinking
effort=xhigh

=== fm-spawn.sh drive-gemini-3.8-flash-high-high-72683 <proj> --harness agy --model gemini-3.8-flash-high --effort high
exit=0
--- spawn output (notices):
(none)
--- agy flags typed into the pane:
--model 'gemini-3.8-flash-high' --effort 'high' 
--- task metadata:
model=gemini-3.8-flash-high
effort=high

=== fm-spawn.sh drive-future-model-medium-72683 <proj> --harness agy --model future-model --effort medium
exit=0
--- spawn output (notices):
(none)
--- agy flags typed into the pane:
--model 'future-model' --effort 'medium' 
--- task metadata:
model=future-model
effort=medium

=== fm-spawn.sh drive-claude-opus-9-not-listed-high-72683 <proj> --harness agy --model claude-opus-9-not-listed --effort high
exit=1
--- spawn output (notices):
error: agy model 'claude-opus-9-not-listed' is not listed by 'agy models'; choose a listed id or omit --model
--- agy flags typed into the pane:

--- task metadata:
grep: <case>/drive-claude-opus-9-not-listed-high/home/state/drive-claude-opus-9-not-listed-high-72683.meta: No such file or directory

ok - fm-spawn: Opus keeps its model and effort metadata but omits incompatible effort with a notice
ok - fm-spawn: other models and default selection retain effort pass-through
ok - fm-spawn: agy omits xhigh from the launch but records it in task metadata
Evidence: Base commit transcript reproducing the bug

Source: Base commit transcript reproducing the bug

=== fm-spawn.sh ... --harness agy --model claude-opus-4-6-thinking --effort high exit=0 --- spawn output (notices): (none) --- agy flags typed into the pane: --model 'claude-opus-4-6-thinking' --effort 'high' ... not ok - Opus launch carried an incompatible effort flag (unexpected: '--effort')

=== fm-spawn.sh drive-claude-opus-4-6-thinking-high-64316 <proj> --harness agy --model claude-opus-4-6-thinking --effort high
exit=0
--- spawn output (notices):
(none)
--- agy flags typed into the pane:
--model 'claude-opus-4-6-thinking' --effort 'high' 
--- task metadata:
model=claude-opus-4-6-thinking
effort=high

=== fm-spawn.sh drive-claude-opus-4-6-thinking-xhigh-64316 <proj> --harness agy --model claude-opus-4-6-thinking --effort xhigh
exit=0
--- spawn output (notices):
(none)
--- agy flags typed into the pane:
--model 'claude-opus-4-6-thinking' 
--- task metadata:
model=claude-opus-4-6-thinking
effort=xhigh

=== fm-spawn.sh drive-gemini-3.8-flash-high-high-64316 <proj> --harness agy --model gemini-3.8-flash-high --effort high
exit=0
--- spawn output (notices):
(none)
--- agy flags typed into the pane:
--model 'gemini-3.8-flash-high' --effort 'high' 
--- task metadata:
model=gemini-3.8-flash-high
effort=high

=== fm-spawn.sh drive-future-model-medium-64316 <proj> --harness agy --model future-model --effort medium
exit=0
--- spawn output (notices):
(none)
--- agy flags typed into the pane:
--model 'future-model' --effort 'medium' 
--- task metadata:
model=future-model
effort=medium

=== fm-spawn.sh drive-claude-opus-9-not-listed-high-64316 <proj> --harness agy --model claude-opus-9-not-listed --effort high
exit=1
--- spawn output (notices):
error: agy model 'claude-opus-9-not-listed' is not listed by 'agy models'; choose a listed id or omit --model
--- agy flags typed into the pane:

--- task metadata:
grep: <case>/drive-claude-opus-9-not-listed-high/home/state/drive-claude-opus-9-not-listed-high-64316.meta: No such file or directory

not ok - Opus launch carried an incompatible effort flag (unexpected: '--effort')
--- output ---
env -u CURSOR_AGENT -u CURSOR_INVOKED_AS -u GEMINI_CLI env -u CLAUDECODE -u PI_CODING_AGENT -u GROK_AGENT -u FM_PI_HARNESS '<case>/opus-low/fake/fakebin/agy' --prompt-interactive "$('<tmp>/base/bin/fm-operational-input.sh' encode launch-brief < '<case>/opus-low/home/data/agy-opus-low-64316/launch-brief.md')" --model 'claude-opus-4-6-thinking' --effort 'low' --dangerously-skip-permissions
Evidence: Full agy harness test run on target commit

Source: Full agy harness test run on target commit

ok - fm-harness.sh: ancestry detects a natively-named agy command
ok - fm-harness.sh: ancestry rejects unrelated agy mentions
ok - fm-harness.sh: no inherited launcher marker claims the agy identity
ok - fm-control-lib: agy mechanics are Escape once, no clear key, and /quit
ok - fm-busy-lib: only the pinned esc-to-cancel row carries the agy busy verdict
ok - fm-composer-lib: agy delivery signatures never cross harnesses
ok - fm-busy-lib: agy classifies busy on its marker and unknown without it
ok - bin/fm-agent-process-lib.sh: agy is an agent, fragments are not
ok - herdr exit detection: done with a live registry and an agy process view stays live and refuses replacement
ok - herdr exit detection: a registered status over a shell-only pane is stale-agent and still refuses closing
ok - herdr exit detection: a registered pane with an agy foreground stays live however its shell ranks
ok - herdr exit detection: only a positively unregistered pane is agent-free
ok - herdr exit detection: malformed and failed reads stay unknown
ok - fm-spawn: agy launch carries brief, model, effort, and autonomy with cleared markers
ok - fm-spawn: Opus keeps its model and effort metadata but omits incompatible effort with a notice
ok - fm-spawn: other models and default selection retain effort pass-through
ok - fm-spawn: agy omits xhigh from the launch but records it in task metadata
ok - fm-spawn: an unlisted agy model refuses before pane creation
ok - fm-spawn: an unreachable agy listing establishes nothing and launches
ok - fm-spawn: a hung agy listing is cut off by the shared bound and launches unvalidated
ok - fm-spawn: a zero FM_AGY_MODELS_TIMEOUT is clamped to the default bound
ok - fm-agy-trust.sh: registers the logical and resolved worktree paths and preserves the store
ok - fm-agy-trust.sh: creates agy's settings store when none exists
ok - fm-agy-trust.sh: refuses every out-of-scope path and never rewrites a broken store
ok - fm-spawn: agy pre-registers the worktree and launches straight into a busy turn
ok - fm-spawn: agy answers a dialog that renders anyway exactly once, then confirms busy
ok - fm-spawn: on an unregistered path a premature busy verdict waits for the dialog to be answered
ok - fm-spawn: a busy verdict on an unregistered path without a dialog fails and closes the endpoint
ok - fm-spawn: an agy dialog that never turns busy fails the spawn and closes the endpoint
ok - fm-spawn: a missing agy executable refuses before pane creation
ok - fm-spawn: agy cannot be launched as a secondmate
ok - fm-spawn: agy arms no busy wiring and writes no sidecar
Evidence: Read-only probe of installed agy 1.2.5 (models listing, --effort help)

Source: Read-only probe of installed agy 1.2.5 (models listing, --effort help)

$ agy --version
1.2.5
$ agy models
Fetching available models...
gemini-3.8-flash-high	Gemini 3.8 Flash (High)
gemini-3.8-flash-medium	Gemini 3.8 Flash (Medium)
gemini-3.8-flash-low	Gemini 3.8 Flash (Low)
gemini-3.7-flash-high	Gemini 3.7 Flash (High)
gemini-3.7-flash-medium	Gemini 3.7 Flash (Medium)
gemini-3.7-flash-low	Gemini 3.7 Flash (Low)
gemini-3.6-flash-high	Gemini 3.6 Flash (High)
gemini-3.6-flash-medium	Gemini 3.6 Flash (Medium)
gemini-3.6-flash-low	Gemini 3.6 Flash (Low)
gemini-3.1-pro-high	Gemini 3.1 Pro (High)
gemini-3.1-pro-low	Gemini 3.1 Pro (Low)
claude-sonnet-4-6	Claude Sonnet 4.6 (Thinking)
claude-opus-4-6-thinking	Claude Opus 4.6 (Thinking)
gpt-oss-120b-medium	GPT-OSS 120B (Medium)
exit=0
$ agy --help | grep -i effort
  --effort                        Reasoning effort for the current CLI session (low|medium|high)
  -i                              Short alias for --prompt-interactive

Pipeline

Updates from git push no-mistakes

✅ **intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

⚠️ **Review** - 1 info
  • ℹ️ bin/fm-spawn.sh:2023 - The omission keys on the exact requested id claude-opus-4-6-thinking. When no --model is given (or --model default), --effort low|medium|high still passes through, so if agy's native default ever resolves to Opus the same reject-and-fall-back sequence is reachable. The intent scopes the fix to requesting Opus and the commit message explicitly records native automatic selection as unverified, so this is an acknowledged boundary rather than a defect. Traced: every spawn/relaunch/secondmate path resolves MODEL before the single call site at bin/fm-spawn.sh:4048, the notice goes to stderr so it does not pollute the captured EFFORTFLAG, ultra is refused earlier for non-pi harnesses, and meta still records effort=/model= as requested.
✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 7 of 8 scenarios driven live against the product
Scenario Result Live Evidence
User spawns an agy crewmate with --model claude-opus-4-6-thinking --effort high: the launch typed into the pane keeps the Opus model flag and carries no --effort ✅ pass live transcript-fix.log. Real bin/fm-spawn.sh was driven through its CLI, with tmux and agy replaced by the repo test harness fakes. The launch shows --model &#39;claude-opus-4-6-thinking&#39; only.
The Opus effort omission is not silent: spawn prints a notice naming the model and the requested effort, and task metadata still records effort=high and the Opus model ✅ pass live transcript-fix.log: the notice line plus the meta file showing model=claude-opus-4-6-thinking and effort=high.
Every effort value (low, medium, high, xhigh, max) and default effort with Opus yields no --effort flag, and default effort prints no spurious notice ✅ pass live test_agy_opus_effort_is_recorded_and_disclosed_but_omitted in fm-agy-harness-test.log, plus the Opus/xhigh drive in transcript-fix.log.
Regression reproduction: the same Opus + effort spawn against the base commit's fm-spawn.sh passes --effort through with no notice, and the new test fails there ✅ pass live transcript-base.log: the launch shows --model &#39;claude-opus-4-6-thinking&#39; --effort &#39;high&#39;, and the new test reports not ok - Opus launch carried an incompatible effort flag.
Adversarial: non-Opus models (gemini-3.8-flash-high, a suffix-free synthetic future-model, default model) keep --effort pass-through and get no unsupported-effort notice ✅ pass live transcript-fix.log drives for gemini-3.8-flash-high/high and future-model/medium, plus test_agy_other_model_effort_behavior_is_preserved.
Adversarial: an Opus-looking id missing from the agy listing (claude-opus-9-not-listed) is still refused before pane creation, so the special case does not bypass model validation ✅ pass live transcript-fix.log: exit=1 with error: agy model &#39;claude-opus-9-not-listed&#39; is not listed by &#39;agy models&#39;, and nothing typed into the pane.
The special-cased model id matches what the installed agy actually lists, and --effort is limited to low|medium|high ✅ pass live real-agy-readonly.log: agy 1.2.5 agy models lists claude-opus-4-6-thinking, and --help documents --effort (low|medium|high).
End-to-end with real agy: a crewmate launched with Opus and no --effort actually runs on Claude Opus rather than falling back to Gemini ⏸️ untested no Confirming this needs a real authenticated agy session in a tmux or herdr pane. That would spend the user's Antigravity quota, send a prompt to an external service, and write conversation and trust st…
  • bash tests/fm-agy-harness.test.sh on target commit cb15ce0: every test passed, exit 0
  • Base-versus-fix drive: two git archive cb15ce0 copies under /tmp, one with bin/fm-spawn.sh from bd56fe5. Each ran fm-spawn.sh &lt;id&gt; &lt;proj&gt; --harness agy --model &lt;m&gt; --effort &lt;e&gt; for Opus/high, Opus/xhigh, gemini-3.8-flash-high/high, future-model/medium and an unlisted Opus-like id, then the three agy effort tests
  • New test test_agy_opus_effort_is_recorded_and_disclosed_but_omitted run against the base spawn script: failed with --effort &#39;low&#39; in the launch, reproducing the bug
  • agy --version, agy models and agy --help | grep -i effort against the installed agy 1.2.5 (read-only)
  • git status --short: worktree clean after testing
🔧 **Document** - 1 issue found → auto-fixed ✅
  • ℹ️ docs/verification/agy.md:85 - The owner reference (.agents/skills/harness-adapters/references/harness/agy.md) was already updated by the change, and docs/verification/agy.md now points at the spawn omission and its regression test. However, the maintainer-verification record holds no dated command/output transcript for the empirical claim that native agy rejects --effort with claude-opus-4-6-thinking and falls back to Gemini; that observation is not present in the worktree, so it was not fabricated. If the author has the agy version, exact command, and output, add them under 'Model and effort' in docs/verification/agy.md.

🔧 Fix applied.
✅ Re-checked - no issues remain.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

Omit the incompatible effort flag for claude-opus-4-6-thinking and
report the omission while retaining requested task metadata. Preserve
existing effort behavior for other models without capability heuristics.

Cover launch arguments, omission notices, metadata, and pass-through
behavior through the spawn interface. Native automatic model selection
remains unverified; the parent observed interactive Opus receipt.
@davidtandoh
davidtandoh merged commit 2d72f19 into main Sep 17, 2026
14 checks passed
davidtandoh added a commit that referenced this pull request Sep 27, 2026
Bring fork main (2f9a106, the 2026-09-26 upstream sync plus fork
fixes #2-#6) into the Kiro V3 crew branch so PR #8 merges cleanly.
A merge, not a rebase, keeps the upstream PR kunchenguid#4679 merge and its
authorship intact.

Textual conflicts (1):

- bin/fm-test-run.sh, family_for_basename live-e2e list: this branch
  added fm-kiro-signals-live-e2e.test.sh on its own line; main added
  fm-herdr-agent-liveness-live-e2e.test.sh beside the version-floor
  test. Kept both entries, so both live tests stay classified in the
  live-harness-optin family.

Auto-merged files touched by both sides, checked by hand:

- bin/fm-spawn.sh: main's agy Opus --effort omission (fork fix #5)
  sits in the agy arm next to this branch's new kiro effort arm;
  effort_flag_for_harness keeps the (harness, effort, model)
  signature on both sides.
- agy.md, docs/configuration.md, docs/verification/runtime-backends.md:
  disjoint hunks.

Semantic review: the Kiro adapter adds no arm to bin/backends/herdr.sh
or fm_harness_pid_alive. Kiro reaches the fork's registration-
independent Herdr liveness (fork fix #3) through
fm_agent_process_classify_name, where kiro-cli classifies as agent.
It is worker-only, so it stays out of the primary session-lock
harness table.

Claude-Session: https://claude.ai/code/session_01B4Krq5gHjEPXbmzMaaeTHs
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