Skip to main content
Glama
session-bridge
by Mahyardana

omp-agy-bridge

Bidirectional session bridge between oh-my-pi (omp) and Google Antigravity CLI (agy).

Move seamlessly back and forth between omp and agy without losing conversation context, tool history, or workspace continuity — via CLI, MCP server, or built-in Agent Skills.

  • Zero dependencies — pure Python 3 standard library (bridge.py + stdio JSON-RPC 2.0 mcp_server.py).

  • Native AGY → OMP conversion — writes genuine, resumable OMP v3 .jsonl session trees directly into ~/.omp/agent/sessions/<encoded-cwd>/ so omp -r <id> opens the full history natively with 1:1 toolCall/toolResult pairing and automatic default-model restoration.

  • Smart OMP → AGY handoff — walks OMP's branched id/parentId tree, respects compaction summaries and context_edit pruning, fits massive multi-megabyte sessions cleanly within a configurable character budget, archives the complete verbatim transcript on disk, and either injects directly into your active agy session via MCP or launches/creates a saved agy conversation.

  • Sandbox-friendly — running as a host stdio MCP server lets both agy and omp read each other's session stores seamlessly across any workspace.


Architecture

flowchart LR
    OMP["oh-my-pi (omp)<br/>~/.omp/agent/sessions/*.jsonl"]
    AGY["Antigravity CLI (agy)<br/>~/.gemini/antigravity-cli/"]

    subgraph Bridge["omp-agy-bridge (Pure Python 3 Stdlib)"]
        CORE["bridge.py<br/>Tree Parser • Compaction-Aware Formatter<br/>Native OMP v3 Writer • AGY API/CLI Seeder"]
        CLI["CLI: omp-agy"]
        MCP["Stdio MCP Server: session-bridge<br/>(6 tools, JSON-RPC 2.0)"]
        SKILLS["Agent Skills<br/>AGY + OMP SKILL.md"]
    end

    OMP <--> CORE
    AGY <--> CORE
    CLI --> CORE
    MCP --> CORE
    SKILLS -.guides.-> MCP

Related MCP server: Antigravity MCP Server

Quickstart

git clone https://github.com/Mahyardana/omp-agy-bridge.git
cd omp-agy-bridge
./install.sh

install.sh automatically:

  1. Installs the core modules to ~/.local/share/omp-agy-bridge/

  2. Installs omp-agy and omp-agy-mcp to ~/.local/bin/

  3. Registers the session-bridge MCP server in both AGY (~/.gemini/config/mcp_config.json) and OMP (~/.omp/agent/mcp.json)

  4. Installs the session-bridge skill in both AGY (~/.gemini/config/skills/) and OMP (~/.omp/agent/skills/)

Restart agy / omp so they pick up the new MCP server and skills.

Alternative (pip / uv): You can also install the Python package via pip install -e . (or uv tool install .), which exposes the omp-agy and omp-agy-mcp console entrypoints.


Usage

1. Inside agy or omp (Natural Language via MCP + Skill)

Just talk to either agent:

  • In agy:

    • "Import my latest omp session"

    • "List my omp sessions for this repo and import the most recent one"

    • "Export this conversation to omp"

  • In omp:

    • "Import my latest agy session"

    • "Convert my latest agy conversation into a native omp session"

    • "Export this session to agy"

2. Terminal CLI (omp-agy)

# List recent sessions across both tools (filter by source, workspace, or keyword)
omp-agy list
omp-agy list --source omp --cwd .
omp-agy list --query auth --limit 10

# Preview turns from any session
omp-agy show omp latest --start 0 --limit 10
omp-agy show agy latest --no-tools

# AGY -> OMP (writes a native resumable OMP v3 .jsonl session)
omp-agy agy2omp latest --open                    # Convert & immediately launch `omp -r <id>`
omp-agy agy2omp <id-prefix> --mode full          # Full native toolCall/toolResult history (default)
omp-agy agy2omp <id-prefix> --mode compact       # Merges tool actions into compact turn summaries
omp-agy agy2omp <id-prefix> --mode conversation  # Pure user/assistant text turns only

# OMP -> AGY
omp-agy omp2agy latest --open                    # Immediately open interactive `agy -i` in workspace
omp-agy omp2agy latest --create                  # Create a saved AGY conversation for `agy -r <id>`
omp-agy omp2agy latest --file-only               # Write handoff + full verbatim markdown archive only

3. MCP Tools Exposed (session-bridge)

Tool

Description

list_sessions

List omp, agy, or all sessions newest-first with IDs, titles, workspaces, timestamps, and sizes.

import_omp_session

Load an OMP session directly into the active conversation (compaction-aware, budget-capped, with full verbatim archive on disk).

import_agy_session

Load an AGY conversation directly into the active conversation.

export_agy_to_omp

Convert an AGY conversation into a native resumable OMP v3 .jsonl session and return omp -r <id>.

export_omp_to_agy

Export an OMP session into AGY (creates a saved conversation via ConversationService or agy -p, or writes a handoff file).

read_session_turns

Paginate message-by-message through any omp or agy session (ideal for inspecting earlier turns of huge sessions).


How It Works Under the Hood

