Skip to content

fix(doctor): repeated no-op OAuth migration prompt and swallowed migration error cause - #123164

Merged
steipete merged 1 commit into
mainfrom
codex/autoqa-doctor-sidecar-ux
Aug 14, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/autoqa-doctor-sidecar-ux

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes two openclaw doctor auth-repair UX defects that never converge:

  1. When only unreferenced legacy Codex OAuth sidecar credential files remain (the exact end-state the sidecar flow itself produces after archiving a store), interactive doctor prompted "Migrate legacy Codex OAuth credentials now?" on every run — but the repair loop intentionally never touches unreferenced sidecars, so answering "yes" was a guaranteed no-op, forever.
  2. When the shared legacy oauth.json migration failed (unreadable SQLite store, lock contention, changed source), the warning said only "Failed to migrate shared legacy OAuth credentials; the source was left in place." — no cause, no next step, while gateway startup keeps directing the user back to doctor --fix.

Why This Change Was Made

The confirm gate in src/commands/doctor-auth-oauth-sidecar.ts covered the informational unreferenced-sidecar report, not just actionable stores; gating the prompt on stores.length > 0 matches what the repair loop can actually do. The swallowed error in src/commands/doctor-auth-flat-profiles.ts diverged from its own sibling handler a few lines above (per-candidate failures include ${String(err)}); aligning restores one convention.

User Impact

Operators with leftover sidecar files stop being nagged with a no-op prompt on every doctor run, and a failing shared-OAuth migration now names its cause so the user can act (fix permissions, retry, re-authenticate).

Evidence

  • New regression does not prompt when only unreferenced sidecars remain fails pre-fix (confirmAutoFix called) and passes post-fix; existing warning/no-touch expectations unchanged (9 passed).
  • Strengthened shared-OAuth test asserts the warning now carries a cause suffix; full doctor-auth-flat-profiles.test.ts green (50 passed).
  • Fresh autoreview (codex/gpt-5.6-sol, high): clean, "patch is correct (0.99)".
  • Production LOC delta: sidecar +10/−6, flat-profiles +2/−2 (net +4 prod, all from the actionable-gate block replacing an unconditional prompt; no growth avoidable without losing the unreferenced-sidecar warning contract).

…igration error

Two doctor auth-repair UX defects:

1. When only unreferenced legacy Codex OAuth sidecar files remain (no
   stores with active profiles), doctor prompted 'Migrate legacy Codex
   OAuth credentials now?' on every interactive run even though the
   repair loop never touches unreferenced sidecars — answering yes
   changed nothing, forever. Gate the confirm prompt on actionable
   stores; unreferenced sidecars stay informational warnings.

2. The shared legacy oauth.json migration failure warning discarded the
   underlying error (SQLite unreadable, lock contention, source
   changed), leaving the user with no cause and no next step while the
   gateway stays blocked. Append the cause like the sibling
   per-candidate handler does.
@clawsweeper

clawsweeper Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete
steipete marked this pull request as ready for review August 13, 2026 11:48
@openclaw-barnacle openclaw-barnacle Bot added commands Command implementations size: XS maintainer Maintainer-authored PR labels Aug 13, 2026
@steipete steipete closed this Aug 13, 2026
@steipete steipete reopened this Aug 13, 2026
@steipete steipete closed this Aug 13, 2026
@steipete steipete reopened this Aug 13, 2026
@steipete
steipete merged commit ae14816 into main Aug 14, 2026
282 of 417 checks passed
@steipete
steipete deleted the codex/autoqa-doctor-sidecar-ux branch August 14, 2026 00:54
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

masatohoshino added a commit to masatohoshino/openclaw that referenced this pull request Aug 14, 2026
…ofile archives

maybeMigrateAuthProfileJsonStoresToSqlite discarded the error from
resumePendingAuthProfileMigrationArchives entirely, so the warning was always
the same generic string regardless of which of 5 distinct causes fired
(invalid receipt, target verification failure, lock failure, SQLite failure,
corrupt JSON). PR openclaw#123164 fixed the identical defect class in the sibling
shared-OAuth catch block 20 lines below in this same function, explicitly
modeling the fix on the third, already-correct sibling. This was the
unaddressed third catch block in that same family.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 14, 2026
…igration error (openclaw#123164)

Two doctor auth-repair UX defects:

1. When only unreferenced legacy Codex OAuth sidecar files remain (no
   stores with active profiles), doctor prompted 'Migrate legacy Codex
   OAuth credentials now?' on every interactive run even though the
   repair loop never touches unreferenced sidecars — answering yes
   changed nothing, forever. Gate the confirm prompt on actionable
   stores; unreferenced sidecars stay informational warnings.

2. The shared legacy oauth.json migration failure warning discarded the
   underlying error (SQLite unreadable, lock contention, source
   changed), leaving the user with no cause and no next step while the
   gateway stays blocked. Append the cause like the sibling
   per-candidate handler does.
steipete pushed a commit that referenced this pull request Aug 26, 2026
…ofile archives (#123459)

maybeMigrateAuthProfileJsonStoresToSqlite discarded the error from
resumePendingAuthProfileMigrationArchives entirely, so the warning was always
the same generic string regardless of which of 5 distinct causes fired
(invalid receipt, target verification failure, lock failure, SQLite failure,
corrupt JSON). PR #123164 fixed the identical defect class in the sibling
shared-OAuth catch block 20 lines below in this same function, explicitly
modeling the fix on the third, already-correct sibling. This was the
unaddressed third catch block in that same family.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 26, 2026
…ofile archives (openclaw#123459)

maybeMigrateAuthProfileJsonStoresToSqlite discarded the error from
resumePendingAuthProfileMigrationArchives entirely, so the warning was always
the same generic string regardless of which of 5 distinct causes fired
(invalid receipt, target verification failure, lock failure, SQLite failure,
corrupt JSON). PR openclaw#123164 fixed the identical defect class in the sibling
shared-OAuth catch block 20 lines below in this same function, explicitly
modeling the fix on the third, already-correct sibling. This was the
unaddressed third catch block in that same family.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations maintainer Maintainer-authored PR size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant