Repository navigation
feat(acp): pause an agent's chat starts while its shared sign-in changes - #28649
Conversation
|
Antigravity chats on one machine share a sign-in, and a chat left running during an account change can write the old sign-in back over the replacement. This PR prepares coordination on the machine running the chats for the later sign-in/sign-out service; ordinary launches retain the parent branch’s behavior. The existing account-change refusal now names the agent instead of always saying Claude. Three review rounds fixed two cancellation gaps and the adapter’s line-limit failure. Cancelled starts now finish before the stop pass, so it can include a failed startup whose child remains unproven; a failed stop prevents credential changes. Cancellation also reaches the download and extraction needed to start the agent. The final architecture challenger recommends keeping this design, with no new findings in round 3. Deferred by decision: an interrupted start retains the existing generic retry notice. The follow-on service must use this gate on the machine running the chats and stop every live or exit-unproven child before changing the sign-in. Verified at Performance was checked by source tracing; real download latency and resource release were not measured. Electron QA is N/A here because no production action invokes the gate yet; real Google sign-in and the complete account-change flow remain for later layers. No merge was performed. |
7e7d134 to
7ebb0e6
Compare
4159587 to
ca8e56c
Compare
440b90c to
4a5db36
Compare
ca8e56c to
ee10e46
Compare
4a5db36 to
e15c614
Compare
ee10e46 to
4b39783
Compare
e15c614 to
e10a8d3
Compare
4b39783 to
fc33561
Compare
e10a8d3 to
5fc77e8
Compare
fc33561 to
818bcd7
Compare
5fc77e8 to
4fb4eee
Compare
818bcd7 to
7d8ef22
Compare
4fb4eee to
f95fef4
Compare
7d8ef22 to
04764b5
Compare
f95fef4 to
9d3ee05
Compare
daefbcf to
064c106
Compare
9d3ee05 to
52d774d
Compare
064c106 to
bebf41f
Compare
52d774d to
de5a9bd
Compare
bebf41f to
a6c8f1b
Compare
de5a9bd to
e4dae50
Compare
42e9190 to
eb5dad0
Compare
750cc0c to
04aef4a
Compare
e1b9998 to
d835ff5
Compare
04aef4a to
7cd1f08
Compare
d835ff5 to
9279d44
Compare
7cd1f08 to
31f362d
Compare
9279d44 to
7daa2df
Compare
31f362d to
5b50791
Compare
7daa2df to
77522ea
Compare
6dfdeaf to
8799595
Compare
77522ea to
530ba93
Compare
8799595 to
5abca6a
Compare
0026945 to
38174cc
Compare
f0862ad to
a4510cc
Compare
38174cc to
a0e0094
Compare
a4510cc to
62784fe
Compare
…n-in A launch spec can carry a gate that refuses new chat starts while an operation replaces or removes the sign-in all of that agent's chats share on this host, and aborts starts already under way when one begins. Antigravity's row sets it. The refusal reuses the accountSwitchInProgress reason, now worded for any agent.
…xits, so an operation can't run beside a chat still starting A start leaves the gate when its child is up, but the host only lists the chat as loaded once its attach finishes. A sign-in switch (and later Remove) in that window found no start to abort and no loaded chat to stop. The gate now keeps each admitted child until it exits, and an operation closes and proves gone any it still holds after the loaded chats stopped; otherwise it fails without running.
…e the agent Keeps agent-session-failure-words.ts under its line limit now that main grew it; the five sentences read the same.
…ign-in change like a chat start
a0e0094 to
e62721d
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: ⚪ Minimal · up to
|
ELI5
Antigravity chats need Google's separate Antigravity chat server. An earlier version of this stack downloaded it silently the first time a chat started: about 18 seconds of "Working for Ns" with no progress and no Cancel, and every extra chat opened started another download. Now nothing downloads until the person clicks Install, which shows the size, progress and Cancel in Settings and in the new chat, and Settings can also remove the download again.
All Antigravity chats on one machine share one Google sign-in and one installed server. If a chat keeps running while you sign in to another account, the server can quietly save the old sign-in back over the new one. If it keeps running while the server is removed, it runs files that are being deleted. This PR adds a short pause around those changes: while one runs, new Antigravity chats are refused with a clear message, chats still starting are cancelled, and every server process is proven stopped before the change begins.
What Changed
This revision: the gate missed one way the server starts. When a chat is opened in the agent's own terminal program, Orca first has the server save a copy of the conversation, and that copy started the server with the shared sign-in folder outside the gate, so a sign-in change could run while that server still held the old sign-in. Conversation copies now enter the gate like a chat start, and the gate holds each copy's server until it exits. This was in #29139 before; it moved here so this PR covers every process it claims to on its own.
AcpLaunchGate). It lives in memory only and always releases when the operation ends.accountSwitchInProgressreason).Why
The Antigravity server writes its sign-in back to its folder every time it refreshes it, so a chat left running would undo a sign-in. A chat left running during Remove would run deleted files. Stopping every process before the change, and refusing new starts while it runs, closes both windows with one fence instead of a lock per operation. Like the common pattern, every path that starts this agent goes through it. Holding each started process until it exits, rather than trusting the list of loaded chats, covers the gap between a start and its attach. Reusing the existing account-change refusal keeps one message for one situation, and older paired Orca versions already understand that reason.
Linked Issue
N/A (maintainer; part of the Antigravity Chat UI stack).
Visual Proof
N/A: nothing triggers the gate until #28650 (sign-in) or #29139 (Remove). The message change is copy only.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Through the existing adapter rig: a start under way when an operation begins is aborted before the operation's work runs, a new start during the operation is refused with the account-changing reason, and an operation whose chat stop fails never runs its work. It fails without the adapter hook.
An operation started while a chat has started but is not yet loaded stops that chat's process before the work runs.
pnpm tc:node,pnpm tc:weband the ACP and runtime tests passed.Review
Agent skill upstream boundary
Notes
Differences from the common pattern
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)