Skip to content

Request all advertised OAuth scopes; keep sync verdicts visible - #2056

Merged
RhysSullivan merged 1 commit into
mainfrom
fix/oauth-scope-cap
Sep 18, 2026
Merged

RhysSullivan merged 1 commit into
mainfrom
fix/oauth-scope-cap

Conversation

@RhysSullivan

Copy link
Copy Markdown
Collaborator

Why

Scope discovery capped the authorize request at 100 scopes. PostHog's MCP resource now advertises 150, so the last 50 were dropped, including the ones its server needs to start a session. Every PostHog MCP connection created through the CIMD client since late August minted a token the server rejects with 401, and synced zero tools.

The credential-only health check then overwrote the sync-stamped rejection with "healthy", so the UI showed a green badge and no tools.

What

  • Bound discovered scopes by joined scope-string length (8 KiB) instead of a count of 100.
  • Sync-supplied verdicts carry reason: tool_sync_failed; isToolSyncHealth recognises the reason as well as the detail prefix.
  • A health check without a probe serves an existing sync verdict instead of replacing it with healthy, and never persists over one.

Tests

  • Scope union: 150 realistic scopes are all requested; a 2000-scope list is cut at the budget.
  • OAuth flow: a sync-stamped expired verdict survives a credential-only health check. Fails without the fix.

After deploy, affected users need to reconnect PostHog once to mint a full-scope token.

🤖 Generated with Claude Code

Scope discovery capped the request at 100 scopes. A resource that
advertises more (PostHog lists 150) got a token missing the scopes its
MCP server needs, so every new connection synced zero tools. Bound the
request by scope-string length (8 KiB) instead.

A credential-only health check then reported healthy over the
sync-stamped rejection, hiding the failure. Sync-supplied verdicts now
carry the tool_sync_failed reason and are served until a sync succeeds.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

Cloudflare preview

Torn down — the PR is closed.

@pkg-pr-new

pkg-pr-new Bot commented Sep 18, 2026

Copy link
Copy Markdown

Open in StackBlitz

@executor-js/cli

npm i https://pkg.pr.new/@executor-js/cli@2056

@executor-js/config

npm i https://pkg.pr.new/@executor-js/config@2056

@executor-js/execution

npm i https://pkg.pr.new/@executor-js/execution@2056

@executor-js/sdk

npm i https://pkg.pr.new/@executor-js/sdk@2056

@executor-js/codemode-core

npm i https://pkg.pr.new/@executor-js/codemode-core@2056

@executor-js/runtime-quickjs

npm i https://pkg.pr.new/@executor-js/runtime-quickjs@2056

@executor-js/plugin-file-secrets

npm i https://pkg.pr.new/@executor-js/plugin-file-secrets@2056

@executor-js/plugin-graphql

npm i https://pkg.pr.new/@executor-js/plugin-graphql@2056

@executor-js/plugin-keychain

npm i https://pkg.pr.new/@executor-js/plugin-keychain@2056

@executor-js/plugin-mcp

npm i https://pkg.pr.new/@executor-js/plugin-mcp@2056

@executor-js/plugin-onepassword

npm i https://pkg.pr.new/@executor-js/plugin-onepassword@2056

@executor-js/plugin-openapi

npm i https://pkg.pr.new/@executor-js/plugin-openapi@2056

executor

npm i https://pkg.pr.new/executor@2056

commit: 9dea326

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
executor-marketing 9dea326 Commit Preview URL

Branch Preview URL
Sep 18 2026, 06:42 PM

@RhysSullivan
RhysSullivan marked this pull request as ready for review September 18, 2026 18:52
@RhysSullivan
RhysSullivan merged commit 2e5aa16 into main Sep 18, 2026
44 checks passed
@RhysSullivan
RhysSullivan deleted the fix/oauth-scope-cap branch September 18, 2026 18:52
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