From ffb47471069a8273633db33256fa6706e1256155 Mon Sep 17 00:00:00 2001 From: Curtis Kormos Date: Mon, 23 Nov 2026 09:39:28 -0600 Subject: [PATCH 1/2] fix(osc7501): treat Antigravity CLI >= 1.4.0 as a native reporter agy has written its own OSC 7501 records since 1.4.0, but osc_native had no floor for it, so the bridge armed a watcher beside it. The two writers took turns replacing the pane's single root record: app=antigravity from agy, then app=firstmate-agy from the bridge. Terminals that key a pane's identity on the record's app saw the agent change name between reports. Give agy a 1.4.0 floor so the bridge stands down, as it does for claude, pi, codex, grok and muse. An older agy keeps the generic reporter and an agy whose version cannot be read counts as native. --- bin/fm-osc7501.sh | 6 +++++- tests/fm-osc7501.test.sh | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/bin/fm-osc7501.sh b/bin/fm-osc7501.sh index 3962a872317..4fa11623099 100755 --- a/bin/fm-osc7501.sh +++ b/bin/fm-osc7501.sh @@ -27,7 +27,10 @@ # codex-cli >= 0.163.0 (openai/codex#52725, first released in # rust-v0.163.0, verified 2026-11-01), and Grok >= 1.0.67 and Muse Code # >= 1.4.11 (the lowest versions verified reporting on Rex, -# docs/verification/runtime-backends.md) send their own root records; +# docs/verification/runtime-backends.md), and Antigravity CLI >= 1.4.0 +# (`agy changelog` dates its OSC 7501 reporting to 1.4.0; 1.5.15 seen +# writing app=antigravity records on herdr-core, 2026-11-23) send their +# own root records; # a terminal keeps one root record per pane, so a firstmate record would # only replace theirs. The probe runs --agent-bin; one of these # harnesses whose version cannot be read counts as native, so no @@ -262,6 +265,7 @@ osc_native() { codex) floor=0.163.0 ;; grok) floor=1.0.67 ;; muse) floor=1.4.11 ;; + agy) floor=1.4.0 ;; *) return 1 ;; esac ver=$(osc_probe_version "$2") || return 0 diff --git a/tests/fm-osc7501.test.sh b/tests/fm-osc7501.test.sh index 3cc9e9dfff3..642a411f140 100755 --- a/tests/fm-osc7501.test.sh +++ b/tests/fm-osc7501.test.sh @@ -394,6 +394,40 @@ t_native_codex_threshold() { pass "native gate: codex >= 0.163.0 or of unreadable version arms nothing, older codex keeps the generic reporter" } +# Antigravity CLI added its own OSC 7501 records in 1.4.0 (`agy changelog`). +# Left to the generic reporter, a 1.4.0+ agy and the bridge take turns +# replacing the pane's root record (app=antigravity, then app=firstmate-agy): +# 1.4.0 arms nothing, 1.3.9 still gets the generic reporter, and an agy whose +# version cannot be read is treated as native. +t_native_agy_threshold() { + local d=$TMP_ROOT/nativeagy + mkhome "$d"; mkfake "$d" agy '1.4.0' + start_term "$d" + env "${CLEAN_UNSET[@]}" REX_BLOCK=b1 FM_OSC7501_TTY="$TERM_SLAVE" \ + PATH="$d/bin:$PATH" bash "$SCRIPT" arm \ + --task t27 --harness agy --backend rex --kind ship \ + --state "$d/state" --config "$d/config" --agent-bin agy + sleep 0.3 + assert_equals "" "$(cat "$d/cap" 2>/dev/null)" "native agy: terminal sees zero bytes" + [ -z "$(ls "$d/state"/.osc7501watch-* 2>/dev/null)" ] || fail "native agy 1.4.0 armed a watcher" + mkfake "$d" agy '1.3.9' + env "${CLEAN_UNSET[@]}" REX_BLOCK=b1 FM_OSC7501_TTY="$TERM_SLAVE" \ + PATH="$d/bin:$PATH" bash "$SCRIPT" arm \ + --task t27 --harness agy --backend rex --kind ship \ + --state "$d/state" --config "$d/config" --agent-bin agy + local wpid + wpid=$(watcher_pid "$d/state") || fail "agy 1.3.9 armed no generic watcher" + mkfake "$d" agy 'agy dev build' + env "${CLEAN_UNSET[@]}" REX_BLOCK=b1 FM_OSC7501_TTY="$TERM_SLAVE" \ + PATH="$d/bin:$PATH" bash "$SCRIPT" arm \ + --task t27 --harness agy --backend rex --kind ship \ + --state "$d/state" --config "$d/config" --agent-bin agy + wait_gone "$wpid" || fail "agy relaunch left the old generic reporter running" + [ -z "$(ls "$d/state"/.osc7501watch-* 2>/dev/null)" ] || fail "an agy with an unreadable version armed a watcher" + stop_term + pass "native gate: agy >= 1.4.0 or of unreadable version arms nothing, older agy keeps the generic reporter" +} + # --- shared root record -------------------------------------------------------- # A native writer and the bridge share one root record. Codex's own working @@ -1189,6 +1223,7 @@ fm_test_run \ t_launch_without_agent_bin_skips \ t_inplace_upgrade_reprobes_native \ t_native_codex_threshold \ + t_native_agy_threshold \ t_unknown_activity_leaves_native_root \ t_unknown_activity_keeps_record_honest \ t_final_record_with_unknown_activity \ From cb96a906d030c3e2903672900fcf7a47e4565893 Mon Sep 17 00:00:00 2001 From: Curtis Kormos Date: Mon, 23 Nov 2026 09:46:42 -0600 Subject: [PATCH 2/2] no-mistakes(review): Pass resolved agy binary to OSC native gate --- bin/fm-spawn.sh | 1 + tests/fm-agy-harness.test.sh | 2 ++ tests/fm-osc7501.test.sh | 9 +++++---- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/bin/fm-spawn.sh b/bin/fm-spawn.sh index 4b1b7f898be..1a777dfe98c 100755 --- a/bin/fm-spawn.sh +++ b/bin/fm-spawn.sh @@ -8013,6 +8013,7 @@ if [ "$RAW_LAUNCH" = 0 ]; then case "$HARNESS" in pi | pi-signed) OSC7501_AGENT_BIN=${PI_BIN:-} ;; muse) OSC7501_AGENT_BIN=${MUSE_BIN:-} ;; + agy) OSC7501_AGENT_BIN=${AGY_BIN:-} ;; *) OSC7501_AGENT_BIN=$HARNESS ;; esac else diff --git a/tests/fm-agy-harness.test.sh b/tests/fm-agy-harness.test.sh index 3abf64ca611..46ea4692c3c 100755 --- a/tests/fm-agy-harness.test.sh +++ b/tests/fm-agy-harness.test.sh @@ -636,6 +636,8 @@ test_agy_launch_carries_the_brief_with_model_effort_and_autonomy() { expect_code 0 "$rc" "agy spawn with a listed model should succeed" launch=$(cat "$CASE_DIR/launch.log") assert_contains "$launch" "$FAKEBIN_DIR/agy" "agy launch did not pin the resolved absolute binary" + assert_contains "$launch" "--agent-bin '$FAKEBIN_DIR/agy'" \ + "agy OSC gate did not probe the resolved binary the launch runs" assert_contains "$launch" "--prompt-interactive" "agy launch did not carry the brief via --prompt-interactive" assert_contains "$launch" "--model 'gemini-3.8-flash-low'" "agy launch did not carry the requested model" assert_contains "$launch" "--effort 'low'" "agy launch did not carry the requested effort" diff --git a/tests/fm-osc7501.test.sh b/tests/fm-osc7501.test.sh index 642a411f140..e2ddc964c38 100755 --- a/tests/fm-osc7501.test.sh +++ b/tests/fm-osc7501.test.sh @@ -402,14 +402,15 @@ t_native_codex_threshold() { t_native_agy_threshold() { local d=$TMP_ROOT/nativeagy mkhome "$d"; mkfake "$d" agy '1.4.0' + mkfake "$d/old" agy '1.3.9' start_term "$d" env "${CLEAN_UNSET[@]}" REX_BLOCK=b1 FM_OSC7501_TTY="$TERM_SLAVE" \ - PATH="$d/bin:$PATH" bash "$SCRIPT" arm \ + PATH="$d/old/bin:$d/bin:$PATH" bash "$SCRIPT" arm \ --task t27 --harness agy --backend rex --kind ship \ - --state "$d/state" --config "$d/config" --agent-bin agy + --state "$d/state" --config "$d/config" --agent-bin "$d/bin/agy" sleep 0.3 - assert_equals "" "$(cat "$d/cap" 2>/dev/null)" "native agy: terminal sees zero bytes" - [ -z "$(ls "$d/state"/.osc7501watch-* 2>/dev/null)" ] || fail "native agy 1.4.0 armed a watcher" + assert_equals "" "$(cat "$d/cap" 2>/dev/null)" "native agy: terminal sees zero bytes despite an older PATH agy" + [ -z "$(ls "$d/state"/.osc7501watch-* 2>/dev/null)" ] || fail "native agy 1.4.0 armed a watcher despite an older PATH agy" mkfake "$d" agy '1.3.9' env "${CLEAN_UNSET[@]}" REX_BLOCK=b1 FM_OSC7501_TTY="$TERM_SLAVE" \ PATH="$d/bin:$PATH" bash "$SCRIPT" arm \