Skip to content

feat(core): add Antigravity to RestorableAgentKind to fix relaunch restore - #4673

Closed
gerfalcon wants to merge 2 commits into
manaflow-ai:mainfrom
gerfalcon:feature/antigravity-session-restore
Closed

gerfalcon wants to merge 2 commits into
manaflow-ai:mainfrom
gerfalcon:feature/antigravity-session-restore

Conversation

@gerfalcon

@gerfalcon gerfalcon commented May 23, 2026 •

Copy link
Copy Markdown

Fixes relaunch/restart restore for Antigravity sessions. Previously, Antigravity sessions were decoded without proper mapping support in RestorableAgentKind.allCases, causing custom registration mismatch errors that aborted relaunch restoration. Adding .antigravity to allCases resolves this fully.


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag @codesmith with what you need. Autofix is disabled.


Summary by cubic

Adds .antigravity to RestorableAgentKind.allCases so Antigravity sessions restore on relaunch. Also removes an obsolete registry-owned comment and fixes decode/registration mismatches when projects override the built‑in Vault registration.

Written for commit cf9845a. Summary will update on new commits. Review in cubic

Summary by CodeRabbit

  • New Features
    • Antigravity agents are now supported and available for restoration.
    • Antigravity will appear in agent selection lists and can be restored through existing restore flows, matching the behavior of other agent types without any changes required to user workflows.

Review Change Stack

@vercel

vercel Bot commented May 23, 2026

Copy link
Copy Markdown

@gerfalcon is attempting to deploy a commit to the Manaflow Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented May 23, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 3f29bff6-94c0-42be-aa80-b3af7829e588

📥 Commits

Reviewing files that changed from the base of the PR and between df7ce05 and cf9845a.

📒 Files selected for processing (1)
  • Sources/RestorableAgentTypes.swift
💤 Files with no reviewable changes (1)
  • Sources/RestorableAgentTypes.swift

📝 Walkthrough

Walkthrough

RestorableAgentKind.allCases enumeration is extended to include the .antigravity case, making it available for agent restoration operations.

Changes

Antigravity agent kind

Layer / File(s) Summary
Add antigravity to restorable agent kinds
Sources/RestorableAgentTypes.swift
The .antigravity case is added to RestorableAgentKind.allCases enumeration.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~1 minute

Poem

I nibble on code, a hop and a cheer,
.antigravity drifts into sight, so clear,
Agents float up, light as a feather,
The rabbit applauds this tiny code tether,
Joy in the loop — up, up we go! 🐰✨

