Skip to content

fix: keep configured model rows unchanged when you sign in to a provider again - #201742

Merged
obviyus merged 2 commits into
openclaw:mainfrom
MertBasar0:fix/issue-201558-oauth-config
Nov 21, 2026
Merged

obviyus merged 2 commits into
openclaw:mainfrom
MertBasar0:fix/issue-201558-oauth-config

Conversation

@MertBasar0

@MertBasar0 MertBasar0 commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Root cause: src/config/merge-patch.ts:44 - in ID-keyed array mode, createMergePatch applied each complete target row as a merge patch before diffing it. Applying a patch deletes null values, so unchanged thinkingLevelMap.off: null came out as a deletion delta, and provider sign-in wrote that delta into openclaw.json.

Fixes #201558

Thanks @Caitoz for the precise report and leaf diff, and @MertBasar0 for the fix.

What Problem This Solves

Signing in again with openclaw models auth login --provider openai --method oauth while the Gateway runs should only save the credential. Instead it rewrote configured OpenAI model rows. Rows without a thinkingLevelMap gained thinkingLevelMap: {}, which hides the bundled map. Rows with an explicit map lost off: null, so "off" showed up again for models that reject it.

User Impact

User impact: a provider re-login no longer touches models.providers.*.models. Authored null thinking-level entries and absent maps stay exactly as written. Real changes from a login, such as adding a default model entry, are still saved.

Why This Change Was Made

Sign-in computes its config change by diffing the Gateway's runtime view before and after the login. That view fills each row's catalog thinkingLevelMap (including off: null). For a credential-only login both sides are identical, so the change should be empty. The ID-keyed diff applied the target row as a patch first, which dropped every null, so each row reported thinkingLevelMap: { off: null }. Applying that to the authored config created {} on rows without a map and removed off: null from rows with one. The fix diffs the matched row directly (one line, net -4). Nothing else changes for the provider-auth caller, the only one that diffs with ID-keyed arrays. Inside a matched row, a key the target removed now shows up as a deletion, the same as at every other level.

Evidence

Real built CLI and Gateway with isolated state, a loopback OAuth fixture (no real account) and the issue's config shape. The test runs the real models auth login --provider openai --method oauth and pastes the redirect URL at the CLI prompt. Full observed output: #201742 (comment)

  • Base 072117b196ae: the login succeeds. Then openclaw.json gains "thinkingLevelMap": {} on gpt-6-astra and gpt-6.1-sol and loses "off": null on both catalog-missing rows. The Gateway logs config change detected; evaluating reload (models.providers.openai.models, meta).
  • This PR: the same login succeeds and openclaw.json stays byte-identical (models section diff empty).
  • Controls on this PR: a fresh login with no model rows leaves openclaw.json byte-identical. An offline login still writes its real agents.defaults.models addition while the model rows stay byte-identical (base corrupts the rows on this path too).
  • Upgrade from released v2026.11.6: the profile and config written by 11.6 load on this PR (config valid, profile listed). The online re-login keeps openclaw.json byte-identical (models and agents match what 11.6 left), and a turn with the saved credential succeeds on the fixture backend. Output: fix: keep configured model rows unchanged when you sign in to a provider again #201742 (comment)
  • Regression: src/config/merge-patch.test.ts fails on base (thinkingLevelMap: { off: null } emitted, removed key not emitted) and passes here.

Merge danger: two-way door. It changes only how config deltas are computed, and a revert restores the old diff. Blast radius: provider sign-in config writes, the only caller of ID-keyed createMergePatch.

@clawsweeper

clawsweeper Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@MertBasar0
MertBasar0 marked this pull request as ready for review November 19, 2026 08:59
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Nov 19, 2026
@clawsweeper

clawsweeper Bot commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR compares model rows directly when computing sign-in configuration changes, preserving unchanged null-valued settings.

Example: Run openclaw models auth login --provider openai --method oauth with an existing model row containing thinkingLevelMap.off: null.

  • Before: Sign-in removes off: null from the saved row.
  • After: Credential-only sign-in leaves the configuration byte-identical.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) A minimal root-cause repair with a base-failing regression, shipped-entry-point proof, latest-stable upgrade evidence, and passing exact-head CI.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): Exact-head built CLI and Gateway output exercises real sign-in through loopback OAuth endpoints, preserves authored model rows, covers fresh and offline login controls, and verifies latest-stable state survives upgrade and re-login; this resolves the prior review's upgrade gap.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Signing in again silently rewrites saved model settings and can restore thinking levels the user explicitly excluded.