AGY → OMP (Native Session Tree Writer)

  • Reads AGY metadata (title, workspace_uris, step_count) from ~/.gemini/antigravity-cli/conversation_summaries.db (read-only) and turns from brain/<id>/.system_generated/logs/transcript_full.jsonl.

  • Strips internal AGY metadata wrappers (<ADDITIONAL_METADATA>, <USER_SETTINGS_CHANGE>, system efficiency nudges) while preserving user requests, assistant responses, thinking blocks, and tool executions.

  • Maps AGY tools (run_command, read_file, write_file, edit_file, search_web) to OMP equivalents (bash, read, write, edit, web_search) and guarantees strict 1:1 toolCall ↔ toolResult pairing.

  • Detects your default OMP model from ~/.omp/agent/config.yml (modelRoles.default) and emits model_change entries so omp -r <id> restores cleanly without SessionModelRestoreError.

  • Encodes the workspace cwd using OMP's directory bucketing convention (reusing existing matching session folders when present) and writes the .jsonl atomically.

OMP → AGY (Compaction-Aware Handoff + Archive)

  • Walks OMP's id/parentId tree along the active branch, respecting compaction boundaries and context_edit deletions.

  • Always saves the complete verbatim markdown transcript to ~/.local/share/omp-agy-bridge/exports/ so nothing is ever lost.

  • Produces a budget-aware handoff (preserving compaction summaries/initial goals + as many recent turns verbatim as fit within max_chars), usable directly in your current AGY session via MCP, launched interactively with agy -i, or seeded into a saved AGY conversation via ConversationService / agy -p.


Running Tests

python3 -m unittest discover -s tests -v

Uninstall

./uninstall.sh

License

MIT

Available Tools

6 tools
export_agy_to_ompA

Convert an Antigravity (agy) conversation into a NATIVE resumable oh-my-pi (omp) v3 .jsonl session file under ~/.omp/agent/sessions// so you can immediately resume it with omp -r <id> or omp -c.

Inputs: cwd, mode, title, session, +2 more.

export_omp_to_agyA

Export an oh-my-pi (omp) session into Antigravity (agy). Saves a full verbatim transcript archive and handoff file, and optionally creates a new saved AGY conversation immediately resumable via agy -r <id>.

Inputs: cwd, model, session, max_chars, +3 more.

import_agy_sessionA

Import an Antigravity (agy) conversation into the CURRENT conversation context (ideal when running inside omp). Reads the AGY transcript, formats a clean handoff transcript within the char budget, and archives the complete verbatim transcript on disk.

Inputs: cwd, session, max_chars, include_tools, +1 more.

import_omp_sessionA

Import an oh-my-pi (omp) session into the CURRENT conversation context (ideal when running inside agy). Reconstructs the active branch (respecting omp compaction summaries), formats a clean handoff transcript within the char budget, and archives the complete verbatim transcript on disk for on-demand lookup.

Inputs: cwd, session, max_chars, include_tools, +2 more.

list_sessionsA

List saved coding agent sessions from oh-my-pi (omp) and/or Antigravity (agy), newest first, with session IDs, titles, workspace paths, timestamps, and sizes.

Inputs: cwd, limit, query, source.

read_session_turnsA

Paginate through any omp or agy session message-by-message (useful for inspecting earlier middle turns of very large sessions without overwhelming context).

Inputs: source (required), cwd, limit, session, +4 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 6 tools

    Disambiguation4/5

    Each tool maps to a distinct operation (list, import, export, paginate) and the import/export tools encode source and direction explicitly in their names, so selection is largely unambiguous. The only soft spot is import_agy_session vs export_agy_to_omp, which both move agy content but into different destinations (context vs native omp file) and require reading descriptions to separate.

    Naming Consistency5/5

    All tools are snake_case and verb-first (list_, import_, export_, read_) with the same noun vocabulary (session/sessions, omp, agy). The source/target suffixes are applied symmetrically, making the pairs predictable.

    Tool Count5/5

    Six tools is well-scoped for a session bridge: enumerate, read, import each direction, export each direction. Every tool covers a distinct quadrant of the matrix with no filler.

    Completeness4/5

    The list/read/import/export matrix across both omp and agy is covered, including pagination for large sessions. Minor gaps remain: no search or filter of sessions by keyword/workspace, and no way to manage, prune, or delete the archived verbatim transcripts written to disk.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables Codex users to delegate engineering, refactoring, auditing, and test execution tasks to Google Antigravity CLI as a persistent autonomous subagent, with tools for managing sessions and running prompts.
      1
      MIT
    • A
      license
      B
      quality
      C
      maintenance
      Enables MCP clients such as Claude Code and Cursor to delegate long multi-step coding tasks to Google Antigravity CLI, generate read-only plans and code reviews, digest large codebases, and manage background sessions in isolated git worktrees.
      15
      152 npm
      2
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables orchestration of Google Antigravity agents and CLI sessions by spawning, steering, listing, inspecting transcripts of, and archiving multiple child chat sessions across projects and GitHub issues.
      5
      Apache 2.0
    • A
      license
      B
      quality
      B
      maintenance
      Enables persistent, lossless local session memory for Google Antigravity by preserving compaction context, Q&A continuity, and verified file paths, while exposing searchable SQLite FTS5 memory and transcript tools. It provides eight MCP tools for pinning decisions, searching sessions and transcripts, and checking memory status.
      8
      MIT