Antigravity runtime: first deliveries race the TUI startup (two conversations, preamble lost); MCP setup can be direct via agy mcp add
TL;DR(中文):Antigravity(agy)作为 PTY actor 时,守护进程把 MCP 前言和第一条消息相隔约 2 秒先后送进还在初始化的 TUI,agy 给每条输入各开一个会话,结果两条并行轨迹、两次回复,而活跃会话里没有系统前言。另外 agy 1.2.2 已有 agy mcp add,MCP 配置可以直接写而不必 prompt_assisted。
Environment
- CCCC 0.4.37 (base 388f29d, with local patches unrelated to this path), WSL2 Ubuntu 24.04
- Antigravity CLI
agy1.2.2 (https://antigravity.google/cli/install.sh), Google OAuth, free tier (Gemini 3.8 Flash) - Actor:
cccc actor add gemini-1 --runtime antigravity --runner pty --command "agy --dangerously-skip-permissions --model gemini-3.8-flash-high"
1. First two deliveries race the TUI startup: two conversations, preamble lost
Right after actor add, the daemon submitted the MCP-setup preamble ([CCCC] MCP setup request ...) and, about two seconds later, the first message (a moderator message sent with cccc send). agy had not opened a conversation yet (it was still resolving the model and refreshing quota), so it opened one conversation per input and ran both in parallel:
agy's own log (~/.gemini/antigravity-cli/log/cli-20260914_114300.log):
I0914 11:43:03.773387 ... input_loop.go:94] HandleUserInput called with text: "[CCCC] MCP setup request\nYou are running inside Antigravity. ..."
I0914 11:43:05.183071 ... model_resolver.go:93] Resolving model gemini-3.8-flash-high
I0914 11:43:05.780897 ... input_loop.go:94] HandleUserInput called with text: "[cccc] user → gemini-1 [event_id=3c32f98f...]:\n[ONBOARDING] ..."
I0914 11:43:06.062840 403 conversation_manager.go:451] Starting new conversation (agent=false)
I0914 11:43:06.062989 516 conversation_manager.go:451] Starting new conversation (agent=false)
I0914 11:43:06.126918 403 server.go:1177] Created conversation 98fed452-...
I0914 11:43:06.166669 516 server.go:1177] Created conversation 2e17d415-...
Result: two SQLite conversation files under ~/.gemini/antigravity-cli/conversations/, both ran the full tool loop (view_file, cccc_bootstrap, cccc_message_reply), and the group ledger got two replies from gemini-1 to the same message (03:43:51Z and 03:44:12Z). agy then switched to the second conversation, which never saw the [CCCC] You are gemini-1 ... system preamble.
When the same actor is restarted later (cccc actor restart gemini-1, agy already idle for a minute before the first delivery), the preamble and the message land in one conversation as expected (input 0 = preamble, input 19 = message after 18 tool steps). So the race is only in the first seconds after launch.
Suggested fix (either):
- for
prompt_assistedruntimes, wait until the TUI shows its prompt (or a fixed grace period after spawn) before the second submission, or - submit the preamble and the first message as one bracketed paste.
2. MCP setup could be direct instead of prompt_assisted
cccc setup --runtime antigravity returns {"mode":"prompt_assisted","status":"requires_action",...} and the daemon asks the model to add the server itself. agy 1.2.2 has:
agy mcp add [flags] <name> <commandOrUrl> [args...] # -e KEY=value, --type stdio|http
agy mcp list
and reads ~/.gemini/config/mcp_config.json ({"mcpServers": {"cccc": {"command": ".../cccc", "args": ["mcp"], "env": {"CCCC_HOME": "..."}}}}). Writing that file (or calling agy mcp add cccc <cccc> mcp -e CCCC_HOME=<home>) before the first launch made agy mcp list show cccc stdio enabled with all 15 cccc_* tools, no model turn needed — the same approach as the Kimi fix in #97. It also removes the first-turn setup prompt, which is what collides with the race above.
3. Note: first-run wizard appears inside the PTY
On a fresh install agy shows an onboarding wizard (colour scheme → Terms of Service / interaction-data opt-in → "Do you trust this folder?") before the prompt. If the actor is added before a human ran agy once, the daemon types the preamble into the wizard. Pre-seeding ~/.gemini/antigravity-cli/settings.json with {"trustedWorkspaces": ["<scope>"]} skips the trust prompt; the ToS step still needs one interactive run. Worth a line in the docs for --runtime antigravity.
Withdrawn by the author; please disregard.
Reopened: the report stands as written (the earlier close was an accident on my side). Happy to test a fix on agy 1.2.2.
Thank you. I'll fix this issue as soon as possible.