Skip to content

Sync Work model picker after Cursor auth - #1078

Merged
arul28 merged 2 commits into
mainfrom
ade/cursor-model-availability
Aug 11, 2026
Merged

Sync Work model picker after Cursor auth#1078
arul28 merged 2 commits into
mainfrom
ade/cursor-model-availability

Conversation

@arul28

@arul28 arul28 commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Summary

  • Work chat's AgentChatPane now listens for AI status cache update/invalidate events and applies the shared cache (peek on update; one non-force settle refill if still stale on an active tile).
  • Keeps the model picker's external providerAuthStatus in sync after Settings Cursor auth without remounting the desktop app or issuing per-tile force getStatus probes.
  • Documents the invariant in composer-and-ui.md and adds regression coverage for the unlock path and invalidate settle.

Test plan

  • AgentChatPane regression: shared cache update unlocks Cursor without remount / without extra force getStatus
  • AgentChatPane regression: invalidate settle uses non-force refill only
  • Related AI status tests (aiDiscoveryCache, useProviderAuthStatus) + desktop typecheck
  • Authorize Cursor in Settings with Work chat already open → Cursor models appear in picker without quitting desktop

ADE   Open in ADE  ·  ade/cursor-model-availability branch  ·  PR #1078

Summary by CodeRabbit

  • Bug Fixes
    • Improved AI status updates in the chat pane without requiring a remount.
    • Refined model and provider availability updates for the active chat.
    • Added automatic recovery after AI status cache invalidation.
    • Prevented unnecessary status checks while keeping model selection responsive.

AgentChatPane kept a stale local auth map that locked the picker Off until remount; listen for shared cache update/invalidate events without force getStatus probes.

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel

vercel Bot commented Aug 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
ade Ignored Ignored Preview Aug 11, 2026 11:22pm

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@arul28, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 46 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 6a31c193-9a4d-4e84-977d-1ea939e499e2

📥 Commits

Reviewing files that changed from the base of the PR and between 65694f2 and 99eb649.

📒 Files selected for processing (2)
  • apps/desktop/src/renderer/components/chat/AgentChatPane.test.tsx
  • apps/desktop/src/renderer/components/chat/AgentChatPane.tsx
📝 Walkthrough

Walkthrough

Changes

AI status cache synchronization

Layer / File(s) Summary
Snapshot application and runtime scope
apps/desktop/src/renderer/components/chat/AgentChatPane.tsx
Shared callbacks now apply AI status snapshots, resolve runtime scope, and clear state when no valid scope exists.
Cache update and invalidation handling
apps/desktop/src/renderer/components/chat/AgentChatPane.tsx
The pane applies matching cache updates immediately and performs one delayed non-forced refresh after invalidation when needed.
Cache synchronization coverage
apps/desktop/src/renderer/components/chat/AgentChatPane.test.tsx
Tests cover model-picker updates from shared cache events without remounts or redundant forced probes.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • arul28/ADE#219: Both update AgentChatPane.tsx AI status refresh behavior.
  • arul28/ADE#943: Both update chat AI event subscription and cache handling.

Suggested labels: desktop, docs

Suggested reviewers: nsxdavid

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: synchronizing the Work model picker after Cursor authentication.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ade/cursor-model-availability

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/desktop/src/renderer/components/chat/AgentChatPane.tsx`:
- Around line 5887-5893: Update the fallback getAiStatusCached call in
AgentChatPane to pass refreshOpenCodeInventory: true when the active session
uses OpenCode, matching the normal refresh path while preserving false for other
sessions. Add a named regression test covering an active OpenCode session that
invalidates the cache and verifies the status request includes
refreshOpenCodeInventory: true.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: d64ad6f1-a0e6-4a08-bd6b-53a384f82457

📥 Commits

Reviewing files that changed from the base of the PR and between a59b961 and 65694f2.

⛔ Files ignored due to path filters (1)
  • docs/features/chat/composer-and-ui.md is excluded by !docs/**
📒 Files selected for processing (2)
  • apps/desktop/src/renderer/components/chat/AgentChatPane.test.tsx
  • apps/desktop/src/renderer/components/chat/AgentChatPane.tsx

Comment thread apps/desktop/src/renderer/components/chat/AgentChatPane.tsx
Keep the Work pane settle refill aligned with refreshAvailableModels so an active OpenCode session does not re-apply a stale inventory snapshot.

Co-authored-by: Cursor <cursoragent@cursor.com>
@arul28

arul28 commented Aug 11, 2026

Copy link
Copy Markdown
Owner Author

Addressed CodeRabbit: invalidate settle now passes refreshOpenCodeInventory for active OpenCode sessions, with a named regression test.

@arul28
arul28 merged commit 1d1dfb6 into main Aug 11, 2026
36 checks passed
@arul28
arul28 deleted the ade/cursor-model-availability branch August 12, 2026 00:08
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