Repository navigation
feat(resume): reopen Antigravity CLI (agy) conversations per tab - #307
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 711a22e6c6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // quitting wmux kills the shell rather than returning to it, but keep | ||
| // the same refusal every other release has. | ||
| if (cleared && !isQuitting) { | ||
| releaseAgyAtPrompt(surfaceId as SurfaceId, ran?.source === 'command' && ran.kind === 'agy'); |
There was a problem hiding this comment.
Track agy exits in every supported shell
In a Command Prompt pane, src/shell-integration/wmux-cmd-integration.cmd explicitly has no preexec/precmd hook and never emits report_shell_state, so this call is never reached and every reported agy conversation survives a normal return to the cmd prompt. The fallback for a resumed conversation exited before its first model call is also ineffective on Bash/WSL because _wmux_report_command accepts only ssh|ssh.exe, so ran cannot have source === 'command' for agy. A later save therefore retains agySessionId, causing the next restore to relaunch a conversation the user explicitly quit; wire release tracking to signals these shells actually emit or add an agy command report.
Useful? React with 👍 / 👎.
| const script = readOrNull(path.join(dir, HOOK_SCRIPT)); | ||
| if (script !== null) return isWmuxPluginFile(script); | ||
| try { return fs.readdirSync(dir).length === 0; } catch { return true; } |
There was a problem hiding this comment.
Recognize partial agy plugin installs
If installation is interrupted or a later synchronous write fails after plugin.json or hooks.json is created but before wmux-agy-hook.cjs, this function sees no script and a nonempty directory and returns false. ensureAgyPlugin then permanently classifies its own partial install as foreign, while removeAgyPlugin also refuses it, potentially leaving agy to invoke a missing hook script on every event. Recognize the exact partial files or use a separate ownership marker so the next launch can complete or clean the install.
Useful? React with 👍 / 👎.
711a22e to
36c149a
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Rebased onto 2.29.0 (on top of the rebased #306) and adapted to #303. agy is now a |
Opt-in "Resume Antigravity CLI conversations on restore", beside Claude (amirlehmam#186), Codex (amirlehmam#261) and OpenCode (amirlehmam#290): a restored tab types `agy --conversation <id>`. The id comes from a plugin of wmux's own, ~/.gemini/config/plugins/wmux/ (plugin.json, hooks.json, wmux-agy-hook.cjs), installed under the Status hooks consent and only where ~/.gemini/antigravity-cli exists. Its hooks read `conversationId` from agy's payload and send `pane.report_agent_session` with `provider: 'agy'`: - SessionStart for a new conversation; - PreInvocation (first model call of a turn), because SessionStart does not fire for `--conversation` and a resumed conversation's first sign of life is its first message. They always answer `{}`, which agy requires. Commands are a bare `node wmux-agy-hook.cjs <Event>`: agy runs a hook from its hooks.json folder, and on Windows hands a quoted argument to node with the quotes still on. agy has no session-end hook, so its exit is the shell returning to its prompt. `releaseAgyAtPrompt` drops an agy handle there, or, when the command that ended was `agy` but it never reported, the id restored into the tab. It never touches another provider's session, and is refused for an out-of-sequence prompt report (AgentIdentityTracker.clearReported now says whether it applied) and while wmux quits. `agy` is also a known agent kind now. Verified live with agy 1.4.1 on Windows: the plugin is discovered from ~/.gemini/config/plugins/, a new conversation reports at SessionStart and PreInvocation, a `--conversation` resume reports at PreInvocation, and the payload carries the pane's WMUX_SURFACE_ID. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
36c149a to
de34589
Compare
|
Merged, thank you. Antigravity is now the fourth resumable agent, opt-in, in 2.30.0. Since #306 was squashed first, I rebased this branch onto master (one commit) before merging. Two non-blocking follow-ups from the bot review, if you want to pick them up:
|
wmux restores the conversations of Claude (#186), Codex (#261) and OpenCode (#290), each in the tab it was in. Tabs running the Antigravity CLI (
agy) came back as bare shells. This adds agy as a fourth provider, behind a new opt-in setting, "Resume Antigravity CLI conversations on restore" (default off). A restored tab typesagy --conversation <id>.Stacked on #306. That PR moves Claude onto the shared provider lookup that this one extends, so its commit appears here until it merges.
Capturing the id
agy has hooks, but it has no
--resume-style handshake with wmux. wmux therefore installs a plugin of its own,~/.gemini/config/plugins/wmux/, made of three files:plugin.json,hooks.jsonandwmux-agy-hook.cjs.~/.gemini/config/hooks.json. Removal deletes only files wmux recognises, through the samewmux-plugin-versionmarker the other plugins carry.~/.gemini/antigravity-cliexists (wmux modifies global claude settings without permission and/or warning #132).conversationIdfrom agy's stdin payload and sendspane.report_agent_sessionwithprovider: 'agy', validated as a UUID at the plugin, in main and in the renderer.SessionStartfires for a new conversation, but not for--conversation <id>;PreInvocationfires before each model call, and onlyinvocationNum0 is reported. That makes a resumed conversation known at its first message.{}, since agy requires a JSON object on stdout. It never blocks longer than one bounded pipe round trip.node wmux-agy-hook.cjs <Event>. agy runs a hook from the folder holding its hooks.json, and on Windows passes a quoted argument to node with the quotes still on. With an absolute path, which has to be quoted as soon as it contains a space, node fails withCannot find module '<dir>\"C:\...\x.js"'.Releasing it
agy has no session-end hook, so its exit is taken to be the shell returning to its prompt (
report_shell_state).releaseAgyAtPromptthen drops the pane's agy handle. It never touches another provider's session, and it is skipped for an out-of-sequence prompt report:AgentIdentityTracker.clearReportednow returns whether it applied. Like every other release, it is refused while wmux quits.A resumed agy that is quit before its first message never reported. Where the shell reports the command it ran (bash, WSL), the restored id is still dropped. The PowerShell integration reports
sshonly, so in pwsh that tab keeps its id and the conversation reopens on the next restore. That is the safe direction to fail in.agyis also added toAGENT_ALIASES.Verified live (agy 1.4.1, Windows 11, inside a wmux pane)
~/.gemini/config/plugins/and loads with no hook errors in agy's log.SessionStartandPreInvocation, with the pane's ownWMUX_SURFACE_IDand the same id agy prints asconversation_id.agy --conversation <id>reports atPreInvocation, andSessionStartdoes not fire.WMUX,WMUX_SURFACE_ID,WMUX_PIPEandWMUX_PIPE_TOKEN.Tests
agy-resume.test.ts:agyis identified as an agent.agy-context.test.ts:plugins/wmuxis left alone;{}and touches no pipe.npm run typecheckandnpm run verify:resourcespass. ESLint shows no new findings on the changed files; the 3no-emptyerrors inuseTerminal.tsare already on master.--maxWorkers=2: 4,789 passed, 0 failed, 14 skipped.🤖 Generated with Claude Code