Skip to content

fix(app): require query functions for sync queries#25939

Merged
Hona merged 2 commits intoanomalyco:devfrom
Hona:fix/provider-queryfn-invariant
May 6, 2026
Merged

fix(app): require query functions for sync queries#25939
Hona merged 2 commits intoanomalyco:devfrom
Hona:fix/provider-queryfn-invariant

Conversation

@Hona
Copy link
Copy Markdown
Member

@Hona Hona commented May 5, 2026

Summary

  • require SDK-backed query functions for shared app sync query keys instead of mounting skipToken observers
  • use explicit query-key helpers for MCP/session loading checks that only need cache keys
  • keep bootstrap store updates outside cached query functions so cache hits still update app state

Testing

  • bun --conditions=browser -e "<paused providers query repro>"
  • bun typecheck from packages/app
  • pre-push bun turbo typecheck

Copilot AI review requested due to automatic review settings May 5, 2026 23:47
@Hona Hona requested a review from adamdotdevin as a code owner May 5, 2026 23:47
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the app’s global-sync query helpers so sync-related queries always have real query functions, while lightweight loading checks use explicit query-key helpers instead of skipToken observers. It mainly touches bootstrap/query wiring in the app’s shared sync layer and the UI components that consume those query keys.

Changes:

  • Reworked global-sync query helpers to require SDK clients and added explicit key helpers for session/MCP/LSP cache lookups.
  • Moved some bootstrap-side store updates to .then(...) handlers so cached query results can still hydrate app state.
  • Updated UI consumers (sidebar-workspace, MCP dialogs/status, prompt input) to use the new query/key helpers.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/app/src/pages/layout/sidebar-workspace.tsx Replaces session loading observer usage with useIsFetching + session query-key helper.
packages/app/src/context/global-sync/bootstrap.ts Refactors bootstrap query helpers to require SDK-backed query functions and moves some state hydration out of query fns.
packages/app/src/context/global-sync.tsx Adds explicit query-key helpers and updates global sync bootstrap/session loading logic to use them.
packages/app/src/components/status-popover-body.tsx Switches MCP refetching to use the explicit MCP query-key helper.
packages/app/src/components/prompt-input.tsx Passes explicit SDK clients into provider/agent queries.
packages/app/src/components/dialog-select-mcp.tsx Switches MCP refetching to use the explicit MCP query-key helper.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/app/src/context/global-sync/bootstrap.ts Outdated
Comment thread packages/app/src/context/global-sync/bootstrap.ts Outdated
Comment thread packages/app/src/pages/layout/sidebar-workspace.tsx Outdated
@Hona Hona merged commit f5c3d35 into anomalyco:dev May 6, 2026
8 checks passed
oleksii-honchar pushed a commit to oleksii-honchar/better-opencode that referenced this pull request May 6, 2026
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.

2 participants