Skip to content

Add Antigravity (agy) subagent management system via tmux - #304

Draft
dandye wants to merge 2 commits into
gemini_slash_commandsfrom
agy_slash_commands_plus_subagent
Draft

Add Antigravity (agy) subagent management system via tmux#304
dandye wants to merge 2 commits into
gemini_slash_commandsfrom
agy_slash_commands_plus_subagent

Conversation

@dandye

@dandye dandye commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Description

Implements a comprehensive tmux-based subagent orchestration system for Antigravity CLI (agy), superseding and refactoring #146.

Provides both:

  1. Native Antigravity Skill (.agents/skills/subagent/SKILL.md & .gemini/skills/subagent/SKILL.md): Discovered natively by agy as the /subagent slash command with full autocompletion and execution runbooks.
  2. Legacy TOML Command (.gemini/commands/subagent.toml): Refactored to invoke agy for Gemini CLI backwards compatibility.

Key Features

  • spawn: Create new agy subagents in detached tmux sessions with configurable models and initial prompts
  • send: Send messages to running subagents with intelligent handling for:
    • Regular text prompts (literal text with single Enter submission)
    • Shell commands (prefixed with !, single Enter execution)
    • Slash commands (/help, /model, etc.)
  • get-output: Retrieve subagent output with configurable line limits or full history
  • list: View all active subagent sessions in simple or detailed format
  • kill: Cleanly terminate subagent sessions
  • attach: Provides instructions for interactive session attachment
  • status: Debug and monitor subagent health and activity
  • spawn-split: Create subagents in split panes for side-by-side operation (agy -p '...')
  • broadcast: Send messages to multiple subagents simultaneously

Technical Implementation

  • Uses tmux sessions to maintain persistent agy instances that survive main process exits
  • Starts bash shell first, then launches agy to ensure session stability
  • Implements 5-second initialization delay to accommodate agy startup sequence
  • Uses single Enter (C-m) matching agy interactive input submission
  • Uses tmux send-keys with -l flag for literal text to prevent unintended shell interpretation

Closes #146

Implements a comprehensive tmux-based subagent orchestration system that enables
running multiple Antigravity (agy) instances in parallel for complex workflows.

Key features:
- spawn: Create new agy subagents in detached tmux sessions
- send: Send messages to running subagents with intelligent handling of:
  - Regular prompts (literal text with double Enter submission)
  - Shell commands (starting with !, single Enter execution)
  - Slash commands (/help, /model, etc.)
- get-output: Retrieve subagent output with configurable line limits
- list: View all active subagent sessions with simple or detailed format
- kill: Terminate subagent sessions cleanly
- attach: Instructions for interactive session viewing
- status: Debug and monitor subagent health
- spawn-split: Create subagents in split panes
- broadcast: Send messages to multiple subagents simultaneously

Technical implementation:
- Uses tmux sessions to maintain persistent agy instances
- Starts bash shell first, then launches agy to ensure session stability
- 5-second initialization delay to allow agy startup sequence
- Intelligent message routing based on content prefix detection
- Literal text mode (-l flag) for regular prompts to prevent shell interpretation

This enables advanced use cases like parallel research tasks, distributed analysis,
and multi-agent coordination workflows.
@dandye
dandye marked this pull request as draft September 2, 2026 14:16
Enables native Antigravity CLI (/subagent) discovery and autocompletion
in addition to legacy .gemini/commands/subagent.toml.
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.

1 participant