You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When Orca starts or reopens a managed Antigravity chat or bot, it sends the agent a few notes: which tools are off, the workspace rules, and the bot's own standing instructions (who it is, its memory, its tools). A bug let the first notes overwrite the last one, so the bot never got its instructions. Now the notes are combined, so the bot gets all of them.
What Changed
Before: managed Antigravity chats and bots silently lost their standing instructions on every session/new and on reopen, even in workspaces with no rules files. In acp-structured-handshake.ts, setup carried ...acpSessionStartMeta(spec, meta) and was spread after_meta: sessionMeta. Managed Antigravity always sets spec.sessionMeta = { antigravity: { disabledTools: ['run_workflow'] } }, so setup._meta always replaced the standing instructions.
After: the agent receives the disabled tools, workspace rules, and standing instructions together.
acpSessionStartMeta (src/main/acp/launch/acp-session-meta.ts) takes ordered layers: spec meta, then workspace rules (resolveSessionMeta), then Orca standing instructions. Later layers still win key by key, and the antigravity key is still merged one level deep. The one special case is antigravity.systemPrompt.append: the Antigravity server reads a single append string, so each layer's append is joined in order with a blank line (workspace rules first, then standing instructions). This is a targeted join, not a generic recursive merge.
acp-structured-handshake.ts no longer spreads _meta from setup. session/new and the reopen (session/resume/session/load) both build _meta through the helper. Reopen adds standing instructions only when sessionMetaOnReopen is set, as before.
The single-argument call in antigravity-sign-in-server.ts is unchanged in behavior.
Why
This fixes the dropped instructions at the one shared helper both handshake calls already use, instead of adding a second merge in the handshake. A generic recursive merge (with prototype-key guards) was considered and dropped: every layer is built inside Orca, and only systemPrompt.append needs combining, so a narrow join is simpler and easier to reason about. Host agy (no spec meta), Grok and Kiro (no _meta in setup) behave as before.
N/A. This changes the JSON _meta payload sent on ACP session/new / session/load, with no renderer or UI change. The behavior evidence (unit test before/after and a live server check) is under Testing.
Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
New test in acp-structured-session-instructions.test.ts checks the exact _meta on session/new and session/load when spec disabledTools, workspace rules and standing instructions are all present. On main it fails (the append is only Workspace rules.); on this branch it passes.
Targeted vitest (macOS): acp-structured-session-instructions, acp-structured-antigravity, and src/main/antigravity pass, except the existing process-spawning tests (posix-hook-invocation, antigravity-browser-helper) that fail locally for an unrelated environment reason (exit 69 from a local toolchain shim) and also fail on main.
Static gates clean on the touched files: oxlint, oxfmt, anti-slop oxlint, code-quality native plugins, ast-grep, and the changed-code quality gate.
Live check on a separate macOS machine against the pinned managed server (agy-acp-server 1.5.2, sha256 matching the pin in antigravity-acp-runtime.ts): session/new with disabledTools plus rules + "\n\n" + instructions was accepted, and the model repeated a marker from each part. This drove the server over raw ACP rather than through a full Orca bot session; the reopen path is covered by the unit test.
Performance
None, because acpSessionStartMeta runs once per ACP session open or reopen in the main process (not a hot path), with no new I/O, subprocesses, timers or polling. Node microbenchmark: typical case 0.034 us (main, instructions dropped) vs 0.67 us; no meta 0.013 vs 0.034 us; adversarial 88KB rules + 200KB instructions 27 us mean, 139 us max. Nothing comes near 16 ms.
Risk
Level: Low
Only _meta construction for ACP session/new, session/load and session/resume changes. The visible effect is that managed Antigravity system prompts now include the standing instructions, so they are longer (more tokens per turn). That is intended: on main those instructions were silently dropped. The workspace-rules part is unchanged (capped near 88KB).
When two layers both carry antigravity.systemPrompt, it is rebuilt as { append } only; no other systemPrompt subkeys exist today.
Back out with a plain revert; no saved data or settings are touched.
Agent skill upstream boundary
Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.
Checklist
This PR is small and focused
I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
I stated the risk: what could break, for whom, and how to back it out
Before/after screenshots or videos attached for UI changes, or N/A with reason
Self-reviewed for correctness, security, and performance
Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)
Original fix by @Nanako0129 in #46368. Their authorship is preserved on the commit.
The session metadata helper now merges multiple optional metadata layers in order. When both layers contain an Antigravity system-prompt append string, the helper joins the strings with a blank line. Structured-session initialization uses the helper for new-session requests and for reopen requests when sessionMetaOnReopen is enabled. Tests check merged metadata in both request types.
Severity of issue fixed: Medium
Merge Risk: Low · up to c796d
Metadata layers can still drop earlier instructions when a later layer holds an undefined entry or shares a nested record. The main case of combining workspace rules with standing instructions works. Fixing the merge helper before merge is a small change.
Pre-merge checks: 4
Check name
Status
Explanation
Linked Issues check
[#46367] requires managed Antigravity standing instructions to reach ACP _meta on session/new, session/load, and session/resume, and requires GEMINI.md/AGENTS.md rules to combine with stan…
Out of Scope Changes check
The supplied whole-PR summary lists three changed files: src/main/acp/launch/acp-session-meta.ts, src/main/acp/session/acp-structured-session-instructions.test.ts, and `src/main/acp/session/start/…
Title check
The title names the main change: ACP session _meta layers are now merged so Antigravity keeps its standing instructions. It matches the raw summary (ordered layer merge in acpSessionStartMeta, handsha…
Description check
The description follows the repository template. It includes ELI5, What Changed, Why, Linked Issue (Fixes #46367), Visual Proof (N/A with reason), Testing with checkboxes, Performance (None, because .…
Full details: Linked Issues check
Explanation
[#46367] requires managed Antigravity standing instructions to reach ACP _meta on session/new, session/load, and session/resume, and requires GEMINI.md/AGENTS.md rules to combine with standing instructions in antigravity.systemPrompt.append.
At reviewed head c796de2, initializeAcpStructuredSession in acp-structured-handshake.ts no longer spreads _meta from setup. setup now holds only authMethodId, authMethodUnavailableMessage, and resumePreference. The new-session and replacement path calls acpSessionStartMeta(spec, meta, sessionMeta). The reopenIn path calls acpSessionStartMeta(spec, meta, reopenMeta), where reopenMeta is set only when launch.sessionMetaOnReopen is true. Grok and Kiro therefore keep non-reopen gating.
At head, acpSessionStartMeta in acp-session-meta.ts merges the layers spec.sessionMeta, meta, and the session layer in order. When two layers both supply string antigravity.systemPrompt.append, it joins them with \n\n. This satisfies the append-combining requirement. The single-argument call in antigravity-sign-in-server.ts remains valid.
Discrepancy: the PR description says the merge is recursive, skips __proto__, constructor, and prototype, and skips undefined values. The head code is a one-level top-level spread plus an antigravity-level merge. It has no prototype-key filter and no undefined filter. The issue does not require these behaviors, so they do not change this verdict. The description overstates the implementation.
The test file was not re-read at head, so the regression tests rest on the PR summary and the author's report. This review did not run tests.
Full details: Out of Scope Changes check
Explanation
The supplied whole-PR summary lists three changed files: src/main/acp/launch/acp-session-meta.ts, src/main/acp/session/acp-structured-session-instructions.test.ts, and src/main/acp/session/start/acp-structured-handshake.ts. All three are ACP session _meta construction or its regression tests, which serve #46367. The head contents of the two source files match this scope.
The incremental diff from previous reviewed head 2616bf3 to c796de2 could not be read. The whole-PR diff also could not be read, so no file list beyond the summary was confirmed. Changes after 2616bf3 are therefore established only through the head file reads and the summary. No unrelated change is demonstrated.
Full details: Title check
Explanation
The title names the main change: ACP session _meta layers are now merged so Antigravity keeps its standing instructions. It matches the raw summary (ordered layer merge in acpSessionStartMeta, handshake no longer overwrites _meta) and the PR objectives. It is 10 words and 80 characters, which is concise. It uses a conventional 'fix(acp):' prefix, which is acceptable.
Full details: Description check
Explanation
The description follows the repository template. It includes ELI5, What Changed, Why, Linked Issue (Fixes #46367), Visual Proof (N/A with reason), Testing with checkboxes, Performance (None, because ...), Risk with level Low and a revert plan, AI Disclosure, the agent skill boundary checkbox, and the Checklist. It explains the before and after behavior and the mechanism in detail. Minor gaps: the template's 'Review' and 'Notes' sections are left as template text or omitted, the 'Level' is stated only in the Risk section, and the final lint/typecheck/test/build checklist item is unchecked. These are non-critical, so the check passes.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Already reviewed the last commit. Use @coderabbitai full review to rerun a review of the entire changeset.
Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.
…nstructions
Managed Antigravity always sets spec.sessionMeta (disabledTools), and the
handshake spread setup._meta after the standing instructions, so bot and chat
standing instructions were silently dropped on session/new and on reopen.
Build _meta for session/new and the reopen through acpSessionStartMeta, which
now takes ordered layers (spec meta, workspace rules, standing instructions).
Later layers win key by key; the antigravity key merges one level deep and
every layer's systemPrompt.append is joined with a blank line, since the
Antigravity server reads a single append string.
Fixesstablyai#46367
Co-authored-by: Neil <[email protected]>
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Data Integrity & Integration · Quick win
Skip undefined entries before applying a layer.
If earlier metadata contains workspace rules and the next layer contains { antigravity: undefined }, this spread removes those rules. The guard on Line 22 then skips append preservation.
Ignore undefined entries instead of assigning them. Add a regression that confirms an undefined entry preserves the earlier value, while a defined later value still takes precedence.
Minor · Data Integrity & Integration · Quick win
Merge nested metadata records recursively.
With spec.sessionMeta = { vendor: { a: 1 } } and a resolved layer { vendor: { b: 2 } }, Line 21 drops a. Line 24 also merges antigravity only shallowly. This violates the PR objective to preserve nested fields through recursive merging.
Merge records recursively. Preserve later-layer precedence for leaves, array replacement, and append concatenation. Add a regression that expects both nested fields.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
When Orca starts or reopens a managed Antigravity chat or bot, it sends the agent a few notes: which tools are off, the workspace rules, and the bot's own standing instructions (who it is, its memory, its tools). A bug let the first notes overwrite the last one, so the bot never got its instructions. Now the notes are combined, so the bot gets all of them.
What Changed
Before: managed Antigravity chats and bots silently lost their standing instructions on every
session/newand on reopen, even in workspaces with no rules files. Inacp-structured-handshake.ts,setupcarried...acpSessionStartMeta(spec, meta)and was spread after_meta: sessionMeta. Managed Antigravity always setsspec.sessionMeta = { antigravity: { disabledTools: ['run_workflow'] } }, sosetup._metaalways replaced the standing instructions.After: the agent receives the disabled tools, workspace rules, and standing instructions together.
acpSessionStartMeta(src/main/acp/launch/acp-session-meta.ts) takes ordered layers: spec meta, then workspace rules (resolveSessionMeta), then Orca standing instructions. Later layers still win key by key, and theantigravitykey is still merged one level deep. The one special case isantigravity.systemPrompt.append: the Antigravity server reads a single append string, so each layer's append is joined in order with a blank line (workspace rules first, then standing instructions). This is a targeted join, not a generic recursive merge.acp-structured-handshake.tsno longer spreads_metafromsetup.session/newand the reopen (session/resume/session/load) both build_metathrough the helper. Reopen adds standing instructions only whensessionMetaOnReopenis set, as before.antigravity-sign-in-server.tsis unchanged in behavior.Why
This fixes the dropped instructions at the one shared helper both handshake calls already use, instead of adding a second merge in the handshake. A generic recursive merge (with prototype-key guards) was considered and dropped: every layer is built inside Orca, and only
systemPrompt.appendneeds combining, so a narrow join is simpler and easier to reason about. Hostagy(no spec meta), Grok and Kiro (no_metainsetup) behave as before.Linked Issue
Fixes #46367
Visual Proof
N/A. This changes the JSON
_metapayload sent on ACPsession/new/session/load, with no renderer or UI change. The behavior evidence (unit test before/after and a live server check) is under Testing.Testing
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Every added test fails without this change and avoids the test anti-patterns
New test in
acp-structured-session-instructions.test.tschecks the exact_metaonsession/newandsession/loadwhen specdisabledTools, workspace rules and standing instructions are all present. On main it fails (the append is onlyWorkspace rules.); on this branch it passes.Targeted vitest (macOS):
acp-structured-session-instructions,acp-structured-antigravity, andsrc/main/antigravitypass, except the existing process-spawning tests (posix-hook-invocation,antigravity-browser-helper) that fail locally for an unrelated environment reason (exit 69 from a local toolchain shim) and also fail on main.Static gates clean on the touched files: oxlint, oxfmt, anti-slop oxlint, code-quality native plugins, ast-grep, and the changed-code quality gate.
Live check on a separate macOS machine against the pinned managed server (agy-acp-server 1.5.2, sha256 matching the pin in
antigravity-acp-runtime.ts):session/newwithdisabledToolsplusrules + "\n\n" + instructionswas accepted, and the model repeated a marker from each part. This drove the server over raw ACP rather than through a full Orca bot session; the reopen path is covered by the unit test.Performance
None, because
acpSessionStartMetaruns once per ACP session open or reopen in the main process (not a hot path), with no new I/O, subprocesses, timers or polling. Node microbenchmark: typical case 0.034 us (main, instructions dropped) vs 0.67 us; no meta 0.013 vs 0.034 us; adversarial 88KB rules + 200KB instructions 27 us mean, 139 us max. Nothing comes near 16 ms.Risk
Level: Low
_metaconstruction for ACPsession/new,session/loadandsession/resumechanges. The visible effect is that managed Antigravity system prompts now include the standing instructions, so they are longer (more tokens per turn). That is intended: on main those instructions were silently dropped. The workspace-rules part is unchanged (capped near 88KB).antigravity.systemPrompt, it is rebuilt as{ append }only; no othersystemPromptsubkeys exist today.Agent skill upstream boundary
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)Original fix by @Nanako0129 in #46368. Their authorship is preserved on the commit.