Repository navigation
[Experimental] chore: prune generated and vendored surfaces - #78558
Conversation
|
Codex review: needs real behavior proof before merge. Summary Reproducibility: yes. for the review findings: current PR-head source inspection reproduces the removed redaction guidance, broad JSON formatter ignore, changelog drift, cron repair regression, plugin CLI shadowing path, cached Canvas init failure, and selected-route upgrade auth bug. I did not establish a live Canvas/A2UI runtime reproduction for the full refactor. Real behavior proof Next step before merge Security Review findings
Review detailsBest possible solution: Keep the Canvas-to-plugin refactor under explicit maintainer review, but require a clean rebase, restored safety/tooling/changelog/cron behavior, selected-route auth fixes, and redacted live Canvas/A2UI proof before merge. Do we have a high-confidence way to reproduce the issue? Yes for the review findings: current PR-head source inspection reproduces the removed redaction guidance, broad JSON formatter ignore, changelog drift, cron repair regression, plugin CLI shadowing path, cached Canvas init failure, and selected-route upgrade auth bug. I did not establish a live Canvas/A2UI runtime reproduction for the full refactor. Is this the best way to solve the issue? No. Moving Canvas behind generic plugin seams may be a reasonable direction, but this branch is not the safest merge path while it is dirty, lacks live behavior proof, and still carries source-confirmed regressions. Full review comments:
Overall correctness: patch is incorrect Security concerns:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 1ef85c7d4c30. |
💡 Codex ReviewThis import points to These tests now import ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
f0c880c to
8904061
Compare
💡 Codex Review
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
8904061 to
fd75c9c
Compare
💡 Codex Reviewopenclaw/extensions/canvas/src/tool.ts Lines 217 to 221 in fd75c9c The canvas tool now returns snapshot images via openclaw/src/gateway/server-http.ts Lines 870 to 872 in fd75c9c The upgrade path always passes ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
fd75c9c to
d614a05
Compare
There was a problem hiding this comment.
💡 Codex Review
https://github.com/openclaw/openclaw/blob/057db0252e175f80731477fdd27ac6e0d3a0e507/extensions/canvas/src/host/a2ui.ts#L49-L51
Ensure A2UI bundle exists before accepting Canvas A2UI requests
resolveA2uiRoot() now requires both index.html and a2ui.bundle.js to exist in a candidate directory; with this commit the tracked bundle file was removed, so fresh source checkouts return 503 A2UI assets not found for /__openclaw__/a2ui/* unless users manually run the bundle step first. This breaks Canvas/A2UI behavior out of the box in dev/runtime flows that do not run canvas:a2ui:bundle.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| await handlePluginUpgrade(req, socket, head, pathContext, { | ||
| gatewayAuthSatisfied: false, | ||
| }) |
There was a problem hiding this comment.
Pass auth context into plugin WebSocket upgrade dispatch
The new plugin WebSocket path is invoked with gatewayAuthSatisfied: false unconditionally, but createGatewayPluginUpgradeHandler blocks any matched route that uses auth: "gateway" unless this flag is true (and scope context is present). As a result, plugin routes that register handleUpgrade with gateway auth can never succeed and will always be skipped/blocked during upgrade handling.
Useful? React with 👍 / 👎.
057db02 to
c2f731b
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c2f731bffc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| @@ -1343,9 +1325,8 @@ export async function startGatewayServer( | |||
| preauthConnectionBudget, | |||
| port, | |||
| gatewayHost: bindHost ?? undefined, | |||
| canvasHostEnabled: Boolean(canvasHost), | |||
| canvasHostEnabled, | |||
There was a problem hiding this comment.
Derive canvas host availability from loaded plugin state
canvasHostEnabled is now forwarded from config (readCanvasHostEnabled) instead of actual runtime registration success, so the gateway can advertise canvasHostUrl even when the canvas plugin failed to load/register routes. This can happen because gateway startup calls loadOpenClawPlugins(...) without throwOnLoadError, so plugin errors are non-fatal (src/gateway/server-plugins.ts:604). In that state, clients receive a scoped canvas URL/capability that resolves to no handler (404/failed upgrades), whereas previous behavior only advertised canvas when the host actually started.
Useful? React with 👍 / 👎.
96e71a9 to
9e251b0
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b6897d457a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| "node.pending.ack", | ||
| "node.invoke.result", | ||
| "node.event", |
There was a problem hiding this comment.
Add plugin surface refresh RPCs to BASE_METHODS
BASE_METHODS no longer includes either node.pluginSurface.refresh (new core handler) or the legacy node.canvas.capability.refresh, but startup uses listGatewayMethods() as coreGatewayMethodNames when loading plugins. That means a plugin can now register one of these method names without conflict and handleGatewayRequest will dispatch the plugin handler first (extraHandlers precedence), effectively letting plugins shadow core refresh auth/capability behavior; these methods are also omitted from hello.features.methods for clients that gate calls on advertised support.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7ce4353e7e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const entry = client.pluginNodeCapabilities?.[surface]; | ||
| if (!entry || entry.expiresAtMs <= nowMs) { |
There was a problem hiding this comment.
Scope capability authorization to route owner, not surface string
Capability authorization is keyed only by surface, so any two plugin routes that reuse the same surface name implicitly share a token. In this commit, nodeCapability.surface is plugin-provided and there is no uniqueness check at registration time, while hasAuthorizedPluginNodeCapability accepts a request if any client has a matching token for that surface. That lets a different plugin route (or a second route family) piggyback on another surface’s credential and bypass intended isolation/TTL policy for that route.
Useful? React with 👍 / 👎.
b813e9d to
5bbf3d6
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5bbf3d64a0
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (payloadRecord) { | ||
| if ( | ||
| payloadRecord.kind === "agentTurn" && | ||
| "model" in payloadRecord && | ||
| isInvalidCronPayloadModelSentinel(payloadRecord.model) | ||
| ) { | ||
| delete payloadRecord.model; | ||
| mutated = true; | ||
| trackIssue("invalidCronPayloadModel"); | ||
| } | ||
| const hadLegacyPayloadProvider = Boolean(normalizeOptionalString(payloadRecord.provider)); | ||
| if (migrateLegacyCronPayload(payloadRecord)) { | ||
| mutated = true; |
There was a problem hiding this comment.
Restore cron model-sentinel cleanup in store migration
normalizeStoredCronJobs no longer strips legacy payload.model sentinels before persisting migrated jobs, so existing stores that still contain values like "default", "null", or empty strings keep an explicit model override that should have been treated as inheritance. In that state, cron execution now treats the sentinel as a real override and resolveCronModelSelection rejects it as an invalid model, causing affected scheduled jobs to fail after upgrade instead of self-healing during doctor repair (src/cron/isolated-agent/model-selection.ts).
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0941804810
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const existing = surfaces.get(surface); | ||
| if (!existing || resolveTtlMs(next) < resolveTtlMs(existing)) { | ||
| surfaces.set(surface, next); |
There was a problem hiding this comment.
Avoid collapsing capability routes by surface name alone
listPluginNodeCapabilities deduplicates entries by surface, but capability auth now keys stored tokens by scopeKey (plugin owner + surface). If two plugins register the same nodeCapability.surface, only one owner’s scope survives this map and gets minted during connect, while requests to the other owner’s route will always fail capability auth unless the caller also supplies bearer gateway auth. This creates a silent routing/auth break for one plugin whenever surface names collide; either enforce global surface uniqueness at registration time or keep per-owner capability entries here.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3d2082af74
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const requiresGatewayAuth = matchedPluginRoutesRequireGatewayAuth(matchedRoutes); | ||
| if (requiresGatewayAuth && dispatchContext?.gatewayAuthSatisfied !== true) { | ||
| log.warn(`plugin http upgrade blocked without gateway auth (${pathContext.canonicalPath})`); |
There was a problem hiding this comment.
Gate gateway-auth checks to selected upgrade route
createGatewayPluginUpgradeHandler computes requiresGatewayAuth across all matching upgrade routes before dispatching, so a broader auth: "gateway" route can force a 401 even when a more-specific matched route with auth: "plugin" would actually handle the socket. This creates false auth failures for overlapping upgrade paths (e.g., exact public endpoint under a protected prefix). Auth enforcement should be derived from the effective dispatched route ordering rather than some(...) across all matches.
Useful? React with 👍 / 👎.
b446382 to
590c95e
Compare
|
Landed via rebase onto
|
Summary
Experimental PR. Canvas is low-use, so this moves Canvas out of core ownership and into a bundled experimental plugin while preserving Canvas as an app/client feature.
The latest pass removes the runtime compatibility layers that were still keeping Canvas wired into core: legacy top-level
canvasHostruntime reads/schema, Canvas-specific gateway hello fields, and the Canvas capability refresh RPC. The doctor/fix migration for oldcanvasHostconfigs is intentionally kept so users can still repair old config files intoplugins.entries.canvas.config.host.What changed
vendor/a2ui; Canvas consumes@a2ui/[email protected]from npm.extensions/canvas: tool, host/A2UI serving, documents, CLI implementation, manifest/package metadata, plugin config schema, docs, and bundled asset hooks.openclaw nodes canvascommand from the Canvas plugin.canvasHostschema/type/help/read path and no Canvas-specific config reload restart key.openclaw doctor --fixrewrites legacycanvasHosttoplugins.entries.canvas.config.host, then removes the old key.hello-ok.canvasHostUrl,canvasCapability,canvasCapabilityExpiresAtMs, andnode.canvas.capability.refreshare gone.pluginSurfaceUrls["canvas"]on iOS, Android, and macOS.Current shape
Core owns only generic plugin/runtime plumbing: discovery, tool registration, node invoke policy registry, gateway HTTP/auth dispatch, WebSocket upgrades, hosted media resolution, plugin surface URL advertisement, and node capability checks.
Canvas-specific runtime behavior lives under
extensions/canvas. Native app Canvas handlers remain underapps/because they are client/UI implementations, not core plugin runtime ownership.Verification
pnpm test src/gateway/plugin-node-capability.test.ts src/gateway/server.plugin-node-capability-auth.test.ts src/gateway/server/ws-connection.test.ts src/gateway/server/ws-connection.startup.test.ts src/config/schema.help.quality.test.ts extensions/canvas/src/config.test.tspnpm test extensions/canvas/src/config-migration.test.ts src/plugins/setup-registry.canvas.test.tspnpm tsgo:corepnpm tsgo:extensionspnpm tsgo:extensions:testpnpm tsgo:core:testANDROID_HOME="$HOME/Library/Android/sdk" ./gradlew :app:testPlayDebugUnitTest --tests ai.openclaw.app.gateway.GatewaySessionInvokeTest --tests ai.openclaw.app.gateway.GatewaySessionInvokeTimeoutTest --tests ai.openclaw.app.node.InvokeDispatcherTestswift test --filter GatewayNodeSessionTestsinapps/shared/OpenClawKitswift test --filter MacGatewayChatTransportMappingTestsinapps/macosswift test --filter CanvasWindowSmokeTestsinapps/macospnpm buildpnpm plugins:inventory:checkpnpm plugin-sdk:api:gen && pnpm plugin-sdk:api:checkgit diff --checkKnown unrelated local full-suite Swift failures observed while verifying:
swift testinapps/shared/OpenClawKitcompiled the touched code but failedTalkConfigContractTests.selectionFixtures.swift testinapps/macoscompiled the package but failedMenuSessionsInjectorTests.injects session rows.CI intentionally not waited on per maintainer request.