Skip to content

[Bug]: 2.52.0 treats claudeCode.desktopProfile.appliedFingerprint=null as fatal and replaces the whole config with defaults #4430

Closed

Description

@samwang0041-star

Client or integration

Codex App

Area

CLI

Summary

Upgrading @bitkyc08/opencodex from 2.51.0 → 2.52.0 rejected a previously working ~/.opencodex/config.json because:

claudeCode.desktopProfile: profile.appliedFingerprint: must be a string

The file on disk had "appliedFingerprint": null and "appliedAt": null (not omitted). loadConfig() then backed the document up as config.json.invalid-* and started with getDefaultConfig(): a single openai provider, no other providers/keys/routing, and Codex proxy injection removed from ~/.codex/config.toml.

/healthz stayed 200, ocx status reported a healthy proxy, and the only user-visible symptom was “Codex stopped working” after the self-update.

This is the same blast-radius class as #1785: one field in claudeCode.desktopProfile is treated as a document-level parse failure, and the salvage path does not keep providers.

The stricter type check itself is reasonable. What seems disproportionate is discarding the rest of the config for a marker that older builds and several current writers persist as JSON null.

Reproduction

  1. On 2.51.0, run with a multi-provider config.json whose Claude Desktop profile includes null markers (this is what 2.51 wrote / tolerated):
"claudeCode": {
  "enabled": true,
  "authMode": "proxy",
  "desktopProfile": {
    "version": 1,
    "assignments": {
      "opencode-go/deepseek-flash": {
        "family": "opus",
        "alias": "claude-opus-4-8-20260731"
      }
    },
    "defaults": {
      "opus": "opencode-go/deepseek-flash",
      "fable": null,
      "sonnet": null,
      "haiku": null
    },
    "appliedFingerprint": null,
    "appliedAt": null
  }
}
  1. Upgrade: ocx update --tag latest (2.51.0 → 2.52.0) and let the proxy restart.
  2. Observe the service log and the served provider list.

Observed on 2.52.0:

  • Service log: Could not load opencodex config at ~/.opencodex/config.json: claudeCode.desktopProfile: profile.appliedFingerprint: must be a string. Using default config. A backup was written to ~/.opencodex/config.json.invalid-...
  • On-disk config.json was later rewritten to the default (~1KB, only openai). The original ~100KB document survived only as config.json.invalid-*.
  • Codex App lost openai_base_url / catalog injection and stopped routing through the proxy.
  • Omitting the two null keys (leaving appliedFingerprint / appliedAt absent) makes loadConfig() succeed and restores every provider.

Expected:

  • null is treated like “unset”, matching appliedMarkers() in src/claude/desktop-profile.ts (non-string values are already dropped when copying markers).
  • Writers should not persist appliedFingerprint ?? null into config.json.
  • If the profile markers are still invalid, salvage should drop those two keys (or the desktop profile) and keep providers / Codex integration, instead of getDefaultConfig().

Version

2.52.0 (upgraded from 2.51.0 via ocx update)

Operating system

macOS 27.0 (25A5425a), arm64

Provider and model

Not provider-specific. Trigger is claudeCode.desktopProfile.appliedFingerprint / appliedAt being JSON null. Codex then failed because the fallback default config dropped proxy injection.

Logs or error output

Could not load opencodex config at ~/.opencodex/config.json: claudeCode.desktopProfile: profile.appliedFingerprint: must be a string. Using default config. A backup was written to ~/.opencodex/config.json.invalid-2026-09-12T15-58-46-426Z.

# after fallback, proxy is still "healthy"
curl -s http://127.0.0.1:10100/healthz
# {"status":"ok","service":"opencodex","version":"2.52.0",...}

# served config is the built-in default (one openai provider)
# original multi-provider document is only in config.json.invalid-*

Redacted configuration

{
  "claudeCode": {
    "enabled": true,
    "authMode": "proxy",
    "desktopProfile": {
      "version": 1,
      "assignments": { "opencode-go/deepseek-flash": { "family": "opus", "alias": "claude-opus-4-8-20260731" } },
      "defaults": { "opus": "opencode-go/deepseek-flash", "fable": null, "sonnet": null, "haiku": null },
      "appliedFingerprint": null,
      "appliedAt": null
    }
  }
}

