Repository navigation
Conversation
Other plugins share the renderer's process.env and may add keys later (e.g. Copilot sets CLAUDE_AGENT_SDK_VERSION). The SDK compares daemon env over the union of keys, so new Queries were rejected with "Global daemon is already initialized with different options". Fixes #101
This branch has not been deployed
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.
Fixes #101.
Problem
buildDaemonLaunchOptions()copied the liveprocess.envinto the daemon'senvevery time it ran. Obsidian plugins share the renderer'sprocess.env. Copilot (and Claudian) setCLAUDE_AGENT_SDK_VERSIONthere after Qoderian's daemon has started. The SDK checksenvkey by key across both the stored and the new options, so a key added later counts as a difference, and every new tab failed withGlobal daemon is already initialized with different options.Change
src/qoder/runtime/qoder-daemon-launch.ts: the env Qoderian passes on is now a copy ofprocess.envtaken the first time the function runs, so the daemon options stay the same for the life of the plugin.PATH,QODER_SDK_CUSTOM_BASE_URL_BYOKandQODER_INTEGRATION_IDstill go on top as before.tests/unit/qoder/runtime/qoder-daemon-launch.test.ts: a regression test that adds aprocess.envkey between two calls and expects the same env keys both times. It compares keys only, so a failure never prints env values.How I checked it
initDaemon(opts), then setprocess.env.CLAUDE_AGENT_SDK_VERSION, theninitDaemon(opts)again →DaemonConfigurationConflictError. Without the env write, the second call joins the first initialization.npm test(171 suites, 3612 tests),npm run typecheckandnpm run lintall pass.Not in scope
getEnhancedPath()still reads the liveprocess.env.PATH, so a plugin that changesPATHcould cause the same conflict. That wasn't reported.