Repository navigation
fix(tui): restore provider auth in installed local mode - #119283
Conversation
|
Codex review: needs maintainer review before merge. Reviewed August 4, 2026, 5:25 PM ET / 21:25 UTC. ClawSweeper reviewWhat this changesThe PR centralizes OpenClaw CLI child-process resolution for local TUI authentication and auto-reply, with built-CLI PTY coverage for auth recovery. Merge readinessKeep open. Current main still contains the installed-TUI relative launcher path; the exact PR head replaces it with a shared package-root resolver, fixes the prior inspector-flag finding, and has no concrete correctness or security finding. Protected maintainer handling and remaining exact-head CI should complete before merge. Priority: P2 Review scores
Verification
How this fits togetherThe local TUI starts an OpenClaw child process for provider authentication. That child must resolve the installed package entry and working directory, then return users to their local chat session. flowchart LR
A[Installed local TUI] --> B[Provider auth command]
B --> C[Shared CLI invocation resolver]
C --> D[Provider auth child]
D --> E[Credential storage]
E --> F[Resumed local chat]
Before merge
Agent review detailsSecurityNone. PR surfaceSource -9, Tests +278, Other +39. Total +308 across 10 files. View PR surface stats
Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Merge the shared resolver after exact-head CI is green, retaining the built local PTY regression that exercises provider authentication and resumed chat. Do we have a high-confidence way to reproduce the issue? Yes, from source: current main derives the auth wrapper relative to the compiled TUI module although the packaged CLI lives at the package root. The supplied exact-head built PTY proof exercises the repaired path. Is this the best way to solve the issue? Yes. Reusing package-root discovery in one resolver is the narrowest maintainable fix because TUI and auto-reply otherwise retain divergent launcher policies. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 8fc44585931d. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
5271022 to
869afef
Compare
Punchcard-Session: ember-workshop-lantern-bs
Punchcard-Session: ember-workshop-lantern-bs
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Punchcard-Session: ember-workshop-lantern-bs
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Punchcard-Session: ember-workshop-lantern-bs
|
@clawsweeper re-review |
|
🦞👀 Command router queued. I will update this comment with the next step. |
|
Merged via squash.
|
Punchcard-Session: crisp-lantern-orchard-nv * origin/main: perf(memory): defer session backfill runtime (#119372) fix(ci): isolate built TUI PTY fixture (#119339) fix(commands): restore tool inventory for dynamic models (#119306) fix(media): release rejected BytePlus and Runway video downloads under debug capture (#119257) docs: add ChromeOS (Crostini) platform install guide (#107663) test(msteams): serve JWKS from in-process server in auth coverage (#119354) fix(qa): enable OpenAI for stored audio scenario (#119349) test(agents): realpath apply-patch temp dir fixture (#119353) test(slack): drop redundant .js-suffixed system-event mock (#119352) fix(exec): leave safe builtins unrewritten in enforced mode (#119351) fix(sessions): keep gateway responsive while large transcript archives are built (#112424) fix(tui): restore provider auth in installed local mode (#119283)
…time * origin/main: (75 commits) fix(commands): restore tool inventory for dynamic models (#119306) fix(media): release rejected BytePlus and Runway video downloads under debug capture (#119257) docs: add ChromeOS (Crostini) platform install guide (#107663) test(msteams): serve JWKS from in-process server in auth coverage (#119354) fix(qa): enable OpenAI for stored audio scenario (#119349) test(agents): realpath apply-patch temp dir fixture (#119353) test(slack): drop redundant .js-suffixed system-event mock (#119352) fix(exec): leave safe builtins unrewritten in enforced mode (#119351) fix(sessions): keep gateway responsive while large transcript archives are built (#112424) fix(tui): restore provider auth in installed local mode (#119283) fix(release): accept legacy empty core artifacts (#119337) fix(qa): carry selected runtime into flow scenarios (#119324) fix(ci): retry interrupted Windows dashboard release checks (#119095) fix(release): filter validation ancestry fetch (#119334) fix(release): accept trusted extended-stable validation evidence (#119264) fix(sessions): preserve recorder-owned user turns (#119307) perf(cli): split plugin registry startup timing (#119318) fix(qa): align release scenario setup and compaction proof (#119188) fix(ci): avoid duplicate Matrix release QA runs (#119171) perf(agents): reuse provider policy manifest registry (#119305) ...
) * test(tui): cover local recovery and auth flows * fix(tui): restore installed local auth * test(qa): allow TUI scenario teardown margin Punchcard-Session: ember-workshop-lantern-bs * fix(tui): constrain local CLI launcher ownership Punchcard-Session: ember-workshop-lantern-bs * fix(tui): satisfy local auth validation gates Punchcard-Session: ember-workshop-lantern-bs * fix(tui): strip inspector flags from auth child Punchcard-Session: ember-workshop-lantern-bs
What Problem This Solves
Fixes an issue where users running the installed TUI in local mode could start
/auth, but the real provider-auth child failed before prompting because the built TUI bundle derived../../openclaw.mjsabove the installed OpenClaw package.The failure interrupted provider authentication instead of returning the user to the unchanged local model and a working chat turn.
Why This Change Was Made
The current-CLI invocation policy now has one canonical owner in
src/infra/openclaw-cli-invocation.ts, shared by TUI and auto-reply. It resolves the package withresolveOpenClawPackageRootSync, preserves Node, Bun, source-checkout, built/package,execArgv, package-entry, and symlinked-launcher behavior, and returns the canonical package-root cwd.The final ownership repair also preserves a basename launcher only when
entryPackageRootproves it belongs to an OpenClaw package. A foreign/other/openclaw.mjsnow falls back to the canonical current package CLI.Best-fix verdict: this is the correct owner-boundary repair because TUI and auto-reply need the same current-package launch policy. Rejected alternatives were a PTY-only cwd/env workaround, retaining the relative
import.meta.urlwrapper guess, duplicating the policy in TUI, or importing auto-reply into TUI.User Impact
Installed local TUI users can complete provider
/auth, resume the TUI on the unchanged primary model, and immediately complete a local model-backed turn. Config repair and validation-abort recovery remain functional without a Gateway.Release note: Fixed provider authentication in installed local TUI mode, broken since
v2026.4.22, so/authresolves the current OpenClaw package and resumes local chat successfully.No
CHANGELOG.mddelta is included, per contributor policy.Evidence
Exact source
ef11eae39b29ad9c4123ba211ef4fa4ac005221cfdb70cd2dffca64dc1b77dd95db1e2c874b0576c5ec3e6673b6c89a87db419abb95f39c65f7d3b7aember-workshop-lantern-bsCoverage and unique assertions
tui.embedded-local-chatTUI PTY real backends drives and steers the real local backend with a mocked model endpointtui.config-repair-loopTUI PTY real backends repairs isolated config through the approved built CLI and resumes local chattui.gateway-free-recoveryTUI PTY real backends renders safe validation-loop abort diagnostics through the real local backendtui.local-auth-flowTUI PTY real backends authenticates a manifest-discovered provider and resumes the unchanged local modelThe proof matrix contains exactly one matched assertion for each ID and four distinct matched assertions. The scenario outer timeout is
720000ms, leaving startup and teardown margin around the four serial150000ms cases.Validation
v24.18.086 passed, 0 failed; infra CLI invocation7 passed, 0 failed; auto-reply command quoting/invocation2 passed, 0 failedrun_42c28e27c692tui-local-runtime-recovery-ptyscenario at runtime-proof head:4 passed, 0 failed, 17 skipped, AWS runrun_f7b04a8a08381 passed, 0 failedremote-3.2-t05-exact-8e6f16a-node24-20260804f34eb7a94ef935d25108298869eaa10cd88060fe2983e2b49a734a13ce9dfac1Stable Bun
1.3.14is supported for install/package-script and launcher compatibility testing, not as an OpenClaw CLI host because it lacksnode:sqlite. Its launcher rejection before PR code loads is expected; the required exact-head Bun proof ischecks-fast-bun-launcher.Prerequisite install run
run_7da70c42f3d2completed dependencies and package hooks and printedDone in 46.4s, but pnpm did not return before the hard outer timeout. Exit124is diagnostic only. The passing build reused the same exact lease without reinstall or resync.Production delta
src/infra/openclaw-cli-invocation.ts:+93/-0src/auto-reply/reply/commands-openclaw-cli.ts:+3/-73src/tui/tui-exec-argv.ts:+34/-0src/tui/tui-launch.ts:+1/-34src/tui/tui.ts:+20/-53+151/-160, net-9The positive infra delta establishes the canonical invocation owner; the TUI leaf helper preserves one child-process policy while duplicate launch logic remains removed.