defaults.*.null is accepted. Only the two applied-state markers being null (present, non-string) trip parseDesktopProfile().

Why this is 2.52.0-shaped

src/claude/desktop-profile.ts parseDesktopProfile():

if (value.appliedFingerprint !== undefined && typeof value.appliedFingerprint !== "string") {
  throw new DesktopProfileError("must be a string", "profile.appliedFingerprint");
}

That throw is wired through configSchema.superRefine → loadConfig(). Merge-with-defaults and salvageConfigCandidate() do not strip these markers, so the loader hits warnAndBackupInvalidConfig() and returns getDefaultConfig().

Meanwhile other 2.52.0 paths still write null:

  • src/cli/ensure-desired-integrations.ts — appliedFingerprint: config.claudeCode?.desktopProfile?.appliedFingerprint ?? null
  • src/server/management/agent-settings-routes.ts — same ?? null
  • src/server/management/native-integration-routes.ts — same ?? null

So an upgrade from a 2.51 file that stored null, or any later save that re-persists ?? null, can take down the whole operator config.

Workaround

  1. Copy the newest ~/.opencodex/config.json.invalid-* back to config.json.
  2. Delete appliedFingerprint and appliedAt when they are not strings (do not leave JSON null).
  3. ocx restart && ocx ensure.

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.

