Scope toolkit tool reads and stop gating reads on TTL-expired catalogs - #2061
Merged
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
executor-cloud | 2f6c24c | Sep 18 2026, 07:10 PM |
Contributor
Cloudflare previewTorn down — the PR is closed. |
@executor-js/cli
@executor-js/config
@executor-js/execution
@executor-js/sdk
@executor-js/codemode-core
@executor-js/runtime-quickjs
@executor-js/plugin-file-secrets
@executor-js/plugin-graphql
@executor-js/plugin-keychain
@executor-js/plugin-mcp
@executor-js/plugin-onepassword
@executor-js/plugin-openapi
executor
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Toolkit MCP sessions were slower than default sessions in production: session init p95 was about 3.3 s versus 0.3 s, and search or describe inside a toolkit session paid the same cost. Two structural causes.
A toolkit session listed connections by loading every tool row in the workspace and resolving policy for each, then keeping the few the toolkit allowed.
ToolPolicyProvider.preparenow returns the dynamic-tool prefixes the allowlist can reach, and core restricts the tool query to those prefixes. The read scales with the toolkit, not the workspace.Every tools read waited up to the 2 s grace budget for re-listing MCP catalogs that were merely older than the freshness TTL. Those rebuilds now run in the background and the read answers from the persisted rows. Stale-marked and config-revised catalogs still gate the read within the grace budget. Visibility-only readers (connections and integrations under a toolkit) no longer wait on the sync at all.
Also digests the toolkit rules once per operation instead of re-sorting and re-classifying them for every tool.
Tests: unit tests for the scope helper, scoped reads under a prepared provider, the toolkit scope derivation, and the split between expired and stale-marked sync. The MCP catalog TTL test now asserts eventual convergence. Ran selfhost e2e
toolkits-mcpscenarios.