fix: keep executor.jsonc in sync with source add/remove#408
Merged
RhysSullivan merged 1 commit intoMay 11, 2026
Merged
Conversation
Two related bugs caused executor.jsonc and the runtime DB to drift out of sync, so sources resurrected after a UI delete and OAuth `auth` blocks vanished after a restart. - Engine-level `removeSource` hook in the openapi, mcp, and graphql plugins now mirrors the SDK-level `removeSpec` / `removeSource` and writes back to `configFile` after the storage transaction. - `apps/local` config-sync now translates `McpAuthConfig` → `McpConnectionAuthInput` and forwards it to `executor.mcp.addSource`, so remote MCP `auth` survives boot.
437a06b to
6ba30f0
Compare
4 tasks
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.
Summary
Two related bugs caused
executor.jsoncand the runtime DB to drift out of sync, so sources resurrected after a UI delete and OAuthauthblocks vanished after a restart. Both are reproducible againstexecutor@1.4.9.removeSourcehook in the openapi, mcp, and graphql plugins now mirrors the SDK-levelremoveSpec/removeSourceand writes back toconfigFile.apps/localconfig-sync now translatesMcpAuthConfig→McpConnectionAuthand forwards it toexecutor.mcp.addSource, so remote MCPauthsurvives boot.Why
Bug 1 — engine-level remove never updates
executor.jsoncThe SDK methods (
openapi.removeSpec,mcp.removeSource,graphql.removeSource) correctly callctx.storage.removeSource(...)andconfigFile.removeSource(...). The plugin lifecycle hook also namedremoveSource— used by the engine'sexecutor.sources.removeand therefore by the HTTPsources.removehandler and the web UI delete button — only deleted plugin storage rows. The DB was cleaned, but the file wasn't.On the next boot,
apps/localboot-sync readexecutor.jsonc, saw the still-present source entry, and re-upserted it into the DB. From the user's perspective, deleted sources resurrected after every restart.Bug 2 — boot-sync silently strips MCP
authapps/local/src/server/config-sync.tsrebuilt theexecutor.mcp.addSource(...)call for remote MCP sources without passingsource.auth.addSourcethen wrote back toexecutor.jsoncviaconfigFile.upsertSource(...)withauth: undefined— so{ kind: "oauth2", connectionId: ... }blocks silently disappeared from the file on the very first restart. The next restart saw a source with no auth, hit a 401 on connect, and registered zero tools.The OAuth connection row and keychain tokens themselves remained intact in the DB; the file just lost the pointer.
Validation
bunx --bun vitest runinpackages/plugins/openapi— 64/64 (incl. new regression test assertingexecutor.sources.removetriggersconfigFile.removeSource)bunx --bun vitest runinpackages/plugins/mcp— 30/30bunx --bun vitest runinpackages/plugins/graphql— 14/14bunx --bun vitest runinpackages/core/sdk— 90/90bunx --bun vitest runinapps/local— 23/23 (incl. newconfig-sync.test.tscovering allMcpAuthConfigvariants)bun run typecheckclean acrossapps/local,packages/plugins/{openapi,mcp,graphql}executor web:executor.jsonccorrectly omits the source and the DB stays clean (was reappearing pre-fix)auth: { kind: "oauth2", connectionId: ... }block is preserved inexecutor.jsoncand 33 Linear tools load (was silently 401'ing pre-fix)