Activity

  1. added
    bug
    cli
    on Sep 12, 2026
  2. lidge-jun commented on Sep 12, 2026

    @lidge-jun
    Owner

    리뷰 · 우선순위 76 / 80

    설명
    이 이슈는 2.51.0에서 잘 쓰던 ~/.opencodex/config.json을 2.52.0으로 올린 뒤, Claude Desktop 프로필 안의 적용 표시 두 칸(appliedFingerprint, appliedAt)이 JSON null로 남아 있으면 설정 파일 전체를 기본값으로 바꿔 버리는 사고다. 증상은 /healthz도 200이고 ocx status도 건강해 보이는데 Codex만 프록시를 안 타는 형태라, 사용자가 “업데이트가 Codex를 죽였다”고 느끼기 쉽다. 지금 dev HEAD(01e7d746, package 2.53.0)도 같은 파서를 쓰고 있어서, Muse/Devin 쪽 최신 작업과 별개로 업그레이드 경로의 설정 보존 문제로 남아 있다.

    코드 쪽을 보면 src/claude/desktop-profile.ts의 parseDesktopProfile()은 키가 있는데 문자열이 아니면(즉 null) DesktopProfileError("must be a string")를 던진다. 같은 파일의 appliedMarkers()는 문자열이 아니면 아예 생략한다. 그래서 “복사할 때”는 관대하고 “읽을 때”는 엄격한 불일치가 있다. 이 throw는 src/config.ts의 configSchema.superRefine에서 claudeCode.desktopProfile 경로로 올라가고, loadConfig()가 실패하면 warnAndBackupInvalidConfig() 뒤에 getDefaultConfig()로 떨어진다. 원래 수백 KB짜리 다중 프로바이더 문서는 config.json.invalid-* 백업에만 남고, 디스크의 config.json은 openai 하나짜리 기본값으로 바뀌며 Codex 쪽 openai_base_url/카탈로그 주입도 같이 빠진다.

    구조적으로 더 아픈 점은 구제(salvage) 범위다. salvageConfigCandidate() / dropInvalidConfigSections()가 살릴 수 있는 구역은 routingProfiles와 combos뿐이다. #1785(라우팅 프로필 후보 하나 때문에 전체 설정이 무효가 되던 클래스)를 줄이려고 만든 길이지만, claudeCode.desktopProfile 마커 오류는 그 목록 밖이라 마커만 빼 주고 providers를 남기는 경로가 없다. 리포터 말대로 defaults 안의 null(비어 있는 family)은 허용되는데, 적용 표시의 null만 문서 전체를 쓰러뜨리는 비대칭이다.

    리포터가 적어 둔 “지금도 ?? null로 다시 쓴다” 목록은 HEAD에서 조금 다르게 읽힌다. src/cli/ensure-desired-integrations.ts와 여러 management 상태 API의 appliedFingerprint ?? null은 대부분 Claude Desktop 검사/정리 함수 인자이거나 JSON 응답용이고, config.json에 그대로 박는 쓰기와는 구분된다. 다만 예전에 2.51이(또는 다른 저장 경로가) 키를 생략하지 않고 JSON null로 남긴 파일이 실제로 있고, 그 파일을 2.52+/현재 dev 파서가 문서 단위로 거절하는 것은 재현된 사실이다. 고칠 때는 (1) 파서가 null을 unset처럼 취급하거나 (2) 저장 전에 마커를 생략하고 (3) salvage가 최소한 claudeCode.desktopProfile 마커/desktopProfile 전체를 버리고 providers는 남기게 하는 세 층을 같이 보는 편이 안전하다.

    라인 106 - src/claude/desktop-profile.ts parseDesktopProfile: appliedFingerprint가 정의돼 있는데 문자열이 아니면(JSON null 포함) throw한다. 같은 파일 appliedMarkers()는 비문자열을 그냥 버린다.
    라인 109 - 같은 함수의 appliedAt도 동일하게 null이면 throw한다. defaults.*.null은 허용이라 적용 마커만 특별히 문서 전체를 쓰러뜨린다.
    경로 src/config.ts superRefine(claudeCode.desktopProfile) - parseDesktopProfile 실패를 Zod 이슈로 올려 loadConfig 실패 → 백업 후 getDefaultConfig()로 이어진다.
    경로 src/config.ts SALVAGEABLE_CONFIG_SECTIONS - salvage 대상이 routingProfiles/combos뿐이라 desktopProfile 마커 오류는 providers를 살리지 못한다(#1785와 같은 폭발 반경 클래스).
    경로 리포트의 ensure-desired-integrations.ts ?? null - HEAD에서는 config.json 쓰기보다 Desktop 정리/검사 인자 쪽에 가깝다. “지금도 null을 파일에 다시 쓴다”는 주장은 저장 경로를 한 번 더 짚고 고치는 편이 맞다.

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

    • 최소 패치로 null/비문자열 마커를 unset과 같게 읽을지, 아니면 salvage로 desktopProfile(또는 마커 두 칸)만 버리고 providers를 남길지, 둘 다 할지.
    • 2.52.0 이미 배포된 사용자에게 릴리즈 노트/마이그레이션(invalid 백업 복구 + 마커 삭제)을 별도 공지할지.
    • defaults의 의도적 null과 적용 마커의 null을 스키마/문서에서 어떻게 구분해 설명할지.

    너의 추천
    parseDesktopProfile에서 적용 마커의 null/비문자열을 unset처럼 취급하고(또는 파싱 전에 strip), 회귀 테스트로 “null 마커 + 다중 providers 문서가 loadConfig에서 providers를 보존”을 고정한다. 가능하면 salvage에도 claudeCode/desktopProfile을 넣어 마커 오류가 다시 전체 기본값으로 떨어지지 않게 한다. 저장 경로를 감사해 JSON에 appliedFingerprint: null을 남기지 않게 한 뒤, 2.52→현재 업그레이드 사용자를 위한 한 줄 복구 안내를 이슈/릴리즈에 붙인다.

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

  3. added a commit that references this issue on Sep 13, 2026
  4. lidge-jun commented on Sep 13, 2026

    @lidge-jun
    Owner

    Fixed on dev via #4479, merged inside lane I2's tip #4482 (merge commit 990cd8c).

    appliedFingerprint=null is no longer treated as fatal. The landing also narrows the reset path, because the severe part of this report was not the null check but the blast radius: one invalid field replacing an entire configuration with defaults.

    Cross-platform CI run 34745142783 concluded success on the exact merged head. Closing manually because this merges into dev rather than the default branch.

  5. added a commit that references this issue on Sep 13, 2026
    d643ddf
  6. added 2 commits that reference this issue on Sep 17, 2026
    1c70990
    8648ba5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcli

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions