gateway: fix global Control UI 404s for symlinked wrappers and pnpm hardlinks#39856
gateway: fix global Control UI 404s for symlinked wrappers and pnpm hardlinks#39856LarytheLord wants to merge 5 commits intoopenclaw:mainfrom
Conversation
Greptile SummaryThis PR makes Control UI asset path resolution symlink-aware, fixing a regression where Key changes:
The implementation correctly handles symlink resolution with try/catch guards and proper multi-candidate fallback logic. Confidence Score: 4/5
Last reviewed commit: ef6ab03 |
|
AI-generated review note. This looks partial, not a full fix for the reported 404 regressions. The PR improves Control UI asset discovery for symlinked Bun/global wrappers in The remaining likely failure path is deeper in file-open validation / boundary checks when serving assets from package-store layouts (pnpm/global-store hardlink-heavy installs), not just argv1 resolution. So this may be OK as a narrow wrapper-discovery improvement, but it should not be treated as the fix for |
|
Thanks for calling this out — agreed the first revision was too narrow for the full I pushed a follow-up in commit What changed:
Added regression coverage:
This now exercises the explicit-root HTTP path directly, not only argv1 discovery. |
62424b6 to
66429ef
Compare
|
Follow-up to unblock CI:
This addresses the failing |
|
Addressed the failing This is only a baseline line-number sync from detect-secrets (no functional code changes). |
98c57cb to
b20f9e6
Compare
|
Rebased this branch onto latest The only conflict was |
b20f9e6 to
811b559
Compare
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
11 similar comments
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
9 similar comments
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Closing this PR because it looks dirty (too many unrelated or unexpected changes). This usually happens when a branch picks up unrelated commits or a merge went sideways. Please recreate the PR from a clean branch. |
|
Superseded by #40385. Barnacle closed this branch because the prep push picked up unrelated repo-wide changes. I recreated the Control UI fix on a clean branch from current
The replacement PR is here: #40385 |
Summary
Fixes the bundled Control UI
404 Not Foundregression for global installs while preserving the configured-root hardlink boundary:~/.bun/bin/openclaw) where unresolvedargv1can miss the realdist/control-uipathWhy
Reports in #39693 and #39621 show dashboard
404despite valid assets on disk.gateway.controlUi.rootshould remain on the stricter hardlink boundary rather than inheriting special trust from a path shapeChanges
1) Symlink-aware asset discovery
src/infra/control-ui-assets.tspath.resolve(argv1)andrealpath(argv1)candidatesresolveControlUiRootSync2) Bundled vs resolved root handling
src/gateway/server.impl.tsgateway.controlUi.rootoverrides asresolvedbundledsrc/gateway/control-ui.tsbundledrootsresolvedroots3) Regression tests
src/infra/control-ui-assets.test.tsargv1casessrc/gateway/control-ui.http.test.tssrc/gateway/control-ui.auto-root.http.test.tssrc/gateway/server.control-ui-root.test.tsgateway.controlUi.rootwith a package-store hardlinked index still returns404Validation
pnpm test -- src/infra/control-ui-assets.test.ts src/gateway/control-ui.http.test.ts src/gateway/control-ui.auto-root.http.test.ts src/gateway/server.control-ui-root.test.tsFixes #39693
Refs #39621