Reason: The patch restores documented configuration preservation with one production-line replacement, and the original feature contributor has reviewed and exercised the repair.

Merge readiness

✅ Ready for maintainer review

Keep open for merge: this PR fixes a current configuration-preservation bug with a minimal owner-level change, and no actionable defects remain.

Priority: P2
Reviewed head: dcad9593cfd058ff10d279c81f365687293c9c2f

Before merge

None.

Findings

None.

Agent review details

How this fits together

Provider sign-in merges its result into a normalized configuration snapshot, computes a delta, and replays that delta against current authored settings after conflict checks.

flowchart LR
  A[Provider sign-in result] --> B[Normalize and merge auth changes]
  C[Original configuration snapshot] --> B
  B --> D[Compute configuration delta]
  C --> D
  D --> E[Check current settings for conflicts]
  E --> F[Write authored configuration]
Loading

Technical review

Best possible solution:

Merge the direct row comparison and focused regression through the existing configuration delta owner.

Do we have a high-confidence way to reproduce the issue?

Current-main source deterministically generates deletion deltas for unchanged null-valued model metadata; supplied built CLI/Gateway traces reproduce the failure on the pinned base and demonstrate preservation on this head.

Is this the best way to solve the issue?

Direct snapshot comparison fixes the producer without changing merge-patch deletion semantics, duplicating ownership, or bypassing concurrent-setting checks.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against a8fb9e5670bf.

Provenance checked

  • ID-keyed configuration delta construction changes intended behavior with a stated reason (54c3655: Preserve concurrent settings and model-ID upserts during provider login; the PR explains and demonstrates why treating a complete target row as a patch corrupts meaningful null values.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Ayaan Zaidi: Raw commit 54c3655 adds src/config/merge-patch.ts:20 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 54c3655e12a6; files: src/config/merge-patch.ts)
  • Peter Steinberger: Raw commit f2e0c54 adds src/config/merge-patch.ts:22 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: f2e0c54bec17; files: src/config/merge-patch.ts)
  • Vignesh Natarajan: Raw commit 8ec0ef5 adds src/config/merge-patch.ts:21 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 8ec0ef586660; files: src/config/merge-patch.ts)

PR surface

Source -4, Tests +14. Total +10 across 2 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 1 5 -4
Tests 1 15 1 +14
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 16 6 +10

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient.
  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove rating: 🦪 silver shellfish: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.
  • remove status: 📣 needs proof: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: Provider re-login silently alters advanced model configuration, with a restoration workaround and no demonstrated core outage.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (2 earlier review cycles)
  • reviewed 2026-11-19T09:15:34.616Z sha 5f5360c :: needs real behavior proof before merge. :: none
  • reviewed 2026-11-21T12:36:03.286Z sha dcad959 :: needs real behavior proof before merge. :: none

Reviewed November 21, 2026, 8:45 AM ET / 13:45 UTC (Revision 3).

@obviyus

obviyus commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator

Observed proof for #201558 on head dcad959 (base 072117b). Real built CLI + Gateway (dist), isolated state, loopback OAuth fixture (no real account), real openclaw models auth login --provider openai --method oauth with the Gateway running (credential-only).

Harness: proofs/201558/run.sh (+ drive-login.py, fake-bin/open, fixture-server.mjs, preload.mjs, write-oauth-profile.mts).
Real built CLI + Gateway (node dist/entry.js, tier dist-nodts), --profile p201558<label>, task-owned OPENCLAW_HOME/STATE_DIR/CONFIG_PATH
under /tmp (config file checked to be inside the task dir). A loopback fixture serves auth.openai.com (authorize + token, fixture JWT,
account acct_p201558) and chatgpt.com/backend-api; the preload refuses every other remote fetch. An existing ChatGPT OAuth profile is
stored first.
Config (issue shape): models.providers.openai (baseUrl chatgpt.com/backend-api/codex) rows gpt-6-astra, gpt-6.1-sol (catalog-covered,
no map), gpt-6.9-p201558-astra, gpt-6.9-p201558-sol (catalog-missing, thinkingLevelMap {off:null, minimal:low, xhigh:xhigh, max:max}).
Login: `openclaw models auth login --provider openai --method oauth` in a pty with the Gateway running (credential-only models.authLogin).
At the CLI's paste prompt, the driver pastes redirect_uri?code=<fixture>&state=<state from the printed authorize URL>.

