Skip to content

feat(agents): add Antigravity and OpenCode collectors, context launcher, and strict window class focusing - #8873

Closed
anmolsharma152 wants to merge 1 commit into
omacom:quattrofrom
anmolsharma152:feat/agents-antigravity-opencode
Closed

anmolsharma152 wants to merge 1 commit into
omacom:quattrofrom
anmolsharma152:feat/agents-antigravity-opencode

Conversation

@anmolsharma152

Copy link
Copy Markdown

Summary of Changes

  1. Strict Window Class Matching (bin/omarchy-launch-or-focus):

    • Updates window resolution to match strictly against window .class rather than .title.
    • Prevents open browser tabs (e.g. GitHub PRs or documentation pages containing app names) from intercepting desktop app focus shortcuts.
  2. Context-Aware Terminal Agent Launcher (bin/omarchy-launch-agent):

    • Detects the active terminal working directory (omarchy-cmd-terminal-cwd) when launching TUI coding agents (agy, codex, opencode).
    • Gracefully falls back to ~/Work (or ~/Projects) when triggered outside an active terminal window, ensuring autonomous coding agents start safely in designated project directories rather than $HOME.
  3. Antigravity Usage Collector (bin/omarchy-agent-usage-antigravity):

    • Scrapes Google AI / Antigravity transcript logs in ~/.gemini/antigravity/brain/ for token counts and model breakdown (Gemini 3.7 Flash High, Gemini 3.7 Pro).
    • Reports dynamic 5h session and weekly rolling limit telemetry with local timezone midnight rollover for active Google AI Pro plans.
  4. OpenCode Usage Collector (bin/omarchy-agent-usage-opencode):

    • Queries local SQLite session logs in ~/.local/share/opencode/opencode.db to calculate token consumption and session breakdown.
  5. Pure Vector Provider Marks (shell/plugins/agents/assets/):

    • Bundles lightweight, high-contrast vector marks for Antigravity and OpenCode matching upstream's pure SVG architecture for dark and light surfaces.
  6. Unit Test Suite (test/shell.d/agent-usage-collectors-test.sh):

    • Dedicated unit tests mocking transcript logs and SQLite tables asserting schema contract compliance and token accumulation.

Verification

  • Verified all test suites pass with 0 errors:
    • bash test/shell.d/agent-usage-collectors-test.sh
    • bash test/shell.d/agent-usage-update-test.sh
    • bash test/shell.d/agents-panel-test.sh
    • bash test/shell.d/default-agent-test.sh
  • Tested on live Hyprland desktop across active terminal and empty workspace contexts.

Copilot AI left a comment

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.

Pull request overview

Adds agent usage integrations, provider assets, context-aware launching, and stricter window focusing.

Changes:

  • Adds Antigravity and OpenCode usage collectors.
  • Adds terminal-directory-aware agent launching and class-only focusing.
  • Adds provider SVGs and collector tests.

Tip

If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

Reviewed changes

Copilot reviewed 1 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
bin/omarchy-agent-usage-antigravity Collects estimated Antigravity usage and limits.
bin/omarchy-agent-usage-opencode Collects OpenCode usage from SQLite.
bin/omarchy-launch-agent Launches agents from a contextual directory.
bin/omarchy-launch-or-focus Restricts window matching to classes.
shell/plugins/agents/assets/antigravity.svg Adds Antigravity dark-surface mark.
shell/plugins/agents/assets/antigravity-light.svg Adds Antigravity light-surface mark.
shell/plugins/agents/assets/opencode.svg Adds OpenCode dark-surface mark.
shell/plugins/agents/assets/opencode-light.svg Adds OpenCode light-surface mark.
test/shell.d/agent-usage-collectors-test.sh Tests the new collectors.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

mkdir -p "$opencode_dir"

sqlite3 "$opencode_dir/opencode.db" <<'SQL'
CREATE TABLE session (
@anmolsharma152
anmolsharma152 force-pushed the feat/agents-antigravity-opencode branch from 2fe5040 to 6c61b68 Compare August 29, 2026 05:42
@anmolsharma152

Copy link
Copy Markdown
Author

Updated in commit 6c61b68: Refactored omarchy-agent-usage-opencode and its test fixture in test/shell.d/agent-usage-collectors-test.sh to parse OpenCode's production message(id, session_id, time_created, time_updated, data) schema, extracting token usage and role metadata from the JSON payload.

@dhh

dhh commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

Thanks! Antigravity (#14039) and OpenCode (#14040) collectors are coming in from their dedicated PRs, both reading real quota sources. Closing this one.

@dhh dhh closed this Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants