[codex] fix Claude Code config import env parsing#388
Draft
xuqian-git wants to merge 1 commit into
Draft
Conversation
6e002b8 to
d3e01f2
Compare
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
Fixes Claude Code config import when
~/.claude/settings.jsoncontains Claude Code-specific env flags whose values are not strings.Root Cause
The importer validated every key under
settings.envas a string, even though Open CoDesign only consumes a small set of Anthropic import fields. A boolean flag such asCLAUDE_CODE_DISABLE_1M_CONTEXTcaused the whole config to be classified asparse-error; the import IPC then surfaced that as a misleading "No Claude Code settings found" error.Changes
ANTHROPIC_AUTH_TOKEN,ANTHROPIC_API_KEY,ANTHROPIC_BASE_URL, andANTHROPIC_MODEL.CONFIG_PARSE_FAILEDwith the actual reason instead of reporting a missing file.Validation
pnpm --filter @open-codesign/desktop exec vitest run src/main/imports/claude-code-config.test.ts src/main/onboarding-ipc.test.tspnpm exec biome check apps/desktop/src/main/imports/claude-code-config.ts apps/desktop/src/main/imports/claude-code-config.test.ts apps/desktop/src/main/onboarding/register.ts apps/desktop/src/main/onboarding-ipc.test.tspnpm --filter @open-codesign/desktop typecheckNote: local pre-commit/pre-push hooks run full
biome check .and were blocked by an unrelated untrackedapps/desktop/release-local-arm64/build directory in this checkout; that directory is not part of this PR.