Repository navigation
feat(ui): open plugin tabs at short slug URLs such as /reports - #143183
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. Reviewed September 9, 2026, 1:50 PM ET / 17:50 UTC (Revision 6). ClawSweeper reviewWhat this changesAdds short URLs for plugin tabs in the Control UI and moves Team Reports’ default HTTP site to /plugins/team-reports. Merge readiness⛔ Blocked before merge - 1 item remains Keep open: current main does not provide the requested capability, and the prior bootstrap findings are addressed. No new blocking defect was found; the discussion explicitly accepts the documented compatibility tradeoff. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway advertises available plugin tabs to the Control UI after connection. The browser maps their addresses to the existing plugin page, which loads content through the existing authenticated plugin route. flowchart LR
A[Plugin tab descriptor] --> B[Registration validation]
B --> C[Gateway collision checks]
C --> D[Connection handshake]
D --> E[Browser route selection]
F[Sidebar or bookmarked URL] --> E
E --> G[Existing plugin page]
G --> H[Authenticated report content]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +264, Tests +537, Docs +31, Generated 0, Other -1. Total +831 across 40 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Retain the approved separation between short Control UI addresses and authenticated report endpoints, with generic tab fallback and explicit path pinning documented for upgrades. Do we have a high-confidence way to reproduce the issue? Not applicable as a feature request: current main demonstrably uses generic query-based plugin addresses. The earlier cold-link defect has a source-backed repair and reported passing regression coverage. Is this the best way to solve the issue? Yes: the optional descriptor field extends the existing plugin page and routing machinery without adding a competing HTTP or authentication path; the default-path tradeoff is explicitly accepted. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against fc3bb9f5e3a9. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
f19222b to
40e94cd
Compare
|
Addressed the cold trailing-slash finding at the bootstrap owner: The Team Reports HTTP default move is intentional and maintainer-approved. Configurations that omit The optional-field fallback is covered by Gateway projection, sidebar, and plugin-host tests: existing descriptors without a slug keep the generic URL, collisions remove only the advertised slug while retaining the tab/frame path, and native routes retain precedence. No auth or frame-grant policy changed. The docs conflict is resolved by preserving main's overview and placing the slug paragraphs after native-route placement in CI follow-up CI also exposed that the first bootstrap fix was too broad for existing inferred route namespaces. The correction preserves |
Validate optional tab slugs and project them into hello unless a plugin HTTP route shadows the mounted URL. Resolve slugs through the existing plugin host, wait for hello on cold links, and canonicalize generic links while preserving page parameters and fragments. Native routes retain their ownership. Team Reports now opens at /reports and defaults its HTTP site to /plugins/team-reports. Explicit /reports HTTP configurations retain the generic tab URL fallback. Document the SDK and URL contracts and regenerate the config documentation fingerprint for the intended default change.
Break the app-route-paths <-> tab-slugs import cycle by extracting the static route table into app-route-definitions.ts and importing it from both sides. Drop the assertion baseline entry that moved with the table.
f0da403 to
7979baf
Compare
|
Merged via squash.
|
…law#143183) * feat(ui): mount plugin tabs on advertised route slugs Validate optional tab slugs and project them into hello unless a plugin HTTP route shadows the mounted URL. Resolve slugs through the existing plugin host, wait for hello on cold links, and canonicalize generic links while preserving page parameters and fragments. Native routes retain their ownership. Team Reports now opens at /reports and defaults its HTTP site to /plugins/team-reports. Explicit /reports HTTP configurations retain the generic tab URL fallback. Document the SDK and URL contracts and regenerate the config documentation fingerprint for the intended default change. * refactor(ui): move route definitions to a leaf module Break the app-route-paths <-> tab-slugs import cycle by extracting the static route table into app-route-definitions.ts and importing it from both sides. Drop the assertion baseline entry that moved with the table. * fix(ui): preserve root mount for trailing-slash plugin links * test(ui): supply gateway state to workboard route fixture * fix(ui): retain inferred namespaces alongside plugin slug roots * perf(ui): consolidate route paths and plugin slug helpers
What Problem This Solves
Resolves a problem where opening a plugin-provided sidebar tab in the Control UI landed on an opaque address such as
/plugin?plugin=team-reports&id=team-reports. The Team Reports tab on a team Gateway is the visible case: the sidebar entry could not be given a short, shareable path like/reports, because every plugin tab is hosted by the single generic/pluginpage and carries its identity in the query string, and because the plugin's own HTTP report site already owned/reportsahead of the Control UI.Why This Change Was Made
Plugin tab descriptors gain an optional
slug. A tab that advertisesslug: "reports"is mounted by the Control UI at<controlUiBasePath>/reports, the sidebar links there,pageHref/openPageemit it, and the generic/plugin?plugin=…&id=…form is replaced once in browser history while preservingp.*parameters and the fragment. The slug changes only the Control UI address: it registers no HTTP route and touches no authentication or frame-grant behavior. The Gateway validates the grammar and reserved Gateway-owned names at registration (first registration wins for duplicates) and drops a slug from the hello when any plugin HTTP route would shadow the mounted path; the Control UI additionally ignores slugs that collide with native routes, so a plugin can never claim a built-in page. A cold deep link to a slug path waits for the Gateway hello instead of bouncing to chat. Team Reports declares the slug and moves its HTML/Markdown/JSON site's defaultbasePathto/plugins/team-reports, following the existing/plugins/<pluginId>convention. Static routes and plugin slug helpers share the existing path module, avoiding import cycles and keeping startup JavaScript within the existing size budget.Non-goals: native
placement: "route:<pluginId>"semantics, Workboard/Logbook, and syncing in-frame navigation into the outer URL are unchanged.User Impact
/reports(prefixed by any configured Control UI base path) inside the Control UI shell, and that address is bookmarkable and shareable./plugin?plugin=team-reports&id=team-reportslinks keep working and are replaced with/reports./reports/…to/plugins/team-reports/…(index,latest/,day|week|month/<key>/,report.md,data.json,people/,index.json,status). Operators who pinnedbasePath: "/reports"keep that site but the sidebar then falls back to the generic tab URL, as documented.Evidence
Landed after rebasing onto main at
c0a318d7800b81bc3e258148816414dfab46ffad(including fix(models): avoid provider loading during cold session resets #143254); exact-head CI 34384740962, attempt 2 passed after the tooling watchdog shard rerun. Startup-size consolidation measured 352,203 B gzip against the unchanged 352,235 B cap.node scripts/run-vitest.mjs run src/plugins/registry.control-ui.test.ts src/gateway/control-ui-plugin-tabs.test.ts src/gateway/control-ui-routing.test.ts extensions/team-reports/index.test.ts extensions/team-reports/src/config.test.ts ui/src/app-route-paths.test.ts ui/src/app-navigation.test.ts ui/src/pages/plugin/tab-slugs.test.ts ui/src/components/app-sidebar.test.ts ui/src/plugins/control-ui-host.test.ts ui/src/app/app-host.test.ts ui/src/app/app-host.deleted-session.test.ts— 12 files, 740 tests passed. New cases cover slug grammar/reserved/duplicate rejection, hello projection with HTTP-route shadowing, native-route collision fallback, sidebar hrefs, hostpageHref, canonicalization, and the Team Reports default path.Initial mocked-Gateway Playwright e2e
ui/src/e2e/plugin-tab-slugs.e2e.test.ts(4 tests): sidebar entry href is/reports; clicking mountsopenclaw-plugin-pagefor the tab with the sidebar still visible; a cold/reportsload stays on/reportswhile the hello is held and mounts the tab once it arrives, never visiting/chat; an unknown slug recovers to chat only after the hello; a generic tab URL is replaced with/reportskeeping?p.range=week#detailsand the history length.pnpm check:changedpassed except the extensions lint declaration lane, which fails in this nested worktree for the documented environmental reason ("Declaration input escapes checkout"); CI is authoritative for that lane.pnpm check:madge-import-cyclesandpnpm check:import-cyclesreport 0 cycles;pnpm check:assertion-safetyOK; knip unused-exports clean.Initial
pnpm ui:check-performance: startup JS 347,563 B gzip / 8 requests against the 352,235 B / 18 request limits; no budget or baseline changed.Independent Codex autoreview of the branch at P1: scoped-clean.
Rebased onto
faef46e142f08159bf29dfe5b6bbbc81141614a4; preserved both commits and moved the slug documentation todocs/plugins/sdk-overview/host-hooks.mdafter the native-route placement paragraph. On rebased head40e94cdf8b3bdfd4928d553310f4af836096d91c, the requested focused suite passed (11 files, 660 tests), all 4 plugin-tab browser E2E tests passed, both import-cycle guards found zero cycles, assertion safety and diff whitespace checks passed, and fresh P1 autoreview was scoped-clean. A fresh production UI build measured startup JavaScript at 348,141 B gzip / 8 requests (limits 352,235 B / 18), and startup CSS at 45,565 B gzip / 1 request. No performance budget changed.Review fix
686996b623725e540b5fa4de3b84d53bd3f9c983preserves an explicitly declared root mount for cold/reports/links. The new bootstrap unit case and trailing-slash E2E case failed before the fix; afterward, all 5 plugin-tab E2E cases and 292 tests across 10 focused files passed, including Team Reports config/registration/HTTP behavior. Changed-file checks passed, fresh P2 autoreview was scoped-clean, and a fresh UI build measured 348,130 B startup JS gzip / 8 requests and 45,565 B startup CSS gzip / 1 request. Config tests verify omittedbasePathuses the new default and pinned/reportsremains; these are boundary checks, not an installed-release upgrade campaign.CI follow-up
8f98254420b15d154b895d310516ef2810a84727supplies the required Gateway object in the existing Workboard routing fixture. The CI failure reproduced locally (7 failures); after the fixture repair, all 64 Workboard/route-path tests passed, changed-file checks passed, and P2 autoreview was scoped-clean. Runtime code and test assertions are unchanged by this follow-up.Final bootstrap correction
f0da4038a7f0fa2ccfc9fdf06abc4dcaf55e6770limits explicit-root preservation to cold single-segment plugin-slug candidates, retaining existing inferred route namespaces with root-mounted resources. The two new namespace unit cases failed before this correction; afterward all 193 tests across five files passed (including all 41 unchanged bootstrap tests), all five plugin-tab browser E2E tests passed, changed-file checks passed, both cycle guards reported zero cycles, and P2 autoreview was scoped-clean. Final startup JavaScript is 348,150 B gzip / 8 requests; startup CSS is 45,565 B / 1 request, within unchanged budgets.Startup-budget repair consolidates the route catalog and slug helpers into
ui/src/app-route-paths.ts, removing the two new leaf modules and reusing the existing path builder. All 628 focused tests across 11 files, all five plugin-tab browser E2E cases, and both zero-cycle guards passed. The official base-comparison check measures 352,203 B startup JavaScript gzip / 8 requests against the unchanged 352,235 B / 18-request limit. P2 autoreview found no actionable issues.