← Back to Workflow
Hidden

Switch to Other

Switches the active AI engine to whichever engine is not currently running.

Switch to Other Engine (Relative Toggle)

[!IMPORTANT] This workflow triggers the handover to the opposing engine.

[!WARNING] INVOCATION GATE: Do NOT execute this workflow on your own initiative. It may ONLY be invoked in two cases: (1) another workflow's step explicitly references it (e.g., "Execute the steps in the switch-to-other workflow"), or (2) the user explicitly types switch-to-other workflow or equivalent. If the user casually says "have Claude review this" or "switch to Gemini," do NOT auto-invoke this workflow — the user will switch manually. When in doubt, ask.

[!CAUTION] The automated engine switch requires the Antigravity UI to be visible and in the foreground. ā—šŸ”“ Make absolutely SURE that NO other Antigravity windows (such as Agent Manager or other workspaces) are open, or the switch sequence WILL misfire. šŸ”“ā— If the window is hidden behind Chrome or minimized, the automation script will fail. Do not click away during the handover!

  1. Identify current engine: Check if a USER_SETTINGS_CHANGE appeared earlier in this conversation to determine your current engine. If none exists, check your self-knowledge (training identity). If still uncertain, ask the user.
  2. Identify Target: If you are Gemini (either Gemini 3.1 Pro (High) or Gemini 3.5 Flash (High)), the target is "Claude Opus 4.6 (Thinking)". If you are Claude, the target is "Gemini 3.1 Pro (High)".
  3. Verify CDP debugging port: Execute python switch_to_other.py --check synchronously.
    • If the port check succeeds (exit code 0):
      • Play audio alert: Run python audio_alert.py "Switching engine".
      • Run CDP switch script (Background): Execute python switch_to_other.py "[TARGET]" with WaitMsBeforeAsync=5 to send it to the background.
      • End Turn immediately: Directly print the following safety warning and "Switching engines..." message to the chat screen: "\n\nā—šŸ”“ Make absolutely SURE that NO other Antigravity windows (such as Agent Manager or other workspaces) are open, or the switch sequence WILL misfire. šŸ”“ā—\n\nSwitching engines..." (Do NOT wait for the python script). The script will instantly pause the auto-clicker via the __switchHandoverActive flag, wait 15 seconds for the UI to finish syncing files, switch the engine, send a resume prompt, and unpause the auto-clicker.
    • If the port check fails (exit code 1):
      • Directly print the manual instruction alert: 🚨 CDP Debugging Port Offline — Manual Switch Required 🚨 "I cannot switch the model automatically because the IDE's remote debugging port is offline. Please manually switch the model to [TARGET] in the top-right model selector dropdown of the IDE, type a message (e.g. 'resume'), and click send to continue the workflow under the new engine."
      • End Turn immediately (do NOT run the background script).

I. New Engine Wakes Up — Verification via Metadata

  1. Check for USER_SETTINGS_CHANGE: When the new engine wakes up from the auto-resume message, its very first action is to check whether a USER_SETTINGS_CHANGE block was injected into the metadata of the message it just received.
    • Present → The switch succeeded. Proceed immediately to assigned tasks within the parent workflow.
    • Absent → The direct switch failed (likely because you were already on the target model). Retry with trampoline: Run python switch_to_other.py "[TARGET]" --trampoline with WaitMsBeforeAsync=5 to send it to the background. The trampoline will first hop to Gemini 3 Flash (sending a "." to commit the change), wait for Flash to finish, then switch to the actual target. Print the same safety warning and "Switching engines..." message, then end your turn.
  2. Second verification: When the engine wakes up again after the trampoline retry, check for USER_SETTINGS_CHANGE again.
    • Present → The switch succeeded. Proceed immediately to assigned tasks.
    • Absent → The switch failed twice. Stop all work, run python audio_alert.py "Engine switch failed", and warn the user that the engine switch failed.

This is used in: