Skip to content

fix(plugins): check a store connection against the store itself - #905

Merged
davidmckayv merged 4 commits into
CopilotKit:mainfrom
sx4im:fix/886-shop-identity-probe
Nov 2, 2026
Merged

davidmckayv merged 4 commits into
CopilotKit:mainfrom
sx4im:fix/886-shop-identity-probe

Conversation

@sx4im

@sx4im sx4im commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

What this changes

After connecting a Shopify key, OpenBot checked it with SHOPIFY_COUNT_BLOGS, the first safe read alphabetically, which needs the read_content scope a store app with only order and product scopes does not have. The 403 made a working key look rejected. A store's own details are the identity, so _GET_SHOP_DETAILS now counts as an identity read and the check uses it instead.

Where it runs

No new state, no listeners, no schedules. The chooser is a pure function of the app's published actions; every replica picks the same probe.

  • New state that outlives a request? None.
  • What happens on the second replica? Identical probe choice, no shared state involved.
  • Anything serialised? Nothing new.
  • Anything fanned out to a browser? No.
  • New listener, port, or schedule? No.

Boundary and audit

  • Every acting call still goes through the gateway: resolve, decide, audit, then act.
  • New refusals and new failures each write a row. No new refusal paths; the probe decision is recorded as before.
  • Nothing new is trusted from the client that the server can resolve itself.

Changelog

  • A line in CHANGELOG.md under Unreleased.

Proof

New pure unit test server/tests/plugin-store-identity-action.test.ts: 3 pass. It fails without the fix (SHOPIFY_GET_SHOP_DETAILS not recognised) and passes with it; the existing identity suffixes still match and non-identity actions (SHOPIFY_COUNT_BLOGS, SLACK_PROFILE_SET) still do not. tsc --noEmit clean on server. The DB-backed probe suites need TEST_DATABASE_URL, not available here.

Refs #886 (this fixes the identity probe; the 403 scope and verified:false halves stay open)

probeActionFor prefers an identity read matching IDENTITY_ACTION, else the first safe read alphabetically. For Shopify that was SHOPIFY_COUNT_BLOGS, which needs the read_content scope a store app with only order and product scopes lacks, so a working key was reported as rejected. A store's own details are the identity: _GET_SHOP_DETAILS now counts.

Co-authored-by: Saim Shafique <128062316+sx4im@users.noreply.github.com>
Resolve CHANGELOG.md Unreleased entry collision: keep upstream's
entries and the PR's store-connection entry (mechanical merge).

@davidmckayv davidmckayv 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.

Thanks. Checked together with the other fixes on one tree with the full test suite, and merging.

@davidmckayv
davidmckayv merged commit 9d72552 into CopilotKit:main Nov 2, 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