Repository navigation
fix(host-cloudflare): refresh internal integration catalogs when the tool list changes - #18
Merged
Merged
Conversation
…tool list changes Detect a changed internal tool list by a SHA-256 of the listed tools stored per integration in BLOBS, instead of by the deployed version id.
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.
Problem
Internal integration catalogs were refreshed once per deployed Executor version, and the version was recorded as done after the refresh. If Executor deployed before an internal tool server, the refresh read the old tool list and recorded the version, so new tools did not appear until the next Executor deploy. Seen in production: a refresh at 08:36 loaded 16 tools, the tool server deployed at 08:37 with 18.
Fix
Detect changes by content, not by version. Once per isolate, for each declared integration that exists with the declared endpoint:
discoverToolsFromInput(now exported from@executor-js/plugin-mcp).internal-integrations/tools-hash/<slug>. Refresh the orgmainconnection only if it differs or none is stored.tool_sync_failedhealth still counts as failure). New integrations store their hash after creation.A missing BLOBS binding or an R2 error means refresh and a warning, never a failed boot. A failed
tools/listskips that integration and records nothing. Existing integrations are still never updated or deleted, and ones with a different endpoint are never touched.The per-version key and the
version_metadatabinding (CF_VERSION_METADATA) are removed; nothing else used them.Tests
Real executor and real MCP fixture server. Cover: no hash, same tools, changed tools, failed refresh then recovery, failed
tools/list, mismatched endpoint, R2 errors, no store, and hash stability across order.