🚥 Pre-merge checks | ✅ 16 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description lacks key sections from the template: Testing details and a Demo Video are missing, and the checklist is not completed. Add Testing section describing how the change was tested locally, and complete the required checklist items to confirm testing and review requests were performed.
✅ Passed checks (16 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: adding Antigravity to RestorableAgentKind and its purpose (fixing relaunch restore).
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Cmux Swift Actor Isolation ✅ Passed PR adds .antigravity to Sendable enum's allCases array. The enum conforms to Codable/Hashable with no MainActor annotations; immutable value type does not introduce actor isolation issues.
Cmux Swift Blocking Runtime ✅ Passed PR adds .antigravity enum case to RestorableAgentKind.allCases with no blocking synchronization patterns (semaphores, waits, sleeps, locks, or main-queue sync) introduced.
Cmux No Hacky Sleeps ✅ Passed Only modified file is Sources/RestorableAgentTypes.swift (Swift), outside scope of rule which covers TypeScript, JavaScript, shell only. Swift sleeps covered by separate swift-blocking-runtime check.
Cmux Swift Concurrency ✅ Passed PR adds .antigravity to RestorableAgentKind.allCases but introduces no legacy async patterns: no DispatchQueue, Combine, completion handlers, or fire-and-forget Tasks detected.
Cmux Swift @Concurrent ✅ Passed PR only adds .antigravity enum case to allCases array; file contains no async functions, @concurrent annotations, or isolation changes.
Cmux Swift File And Package Boundaries ✅ Passed New file RestorableAgentTypes.swift (152 lines) has clear single responsibility defining agent type data structures, no mixed concerns, and appropriately placed in app target.
Cmux Swift Logging ✅ Passed The PR change only removes a comment from RestorableAgentTypes.swift. No logging statements (print, debugPrint, dump, NSLog, Logger) were added or modified.
Cmux User-Facing Error Privacy ✅ Passed The PR adds .antigravity enum case to RestorableAgentKind.allCases with no new user-facing messages. Existing error message is generic and complies with privacy rules.
Cmux Full Internationalization ✅ Passed RestorableAgentTypes.swift adds "antigravity" as internal protocol token (exempt). Antigravity UI strings in Localizable.xcstrings have complete translations across all 20 supported locales.
Cmux Swiftui State Layout ✅ Passed PR contains no SwiftUI components or state management patterns. RestorableAgentTypes.swift is a Foundation-only data model (enum/struct) with a simple enum case addition to allCases array.
Cmux Architecture Rethink ✅ Passed Small correctness fix adding .antigravity to RestorableAgentKind.allCases enum. No timing repairs, blocking paths, mutable state, or lifecycle fragmentation introduced.
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed PR adds .antigravity to RestorableAgentKind.allCases for session restoration; file contains no window creation or management code.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@greptile-apps

greptile-apps Bot commented May 23, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds .antigravity to RestorableAgentKind.allCases, which was accidentally omitted. This omission caused isReservedID to return false for "antigravity", allowing project configs to register a competing "antigravity" agent and letting the hook-store restoration loop treat built-in Antigravity as .custom(\"antigravity\") — diverging from stored snapshots and aborting relaunch restoration.

  • .antigravity is added to allCases at the correct position; the native case .antigravity resume-command arm (fallbackExecutable: \"agy\", --conversation) already matches the built-in registration, so relaunch output is identical.
  • The now-incorrect exclusion comment is removed, though the adjacent Pi/Grok comment still uses identical phrasing for the opposite intent (previously flagged in a separate thread).
  • A small follow-up cleanup opportunity exists in RestorableAgentSession.swift: the customRegistration.id == CmuxVaultAgentRegistration.builtInAntigravity.id branch is now unreachable because isReservedID(\"antigravity\") blocks project-config overrides and builtInAntigravity is filtered from hookKinds.

Confidence Score: 5/5

Safe to merge — one-line addition to a well-guarded list with an existing native resume-command arm already handling the kind correctly.

The change is a single-case addition to a static array. The .antigravity resume-command arm in RestorableAgentSession.swift was already present and correct, isReservedID now correctly prevents config overrides, and the hook-store restoration path no longer diverges. No production behavior regresses.

Sources/RestorableAgentSession.swift has a now-unreachable branch at the Antigravity custom-registration check; worth cleaning up but it poses no runtime risk.

Important Files Changed

Filename Overview
Sources/RestorableAgentTypes.swift Adds .antigravity to allCases and removes the incorrect exclusion comment; the change is minimal and correct — the native .antigravity switch arm in the resume-command builder already handles the kind, and isReservedID now blocks project-config override of this ID as intended.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Session Relaunch] --> B[Build hookKinds]
    B --> C{allCases has antigravity?}
    C -- Before fix NO --> D[builtInAntigravity in registry]
    D --> E[Not in builtInKindIDs]
    E --> F[Added as custom antigravity to hookKinds]
    F --> G[Custom branch: builtInAntigravity.id check]
    G --> H{Project config also registers antigravity?}
    H -- YES --> I[Duplicate mismatch - relaunch aborted]
    H -- NO --> J[Restored OK]
    C -- After fix YES --> K[antigravity in builtInKindIDs]
    K --> L[builtInAntigravity filtered from hookKinds]
    L --> M[.antigravity from allCases with nil registration]
    M --> N[switch case .antigravity]
    N --> O[Restore with fallbackExecutable agy and --conversation flag]
    O --> P[Always restored correctly]
Loading

Reviews (2): Last reviewed commit: "chore(core): remove obsolete registry-ow..." | Re-trigger Greptile

Comment thread Sources/RestorableAgentTypes.swift Outdated
Comment on lines +29 to +31
// Antigravity is registry-owned so the built-in Vault registration can be
// overridden by project config while direct .antigravity values still encode.
.antigravity,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Misleading comment mirrors Pi/Grok exclusion language

The comment above .antigravity ("registry-owned so the built-in Vault registration can be overridden…") uses word-for-word the same phrasing as the Pi/Grok comment on lines 24–25, which explains why those cases are absent from allCases. Here the comment is attached to a case that is present, making the two blocks read as equivalent when they express opposite intent. A future maintainer auditing "registry-owned" cases could reasonably conclude that .antigravity should be removed for the same reason Pi and Grok were excluded, reintroducing this regression. The comment should explicitly distinguish whether the case is included or omitted and, for the Pi/Grok block, name the cases that were left out.

Rule Used: Flag Swift fixes that patch symptoms while leaving... (source)

@teamleaderleo

Copy link
Copy Markdown
Collaborator

Thanks for this! Antigravity sessions restore on relaunch (routed through the hook registry instead) landed on main in #12151. You opened this first, so you got there first. Closing since main covers it now.

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.

2 participants