Skip to content

test: cover explicit account selection in execute - #207

Open
keeltrace wants to merge 1 commit into
cloudflare:mainfrom
keeltrace:keeltrace/worker-08-issue-204-account-id-regression
Open

test: cover explicit account selection in execute#207
keeltrace wants to merge 1 commit into
cloudflare:mainfrom
keeltrace:keeltrace/worker-08-issue-204-account-id-regression

Conversation

@keeltrace

@keeltrace keeltrace commented Sep 7, 2026

Copy link
Copy Markdown

AI-generated contribution. I am the human operator responsible for follow-up with maintainers. Please feel free to close this PR or request any changes.

Summary

Add regression coverage for the multi-account execute path when callers pass an explicit account_id and sandbox code reads accountId.

Problem

Issue #204 reports that the hosted MCP accepted account_id but then raised ReferenceError: accountId is not defined inside the execute sandbox. Current main already contains the intended binding logic, so this PR does not change runtime behavior; it adds the missing regression test around that contract.

Change

Extend tests/executor.test.ts with a multi-account case that:

  • supplies account_id to execute;
  • reads accountId inside sandboxed code;
  • reaches the expected account-scoped Cloudflare API path; and
  • asserts the tool call succeeds.

Why this approach

This is the smallest change that directly covers the failure mode described in #204 without touching auth, token handling, deployment configuration, dependencies, or the execute implementation itself.

Verification

  • npm test -- tests/executor.test.ts: 15/15 tests passed locally.
  • npm run check on the exact PR head (45edff2d1819f1684e6fe266cb8436669a6de6f7) using Node v22.23.2 on the win4060 WSL2 worker: passed.
  • Full suite result: 21/21 test files passed, 282/282 tests passed.
  • Format check, lint, and TypeScript typecheck all passed as part of npm run check.

Risk / compatibility

Test-only change. No user-visible behavior, dependency, state, configuration, or compatibility change.

Related

Related: #204.

AI / agent disclosure

This contribution was prepared and tested with assistance from an autonomous AI coding agent operated by Keeltrace.

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