BASE 072117b196ae (ocx base, dist-nodts), label base-rows:
  CLI: Provider sign-in saved and connection update confirmed by the Gateway. (exit 0)
  Gateway: Auth profile: openai:[email protected] (openai/oauth)
           [reload] config change detected; evaluating reload (models.providers.openai.models, meta)
  openclaw.json diff: gpt-6-astra + "thinkingLevelMap": {} ; gpt-6.1-sol + "thinkingLevelMap": {} ; both gpt-6.9 rows - "off": null ; + meta stamp
  rows after: [{"id":"gpt-6-astra","thinkingLevelMap":{}},{"id":"gpt-6.1-sol","thinkingLevelMap":{}},
               {"id":"gpt-6.9-p201558-astra","thinkingLevelMap":{"minimal":"low","xhigh":"xhigh","max":"max"}},{"id":"gpt-6.9-p201558-sol",...same}]

CANDIDATE dcad9593cf (ocx build --dist, dist-nodts), label cand-rows, same harness:
  CLI: Provider sign-in saved and connection update confirmed by the Gateway. (exit 0)
  Gateway: Auth profile: openai:[email protected] (openai/oauth); no config reload line
  openclaw.json byte-identical; models section byte-diff: (empty)
  rows after: gpt-6-astra/gpt-6.1-sol no map; both gpt-6.9 rows {"off":null,"minimal":"low","xhigh":"xhigh","max":"max"}

CONTROL fresh login, no existing rows (candidate, label cand-fresh, Gateway running): sign-in saved, profile stored,
  openclaw.json byte-identical.
CONTROL a real change is still written. Offline login (Gateway stopped, so a full local login whose auth result adds
  agents.defaults.models["openai/gpt-6-astra"]); fake-bin/open completes the browser redirect:
  candidate cand-offline: openclaw.json gains agents.defaults.models {"openai/gpt-6-astra": {}} (+ meta); models section byte-diff (empty).
  base base-offline: the same agents.defaults.models addition, PLUS rows gain {} and lose off: null (same producer on the offline path).
CONTROL a newly removed key on a matched id row still emits null (unit, src/config/merge-patch.test.ts):
  base {name:"Old", contextTokens:1, thinkingLevelMap:{off:null}} -> target {name:"New", thinkingLevelMap:{off:null}}
  => patch {id, name:"New", contextTokens:null}; applyMergePatch round-trips to the target.

Unit regression (vitest-source): src/config/merge-patch.test.ts "diffs id-keyed rows without dropping unchanged nulls"
  base 072117b196ae: FAIL (Received thinkingLevelMap: {off: null}, missing contextTokens: null), 1 failed | 3 passed
  candidate: merge-patch.test.ts + provider-auth-config.test.ts pass.

@obviyus obviyus changed the title fix(config): provider OAuth re-login drops null thinkingLevelMap entries fix: keep configured model rows unchanged when you sign in to a provider again Nov 21, 2026
@obviyus

obviyus commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Nov 21, 2026
@obviyus

obviyus commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator

Upgrade proof for #201558: released v2026.11.6 state, then this PR's head dcad959 on the same state. Real built CLI and Gateway (dist), isolated state, loopback OAuth and ChatGPT backend fixture (fixture JWT, no real account), managed Codex pointed at the fixture. No doctor command was run.

phase 1: OpenClaw 2026.11.6 (06afb10)
  config: issue shape (gpt-6-astra, gpt-6.1-sol without thinkingLevelMap; gpt-6.9-p201558-astra/-sol with {off:null, minimal:low, xhigh:xhigh, max:max})
  store ChatGPT OAuth profile openai:p201558 with the 11.6 build's own store code
  gateway run -> ready; stop -> port free
  models auth list (offline) -> openai:p201558 [openai/oauth; expires 2036-01-01T00:00:00.000Z]
  sha256 openclaw.json after 11.6: 82af5ac67172a5b1 (= authored seed 82af5ac67172a5b1)
phase 2: candidate dcad959, same state dir and config
  config validate -> Config valid
  models auth list (offline) -> openai:p201558 [openai/oauth; expires 2036-01-01T00:00:00.000Z]
  gateway run -> ready
  models auth login --provider openai --method oauth (online, credential-only; redirect URL pasted at the CLI prompt)
    -> Provider sign-in saved and connection update confirmed by the Gateway.
  openclaw.json before -> after login: byte-identical (sha256 c3eba2123011cd26 -> c3eba2123011cd26); models section diff: (empty)
  rows after: gpt-6-astra / gpt-6.1-sol no map; both gpt-6.9 rows {"off":null,"minimal":"low","xhigh":"xhigh","max":"max"}
  infer model run --gateway --agent main --model openai/gpt-6.1-sol
    -> {"ok":true,"provider":"openai","model":"gpt-6.1-sol","text":"TERRA-FIXTURE-OK"}
    fixture: POST /backend-api/codex/responses model=gpt-6.1-sol account=acct_p201558 bearer=fixture-jwt
  config written by 11.6 vs after the candidate login: .models identical, .agents identical. Only the candidate
  Gateway's own startup stamps changed (meta.lastTouchedVersion/migrations, plugins.entries.openai.enabled,
  wizard.lastRun*), and they were already present before the login.

@obviyus

obviyus commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Nov 21, 2026
@obviyus
obviyus merged commit 83feebf into openclaw:main Nov 21, 2026
143 of 146 checks passed
@obviyus

obviyus commented Nov 21, 2026

Copy link
Copy Markdown
Collaborator

