Skip to content

agy-stop-hook.sh's field protocol likely leaves a trailing \r on Windows/Git-Bash, misrouting the Stop hook to the wrong session (fails-to-preserve, not covered by CI) #579

Closed

Description

@fdaviddpt

Filed from release-auditor round 1 on the v0.27.0..HEAD delta (2026-09-05).

Class: fails-to-preserve -- can ship behind a filed issue (non-blocking). Windows behaviour REASONED, mechanism OBSERVED. CI coverage: not covered.

Same four-line protocol as the sibling misreports finding (scripts/agy-stop-hook.sh:96-125). On Windows/Git-Bash, python3 -c 'print(...)' writes \r\n to the pipe; command substitution strips the trailing \n and leaves the \r on every field. Observed: a probe with an embedded CR in conversationId yielded CONVERSATION_ID=[abc^M] intact, and no agy script contains any CR-handling (grep for tr -d/%$'\r' over scripts/agy-*.sh returned nothing). Reasoned, not observed: the Windows half -- no Windows runner was available to the auditor.

If it holds: _TRANSCRIPT_PATH carries a trailing \r, pipeline/host.transcript_path()'s os.path.isfile() fails, find_session() falls through to max(files, key=os.path.getmtime), and the Stop hook silently flushes and position-stamps a different session than the one that actually stopped. This is the same class scripts/log.sh:543-545 already fixed elsewhere (Python on Windows emits \r\n which corrupts numeric values, #84) -- the new protocol reintroduces it without the strip.

Coverage, measured: .github/workflows/tests.yml:29-31 runs [ubuntu-latest, macos-latest, windows-latest] x Python 3.9-3.12, so a Windows leg exists in CI -- but tests/test_agy_hooks_563.py:49-51 and tests/test_agy_hooks_malformed_payload_568.py:43-45 both carry a module-level pytestmark = pytest.mark.skipif(sys.platform == "win32", ...). Nothing in CI executes these scripts on Windows today. docs/install-antigravity.md's own "nothing here is claimed for Windows" caveat is a fair mitigation and the reason this was not ranked higher.

Fix: strip trailing \r from each field read out of the protocol (or switch to a CR/LF-safe framing), and remove the Windows skipif once a Windows-safe way to exercise these scripts in CI exists.

[AI-generated]

Activity

  1. added
    bug
    priority:medium
    filed-by-loop
    cohort-6
    on Sep 5, 2026
  2. self-assigned this
    on Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugcohort-6filed-by-looppriority:medium

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions