Skip to content

fix(config): keep providers when desktopProfile markers are null - #4479

Closed
lidge-jun wants to merge 4 commits into
devfrom
codex/260913-carry-4430
Closed

lidge-jun wants to merge 4 commits into
devfrom
codex/260913-carry-4430

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Sep 13, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Reported by @samwang0041-star in [Bug]: 2.52.0 treats claudeCode.desktopProfile.appliedFingerprint=null as fatal and replaces the whole config with defaults #4430: upgrading to 2.52.0 treated claudeCode.desktopProfile.appliedFingerprint: null (and appliedAt: null) as a document-level parse failure, backed up the operator config, and replaced it with getDefaultConfig() — one openai provider, Codex proxy injection gone.
  • parseDesktopProfile now treats JSON null and any other non-string applied marker as unset, matching appliedMarkers().
  • Blast radius is narrowed independently of that: salvage can drop claudeCode.desktopProfile the same way it already drops a single bad routingProfiles / combos entry, so a still-invalid Desktop profile cannot destroy providers. A claudeCode value that is not an object still fails the whole document, because there is no safe subtree to keep.

Verification

  • bun test tests/clients/desktop-profile.test.ts tests/config/config-load-degrade.test.ts
  • bun test tests/server/config.test.ts -t "independent section|Claude Desktop"
  • bun run typecheck
  • bun run structure:check
  • bun run privacy:scan
  • Local full suite not run (lane policy). Hosted CI is expected only on the lane tip (Kiro second account disappears shortly after successful login #4435). This commit is [skip ci].

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

Summary by CodeRabbit

  • Bug Fixes

    • Configuration loading now treats non-string desktop profile metadata as unset instead of rejecting the profile.
    • Invalid desktop profiles can be discarded while preserving other Claude Code settings and provider configuration.
    • Configuration files remain unchanged when recoverable profile issues are encountered.
    • Invalid profile data no longer causes unrelated configuration settings to be replaced by defaults.
  • Documentation

    • Documented how desktop profile metadata is handled and when invalid profiles are removed during configuration loading.

…p ci]

JSON null appliedFingerprint/appliedAt is treated as unset, matching
appliedMarkers(). An still-invalid desktopProfile is salvaged by dropping
that field only, so one bad Claude Desktop marker cannot replace the
operator config with defaults.

Closes #4430
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner September 13, 2026 07:01
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-13T07:04:19.625450Z d643ddf PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Sep 13, 2026
@coderabbitai

coderabbitai Bot commented Sep 13, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 9664772d-79d0-419f-a0a0-eddb182f8cf0

📥 Commits

Reviewing files that changed from the base of the PR and between 498233c and 7d660e8.

📒 Files selected for processing (1)
  • structure/config.md

Included review availability: Your plan provides up to 10 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Changes

Desktop profile configuration salvage

Layer / File(s) Summary
Marker normalization and parsing
src/claude/desktop-profile.ts, src/config.ts, tests/clients/desktop-profile.test.ts
Non-string appliedFingerprint and appliedAt values are treated as unset. Persisted normalization retains only string marker values.
Selective config salvage
src/config.ts, structure/config.md
claudeCode.desktopProfile is recognized as a salvageable field. Invalid profiles can be dropped while the remaining configuration is preserved. The documented rules cover invalid marker fields and non-object claudeCode values.
Config-load validation
tests/config/config-load-degrade.test.ts
Tests verify marker removal, invalid-profile dropping, unchanged config files, preserved provider and Claude settings, and no default-config fallback.

Priority: ⚪ Not assessed

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 7d660

Invalid desktop profile markers and profiles now preserve the operator configuration, while intentionally unsalvageable claudeCode values retain the documented fallback behavior. No merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 4 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: preserving providers when null desktop profile markers would otherwise trigger configuration salvage or replacement.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 4 files. (1 skipped: 1 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/260913-carry-4430

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d643ddf153

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/config.ts

/** Optional nested fields that can be dropped whole without changing the rest of the document. */
const SALVAGEABLE_OPTIONAL_FIELDS: ReadonlyArray<readonly [string, string]> = [
["claudeCode", "desktopProfile"],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Update every mapped structure owner

This changes both src/config.ts and src/claude/, but updates only structure/config.md; structure/INDEX.md also maps src/config.ts to overview.md, runtime.md, and providers/openai-tiers.md, and maps src/claude/ to runtime.md and clients/claude-desktop.md. Update those mapped documents—or correct the ownership map if they no longer apply—so the architecture SSOT does not remain stale.

AGENTS.md reference: structure/AGENTS.md:L49-L50

Useful? React with 👍 / 👎.

@lidge-jun

Copy link
Copy Markdown
Owner Author

리뷰 · 우선순위 76 / 80

설명
이 PR은 #4430(@samwang0041-star) 보고를 고친다. 2.52.0 업그레이드에서 claudeCode.desktopProfile.appliedFingerprint: null(또는 appliedAt: null)이 문서 전체 파싱 실패로 취급되어, 설정이 백업된 뒤 getDefaultConfig()로 덮였다. 결과적으로 openai 한 줄만 남고 Codex 프록시 주입이 사라지는 운영 사고다.

parseDesktopProfile은 JSON null·비문자열 applied 마커를 unset으로 본다(appliedMarkers()와 동일). 그 뒤에도 프로필이 깨지면 프로필 통째만 버리고, providers/routing 등 나머지 문서는 살린다. src/config.ts salvage가 routingProfiles/combos에 이미 쓰던 “독립 항목은 잘라내고 문서 유지”와 같은 방향이다. claudeCode 자체가 객체가 아니면 문서를 실패시키는 기존 엄격함은 유지한다. 테스트는 desktop-profile·config-load-degrade에 null/비문자열 마커와 providers 보존을 잠그고, structure/config.md에 한 단락을 남긴다.

우선순위 76은 설정 wipe라는 최악 사용자 피해를 막고, 수정이 파서·salvage로 매우 좁기 때문이다. tip b4dec3469 / 2.53.0, types/config 분할 캠페인에 잡아먹힐 변경이 아니다(오히려 config 로드 안전장치).

src/claude/desktop-profile.ts parseDesktopProfile - null/비문자열 appliedFingerprint·appliedAt → unset.

src/config.ts salvage 경로 - 깨진 desktopProfile만 드롭, providers 유지.

tests/clients/desktop-profile.test.ts / tests/config/config-load-degrade.test.ts - 마커·보존 회귀.

심볼 #4430 / getDefaultConfig() wipe - 이 PR의 성공 기준은 “null 마커만으로 전체 리셋이 안 나야 한다”.

메인테이너의 판단이 필요한 지점

  • 2.52.0 사용자에게 마이그레이션/릴리즈 노트 한 줄을 넣을지.
  • #4430을 머지와 동시에 닫을지.

너의 추천
즉시 머지하세요. #4430을 이 PR로 닫고, 2.53.x 릴리즈 노트에 “null desktopProfile markers no longer wipe config”를 한 줄 넣으세요.

이 댓글은 grok-bot이 작성했습니다

lidge-jun added a commit that referenced this pull request Sep 13, 2026
Lane I2 of the contributor carry train: two reported defects with no source branch.

#4430 (samwang0041-star) — 2.52.0 treated claudeCode.desktopProfile.appliedFingerprint=null as fatal and replaced the whole configuration with defaults. Accepting null is the immediate fix; the landing also narrows the reset path so one invalid field cannot destroy a user's providers.

#4435 (ren-min-wan-sui) — a second Kiro account disappeared shortly after a successful login, because a leftover CLI profile ARN collapsed it onto the first.

Cross-platform CI run 34745142783 concluded success on 002d6c1, the exact head merged here, which already contains a merge of origin/dev. #4479 carries no ci check of its own; its head commit carries [skip ci] by design and this cumulative tip run covers its content, under the owner-authorized tip-only CI economy for this batch.

No Co-authored-by trailer: both links are ordinary implementations with no contributor branch behind them, and the reporters are credited in the pull request descriptions.
@lidge-jun

Copy link
Copy Markdown
Owner Author

Landed on dev as part of lane I2. Closing manually rather than by GitHub automation: this branch's content merged inside tip #4482 (merge commit 990cd8c), and commit 7d660e8 is a verified ancestor of origin/dev. The branch head then moved one commit ahead with a further merge of origin/dev, which is why GitHub did not close it automatically; that commit contributes nothing of its own.

Tip-only CI record: owner-authorized for this batch; Cross-platform CI run 34745142783 concluded success on 002d6c1, the exact head merged; this pull request's own ci check never ran, its head commit carrying [skip ci] by design.

@lidge-jun lidge-jun closed this Sep 13, 2026
@lidge-jun
lidge-jun deleted the codex/260913-carry-4430 branch September 16, 2026 01:56
agentHits pushed a commit to agentHits/opencodex that referenced this pull request Sep 17, 2026
Lane I2 of the contributor carry train: two reported defects with no source branch.

lidge-jun#4430 (samwang0041-star) — 2.52.0 treated claudeCode.desktopProfile.appliedFingerprint=null as fatal and replaced the whole configuration with defaults. Accepting null is the immediate fix; the landing also narrows the reset path so one invalid field cannot destroy a user's providers.

lidge-jun#4435 (ren-min-wan-sui) — a second Kiro account disappeared shortly after a successful login, because a leftover CLI profile ARN collapsed it onto the first.

Cross-platform CI run 34745142783 concluded success on 3238428, the exact head merged here, which already contains a merge of origin/dev. lidge-jun#4479 carries no ci check of its own; its head commit carries [skip ci] by design and this cumulative tip run covers its content, under the owner-authorized tip-only CI economy for this batch.

No Co-authored-by trailer: both links are ordinary implementations with no contributor branch behind them, and the reporters are credited in the pull request descriptions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant