Skip to content

feat(agy): answer guesses in a tool-less side agent - #552

Open
vaakx-dev wants to merge 1 commit into
mainfrom
sand/agy-aside-guesses
Open

vaakx-dev wants to merge 1 commit into
mainfrom
sand/agy-aside-guesses

Conversation

@vaakx-dev

Copy link
Copy Markdown
Owner

Antigravity (agy) chats now get message guesses, answered by a small side agent that never touches the chat's own agy session.

What

  • agy sessions answer aside by starting a short-lived agy acp --agent sand-aside process. Its workspace (<home>/apps/agy) holds a custom agent with excludeDefaultComponents: true and tools: [], so it has no built-in tools, no sand tools and no default agy prompt.
  • The aside gets the end of the chat (user and assistant text, last 8,000 characters) plus the question, on the chat's own model at low effort. The process closes when the answer arrives.
  • AppSession.aside now takes { question, messages }, so an app that can't fork still sees the chat. Claude Code, Codex and replay read only question, as before.

Why

  • agy 1.5.16's ACP server has no session/fork, session/sample or side-question method (all return -32601). Its /btw side question only works in the terminal UI: over ACP, /btw runs as a normal turn and stays in the conversation.
  • A fresh agy session with the default agent costs about 10,800 input tokens before the question, because of agy's own prompt and tools, and none of it was cached between sessions. With the tool-less custom agent, the same guess costs about 530–600 input tokens.
  • A separate process keeps the main session's history, context and prompt cache unchanged. That process can't call the chat's sand tools either.

Verification

  • New plugins/core/agy/test/aside.test.ts runs the real session code against a fake agy on PATH. It checks that the aside answers from a second process running the side agent, with no MCP servers, the chat's model at low effort and the recent chat in its prompt. It also checks that the chat's process got exactly one prompt and one session, and that the aside process is closed afterwards.
  • Real agy, Gemini 4 Neon: the main turn used 10,745 input tokens. The aside used 603 input and 462 output (mostly thinking) and took 9.5 s. session/load of the main session then showed only the one exchange, with context used unchanged.
  • Real agy through sand (harness with core/agy and agent/guesses, Gemini 3.8 Flash): the turn finished, then a guess arrived about 11 s later and guessRead returned it. The main agy session again held only its one exchange. The side session used 1,061 tokens.
  • bunx tsc, vrui-check, deps and comment checks passed. bun test of agy, accounts, codex, claude-code, replay, guesses and app-plan passed. In the full local run, the only failure was the message-search concurrent-write test, which passes on its own.

Antigravity can't fork or sample a session over ACP, so an aside opens a short-lived agy process with a custom agent that has no tools or default prompt, gives it the recent chat and asks at low effort. The chat's own session is never touched.
@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Performance: ✅ every row is within its limit

Main 932d802 against this PR d2e741a, both measured in the same job, medians of 5 runs. Times, memory and CPU fail when the PR is more than 15% worse, bytes when they grow more than 5%; changes under 20 ms or 2 KB never fail. Logs

main PR change
Phone (4× slower CPU, 150 ms, 9 Mbit/s link)
open a chat: shows 320 ms 315 ms -1.5% ✅
open a chat: usable 346 ms 328 ms -5.3% ✅
first visit with an empty cache: usable 2.01 s 2.04 s +1.4% ✅
open a long chat: usable 318 ms 317 ms -0.3% ✅
send: your message shows 59 ms 60 ms +1.4% ✅
send: first reply text shows 313 ms 326 ms +4.2% ✅
main thread blocked over these steps 762 ms 786 ms +3.1% ✅
data on first visit 931.3 KB 931.7 KB +0.0% ✅
data per chat opened 49.5 KB 49.5 KB +0.0% ✅
data while idle for 20 s 220 B 220 B 0% ✅
app code a phone downloads 1.6 MB 1.6 MB 0% ✅
Main pages (same phone and link)
Settings: time to open 39 ms 42 ms +9.0% ✅
Settings: data to open 100 B 100 B 0% ✅
Settings: data per minute left open 600 B 600 B 0% ✅
Add-ons: time to open 49 ms 50 ms +1.8% ✅
Add-ons: data to open 0 B 0 B 0% ✅
Add-ons: data per minute left open 600 B 600 B 0% ✅
Usage: time to open 49 ms 44 ms -11.0% ✅
Usage: data to open 15.2 KB 15.2 KB 0% ✅
Usage: data per minute left open 600 B 600 B 0% ✅
Search: time to open 55 ms 54 ms -1.8% ✅
Search: data to open 0 B 0 B 0% ✅
Search: data per minute left open 600 B 600 B 0% ✅
Performance: time to open 438 ms 439 ms +0.3% ✅
Performance: data to open 788 B 798 B +1.3% ✅
Performance: data per minute left open 1.9 KB 1.8 KB -9.2% ✅
PC side
start-up until ready 4.06 s 4.07 s +0.1% ✅
memory while idle 237.4 MB 237.0 MB -0.1% ✅
CPU used over 60 s idle 340 ms 340 ms 0% ✅
memory after 100 scripted chat turns 273.7 MB 272.8 MB -0.3% ✅
CPU for one reply 49 ms 48 ms -2.0% ✅
search time on 100k messages 101 ms 102 ms +1.9% ✅
database size per 10k messages 19.8 MB 19.8 MB -0.0% ✅
worktree list with sizes on 40 worktrees 793 ms 776 ms -2.2% ✅
slowest other reply during a worktree list 46 ms 51 ms +11.6% ✅

This branch has not been deployed

No deployments
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