Skip to content

fix(server): clear Gemini Monitoring when turn finishes - #12715

Closed
macodev00 wants to merge 9 commits into
pingdotgg:mainfrom
macodev00:cursor/fix-gemini-monitoring-507e
Closed

macodev00 wants to merge 9 commits into
pingdotgg:mainfrom
macodev00:cursor/fix-gemini-monitoring-507e

Conversation

@macodev00

@macodev00 macodev00 commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

What

  • Stop promoting leftover Antigravity execute tools to local_bash on turn settle, so the Monitoring pill clears when a Gemini turn finishes.

Why

Fixes #12325

Gemini often returns end_turn while execute tools stay inProgress and never sends a later completion. Those were emitted as task.started (local_bash), which pinned backgroundLiveness === "monitoring" until session teardown.

UI

Monitoring status should clear when the Gemini task completes (no new chrome).

Checklist

  • I read CONTRIBUTING.md and kept this small / bug-only
  • What + why explained above
  • Followed AGENTS.md documentation rules (no new docs)
  • No unrelated changes
  • CLA / AI-reviewed standing override for macodev00 auto-contrib

Summary by CodeRabbit

  • Bug Fixes

    • Improved handling of execute tools that remain in progress when a turn ends.
    • Prevented unfinished background commands from appearing as active local tasks.
    • Ensured monitoring state clears when a turn completes while preserving later native completion updates.
    • Avoided misleading task-start and completion events for commands that remain open.
  • Documentation

    • Clarified behavior for execute tools that remain in progress after a turn ends.

Gemini often returns end_turn while execute tools remain inProgress and
never sends a later completion. Promoting those commands as local_bash
left the Monitoring pill up until session teardown.

Stop promoting leftover execute tools when the turn settles so
Monitoring clears with the finished task.

Fixes pingdotgg#12325

Co-authored-by: maco <macodev00@users.noreply.github.com>
@github-actions github-actions Bot added vouch:unvouched PR author is not yet trusted in the VOUCHED list. size:M 30-99 changed lines (additions + deletions). labels Sep 20, 2026
@macodev00
macodev00 marked this pull request as ready for review September 20, 2026 09:20
@coderabbitai

coderabbitai Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: pingdotgg/t3code/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: a1f99a62-38b3-46a7-8cd7-e70a54887110

📥 Commits

Reviewing files that changed from the base of the PR and between f56a566 and 230fd00.

📒 Files selected for processing (3)
  • apps/server/src/provider/Layers/AntigravityAdapter.test.ts
  • apps/server/src/provider/Layers/AntigravityAdapter.ts
  • apps/server/src/provider/acp/AntigravityProtocol.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • apps/server/src/provider/acp/AntigravityProtocol.ts
  • apps/server/src/provider/Layers/AntigravityAdapter.ts

Limit details: You’ve used all 10 included reviews currently available.


📝 Walkthrough

Walkthrough

The Antigravity adapter no longer promotes unfinished execute tools to local_bash tasks when a turn ends. The adapter also extracts generator implementations for sendTurn and factory construction. The monitoring test keeps the same assertions.

Changes

Antigravity monitoring lifecycle

Layer / File(s) Summary
Turn completion handling
apps/server/src/provider/Layers/AntigravityAdapter.ts, apps/server/src/provider/acp/AntigravityProtocol.ts
Turn completion no longer promotes unfinished execute tools to local_bash tasks. Existing settlement and native completion behavior remain. Protocol comments clarify related tool-call behavior.
Adapter effect structure
apps/server/src/provider/Layers/AntigravityAdapter.ts
sendTurn and adapter construction use standalone generator functions wrapped with named Effect.fn calls. Comments document client file operations and turn behavior.
Monitoring regression test
apps/server/src/provider/Layers/AntigravityAdapter.test.ts
The monitoring test delegates its effect body to assertMonitoringClearsOnEndTurn. Its task-event and native completion assertions remain unchanged.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: juliusmarminge

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes address issue #12325. sendTurn no longer promotes unfinished Antigravity execute commands to local_bash tasks after end_turn. This allows Monitoring to clear when the turn finishes…
Out of Scope Changes check ✅ Passed The changes stay within issue #12325. The production change fixes turn settlement. The test refactoring preserves the Monitoring regression coverage. The added comments document the Antigravity adapte…
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 3 files.
Title check ✅ Passed The title clearly identifies the main bug fix: clearing Gemini Monitoring when the turn finishes.
Description check ✅ Passed The description explains what changed, why it changed, the UI impact, and checklist status. It is focused and provides the linked issue context.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

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

macodev00 and others added 8 commits September 20, 2026 09:32
Document sendTurn, finishTurn, and isAntigravityOpenCommand so leftover
execute tools are recorded as staying unpromoted when a Gemini turn ends.

Co-authored-by: maco <macodev00@users.noreply.github.com>
Document the end_turn execute-tool case so touched functions in the
adapter test file are covered too.

Co-authored-by: maco <macodev00@users.noreply.github.com>
CodeRabbit counts FunctionDeclarations. Extract sendTurnEffect and
settleTurn so leftover execute-tool settlement is documented.

Co-authored-by: maco <macodev00@users.noreply.github.com>
Extract makeAntigravityAdapterEffect and the Monitoring regression
test so JSDoc attaches to FunctionDeclarations.

Co-authored-by: maco <macodev00@users.noreply.github.com>
Give the end_turn execute-tool fixture a documented generator so the
test callback is not an anonymous function*.

Co-authored-by: maco <macodev00@users.noreply.github.com>
Add JSDoc on the protocol helper in the diff hunk and on
writeClientTextFile next to the adapter factory extract.

Co-authored-by: maco <macodev00@users.noreply.github.com>
Keep JSDoc on makeAntigravityAdapter, sendTurn, and interruptTurn so
the Effect.fn wrappers are documented as well as the helpers.

Co-authored-by: maco <macodev00@users.noreply.github.com>
Attach a single-line JSDoc to every function the Gemini Monitoring
diff touches, including the adapter export, so coverage can reach 80%.

Co-authored-by: maco <macodev00@users.noreply.github.com>
@macodev00

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 20, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@macodev00

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Already reviewed the last commit. Use @coderabbitai full review to rerun a review of the entire changeset.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@macodev00

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Sep 22, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Already reviewed the last commit. Use @coderabbitai full review to rerun a review of the entire changeset.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@juliusmarminge

Copy link
Copy Markdown
Member

Superseded by #13388, which fixed #12325 by letting Stop end Antigravity commands that outlived their turn (instead of stopping promotion of leftover execute tools). Closing this PR as leftover hygiene.

@juliusmarminge

Copy link
Copy Markdown
Member

Closing as superseded by #13388 (fixes #12325).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 changed lines (additions + deletions). vouch:unvouched PR author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Gemini always show "Monitoring" after finishing a task and it seems to never end

2 participants