Skip to content

fix(agy): detect and answer clipped tall questions and Write-in (v0.4.227) - #268

Merged
kazuph merged 1 commit into
mainfrom
fix/agy-clipped-question-capture
Dec 2, 2026
Merged

kazuph merged 1 commit into
mainfrom
fix/agy-clipped-question-capture

Conversation

@kazuph

@kazuph kazuph commented Dec 2, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes agy (Antigravity CLI) question detection (blocked status), decision dialog capture, and Write-in... free-text answering when tall questions exceed the terminal viewport height (observed live on 43-row pane p5), plus version bump to v0.4.227.

Root Cause

  1. When an agy question exceeds the terminal viewport height, Ink clips Question / ─── / Question X/Y: off the top before writing to the PTY (never appearing in visible or scrollback lines).
  2. Both agyview.HasCurrentFooter (status detection) and screenprompt.parseAgy (decision capture) required Question X/Y: to be visible above the options.
  3. Question bodies containing column-0 numbered lists (1. 推奨: / 2. ...) also interfered with top-down option scanning.

Changes

  • internal/agyview/tail.go, internal/detect/manifests/antigravity.toml: Added OptionRow / HasWriteInOptionBlock and clipped-question footer recognition while continuing to reject permission prompts, broken Question headers, non-1/1 short footers, and screens without Write-in....
  • internal/screenprompt/agy.go, internal/screenprompt/parse.go: Refactored parseAgy bottom-up from the active footer (↑/↓ Navigate or enter Submit[ All] · esc Back + Your answer:), keeping column-0 numbered body bullets in the body, locating Your answer: structurally below the option block (immune to literal "Question" / "Your answer:" inside user drafts), stripping multi-line wrapped ○ Thought for ... lines while preserving Japanese ● bullets, failing closed (return nil) when all visible body text is clipped off, and adding MatchesClippedAgyEdit for Write-in... editor-open transitions.
  • internal/server/screen_prompts.go, internal/server/screen_answer.go, internal/server/screen_agy_answer.go: Prefer untruncated scrollback capture when available and allow MatchesClippedAgyEdit only during active Write-in... editor delivery.
  • cmd/ikesu/main.go: Bumped version from 0.4.226 to 0.4.227.

Astra Review (Round 1 & Round 2)

  • Round 1: Reverted TruncatedNotice signature override (P1), added MatchesClippedAgyEdit for untruncated→clipped Write-in open (P2), hardened Your answer: editor lookup against literal "Question"/"Your answer:" in drafts (P2), and narrowed isClippedBodyStop to preserve Japanese ● bullets (P2).
  • Round 2:
    • Fixed P1 body-less normal signature collision by returning nil (fail-closed) in parseAgy when visibleBody == "" (status detection still marks pane blocked).
    • Hardened MatchesClippedAgyEdit to always reject empty currBody and reject enter Submit All · esc Back on non-final Question 1/N prompts.
    • Fixed P2 multi-line (2+ lines) wrapped ○ Thought for ... continuation stripping.
    • Disclosed residual caveat: During the brief in-place clipped Write-in... editor-open window (when Ink clips top lines without scrolling them into scrollback), MatchesClippedAgyEdit relies on non-empty body suffix + identical options + zero external input (same suffix-verification model as existing agyTextMatches).

Verification

  • Local: go test -count=1 ./internal/agyview ./internal/detect ./internal/screenprompt (0.24s / 0.40s / 0.72s), go test -count=1 -run TestAgy ./internal/server (28.29s), go build ./cmd/ikesu — all PASS.
  • Mac mini (scripts/test-go.py --mode both --packages-at-once 2):
    • normal: exit 0 (all packages PASS).
    • race: all changed and remaining packages PASS; unrelated internal/runtime hit known CPU-contention timing flake TestPaintLinkScanStaysNearTheViewportOnAHugeLogicalLine, immediately re-verified solo with scripts/test-go.py --mode race ./internal/runtime -> PASS (73.323s, exit 0).

@kazuph
kazuph merged commit d35025d into main Dec 2, 2026
@kazuph
kazuph deleted the fix/agy-clipped-question-capture branch December 2, 2026 12:10
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