Merged in 83feebf. Thanks @MertBasar0 for the fix and @Caitoz for the precise report in #201558. Signing in to a provider again no longer rewrites configured model rows in openclaw.json: rows without a thinkingLevelMap stay without one, and explicit null entries such as off: null are kept. The config merge no longer turns an unchanged null into a deletion, so a credential-only sign-in writes only the auth change.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 22, 2026
…der again (openclaw#201742)

Root cause: `src/config/merge-patch.ts:44` - in ID-keyed array mode, `createMergePatch` applied each complete target row as a merge patch before diffing it. Applying a patch deletes `null` values, so unchanged `thinkingLevelMap.off: null` came out as a deletion delta, and provider sign-in wrote that delta into `openclaw.json`.

Fixes openclaw#201558

Thanks @Caitoz for the precise report and leaf diff, and @MertBasar0 for the fix.

## What Problem This Solves

Signing in again with `openclaw models auth login --provider openai --method oauth` while the Gateway runs should only save the credential. Instead it rewrote configured OpenAI model rows. Rows without a `thinkingLevelMap` gained `thinkingLevelMap: {}`, which hides the bundled map. Rows with an explicit map lost `off: null`, so "off" showed up again for models that reject it.

## User Impact

User impact: a provider re-login no longer touches `models.providers.*.models`. Authored `null` thinking-level entries and absent maps stay exactly as written. Real changes from a login, such as adding a default model entry, are still saved.

## Why This Change Was Made

Sign-in computes its config change by diffing the Gateway's runtime view before and after the login. That view fills each row's catalog `thinkingLevelMap` (including `off: null`). For a credential-only login both sides are identical, so the change should be empty. The ID-keyed diff applied the target row as a patch first, which dropped every `null`, so each row reported `thinkingLevelMap: { off: null }`. Applying that to the authored config created `{}` on rows without a map and removed `off: null` from rows with one. The fix diffs the matched row directly (one line, net -4). Nothing else changes for the provider-auth caller, the only one that diffs with ID-keyed arrays. Inside a matched row, a key the target removed now shows up as a deletion, the same as at every other level.

## Evidence

Real built CLI and Gateway with isolated state, a loopback OAuth fixture (no real account) and the issue's config shape. The test runs the real `models auth login --provider openai --method oauth` and pastes the redirect URL at the CLI prompt. Full observed output: openclaw#201742 (comment)

- Base `92fb63c54e31`: the login succeeds. Then `openclaw.json` gains `"thinkingLevelMap": {}` on `gpt-6-astra` and `gpt-6.1-sol` and loses `"off": null` on both catalog-missing rows. The Gateway logs `config change detected; evaluating reload (models.providers.openai.models, meta)`.
- This PR: the same login succeeds and `openclaw.json` stays byte-identical (models section diff empty).
- Controls on this PR: a fresh login with no model rows leaves `openclaw.json` byte-identical. An offline login still writes its real `agents.defaults.models` addition while the model rows stay byte-identical (base corrupts the rows on this path too).
- Upgrade from released v2026.11.6: the profile and config written by 11.6 load on this PR (config valid, profile listed). The online re-login keeps `openclaw.json` byte-identical (models and agents match what 11.6 left), and a turn with the saved credential succeeds on the fixture backend. Output: openclaw#201742 (comment)
- Regression: `src/config/merge-patch.test.ts` fails on base (`thinkingLevelMap: { off: null }` emitted, removed key not emitted) and passes here.

Merge danger: two-way door. It changes only how config deltas are computed, and a revert restores the old diff. Blast radius: provider sign-in config writes, the only caller of ID-keyed `createMergePatch`.

Co-authored-by: Ayaan Zaidi <[email protected]>
tideclaw-bot pushed a commit that referenced this pull request Nov 24, 2026
…der again (#201742)

Root cause: `src/config/merge-patch.ts:44` - in ID-keyed array mode, `createMergePatch` applied each complete target row as a merge patch before diffing it. Applying a patch deletes `null` values, so unchanged `thinkingLevelMap.off: null` came out as a deletion delta, and provider sign-in wrote that delta into `openclaw.json`.

Fixes #201558

Thanks @Caitoz for the precise report and leaf diff, and @MertBasar0 for the fix.

## What Problem This Solves

Signing in again with `openclaw models auth login --provider openai --method oauth` while the Gateway runs should only save the credential. Instead it rewrote configured OpenAI model rows. Rows without a `thinkingLevelMap` gained `thinkingLevelMap: {}`, which hides the bundled map. Rows with an explicit map lost `off: null`, so "off" showed up again for models that reject it.

## User Impact

User impact: a provider re-login no longer touches `models.providers.*.models`. Authored `null` thinking-level entries and absent maps stay exactly as written. Real changes from a login, such as adding a default model entry, are still saved.

## Why This Change Was Made

Sign-in computes its config change by diffing the Gateway's runtime view before and after the login. That view fills each row's catalog `thinkingLevelMap` (including `off: null`). For a credential-only login both sides are identical, so the change should be empty. The ID-keyed diff applied the target row as a patch first, which dropped every `null`, so each row reported `thinkingLevelMap: { off: null }`. Applying that to the authored config created `{}` on rows without a map and removed `off: null` from rows with one. The fix diffs the matched row directly (one line, net -4). Nothing else changes for the provider-auth caller, the only one that diffs with ID-keyed arrays. Inside a matched row, a key the target removed now shows up as a deletion, the same as at every other level.

## Evidence

Real built CLI and Gateway with isolated state, a loopback OAuth fixture (no real account) and the issue's config shape. The test runs the real `models auth login --provider openai --method oauth` and pastes the redirect URL at the CLI prompt. Full observed output: #201742 (comment)

- Base `072117b196ae`: the login succeeds. Then `openclaw.json` gains `"thinkingLevelMap": {}` on `gpt-6-astra` and `gpt-6.1-sol` and loses `"off": null` on both catalog-missing rows. The Gateway logs `config change detected; evaluating reload (models.providers.openai.models, meta)`.
- This PR: the same login succeeds and `openclaw.json` stays byte-identical (models section diff empty).
- Controls on this PR: a fresh login with no model rows leaves `openclaw.json` byte-identical. An offline login still writes its real `agents.defaults.models` addition while the model rows stay byte-identical (base corrupts the rows on this path too).
- Upgrade from released v2026.11.6: the profile and config written by 11.6 load on this PR (config valid, profile listed). The online re-login keeps `openclaw.json` byte-identical (models and agents match what 11.6 left), and a turn with the saved credential succeeds on the fixture backend. Output: #201742 (comment)
- Regression: `src/config/merge-patch.test.ts` fails on base (`thinkingLevelMap: { off: null }` emitted, removed key not emitted) and passes here.

Merge danger: two-way door. It changes only how config deltas are computed, and a revert restores the old diff. Blast radius: provider sign-in config writes, the only caller of ID-keyed `createMergePatch`.

Co-authored-by: Ayaan Zaidi <[email protected]>
(cherry picked from commit 83feebf)

Companion disposition: createProviderAuthConfigPatch is the existing ID-keyed diff caller; applyMergePatch and prototype guards are unaffected and present-equivalent. No later same-path or PR follow-ups.

Co-authored-by: RomneyDa <[email protected]>
tideclaw-bot added a commit that referenced this pull request Nov 24, 2026
…der again (#201742)

Baseline adaptation: Apply the matched-row diff directly with the existing provider-auth config owner; no merge application change.

(cherry picked from commit 83feebf)

Co-authored-by: RomneyDa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

2 participants