fix(macos): skip unresolved dashboard auth templates#101375
Conversation
|
Codex review: stale review; fresh review needed. Summary Next step Review history (8 earlier review cycles)
|
41eaef2 to
7467386
Compare
|
@clawsweeper re-review I pushed |
|
🦞🧹 I asked ClawSweeper to review this item again. |
7467386 to
5e49845
Compare
104a877 to
0006394
Compare
0006394 to
2e00abe
Compare
|
@clawsweeper re-review Current head is |
|
🦞🧹 I asked ClawSweeper to review this item again. |
620842d to
46e8fb9
Compare
|
Quick status update while refreshing proof for this PR:
So I am not refreshing this PR branch yet to avoid stacking an unmerged dependency into it. Once #101611 lands, I will rebase this PR onto current |
46e8fb9 to
0324d55
Compare
0324d55 to
3e1c9a6
Compare
|
Land-ready proof for exact head
No before/after screenshot: this changes credential-source routing, not pixels or layout; a screenshot would expose no meaningful behavioral difference and could risk showing auth material. |
|
Merged via squash.
|
* fix(macos): skip unresolved auth env templates * fix(macos): align gateway auth env refs * fix(macos): resolve dashboard refs from service env * fix(macos): read generated gateway service env * chore: keep release changelog owner-only --------- Co-authored-by: Peter Steinberger <[email protected]>
What Problem This Solves
Fixes #101286.
macOS OpenClaw.app could treat
gateway.auth.token: "${OPENCLAW_GATEWAY_TOKEN}"as a literal local dashboard token when the GUI app environment did not contain that variable. That bypassed the LaunchAgent token fallback and produced a dashboard URL with an encoded placeholder fragment instead of a usable token.Why This Change Was Made
${NAME}and$NAME, withNAMEmatching^[A-Z][A-Z0-9_]{0,127}$.${custom_gateway_token}as plaintext, matching the core SecretInput parser instead of introducing a broader Swift-only grammar.User Impact
Users launching OpenClaw.app from Finder/Dock can recover when the gateway token only exists in the per-user LaunchAgent environment. The dashboard URL uses the resolved LaunchAgent token when available, or omits token auto-auth instead of passing a raw placeholder. Existing literal strings that are not valid env SecretRefs continue to be treated as plaintext.
Evidence
origin/main(942b4496) and pushed head2e00abe3.src/config/types.secrets.ts:ENV_SECRET_TEMPLATE_RE,ENV_SECRET_SHORTHAND_RE, andENV_SECRET_REF_ID_REaccept only${NAME}/$NAMEuppercase env ids.docs/gateway/secrets.md: public SecretRef docs list both${OPENAI_API_KEY}and$OPENAI_API_KEY, with id validation^[A-Z][A-Z0-9_]{0,127}$.GatewayEndpointStoreTestscoverage for${NAME}LaunchAgent fallback,$NAMELaunchAgent fallback, app-env template resolution, invalid lowercase template as plaintext, unresolved-template omission from the dashboard URL, and password fallback.2e00abe3:macos-swiftsucceeded and ranswift test --package-path apps/macos --parallel --enable-code-coverage --show-codecov-pathsuccessfully. Check: https://github.com/openclaw/openclaw/actions/runs/28859753269/job/85595172193macos-nodeandnative-i18nalso passed on the same run: https://github.com/openclaw/openclaw/actions/runs/28859753269/job/85595172221 and https://github.com/openclaw/openclaw/actions/runs/28859753269/job/85595172145Real behavior proofcheck passed on the current head: https://github.com/openclaw/openclaw/actions/runs/28859751829/job/85595097589git diff --checkpassed locally.cd apps/macos && swift test --parallel --filter GatewayEndpointStoreTestswas also attempted under Apple Swift 6.2.4 on macOS 15.0, but the local environment hit unrelated strict-concurrency diagnostics inapps/shared/OpenClawKit/Sources/OpenClawChatUI/ChatTranscriptCache.swiftbefore the filtered tests executed. The upstream macOS CI above is the authoritative validation for this PR.