Repository navigation
Conversation
|
📁 PR Artifacts Notice This PR adds or changes temporary PR-specific documents under |
all-hands-bot
left a comment
There was a problem hiding this comment.
This review was posted by an AI agent (OpenHands).
Reviewed head 1f4d2270f67cfe39b4ec19d239c567b780e22df1 (feat/godot-player → main) against the repository guidance in AGENTS.md and the Canvas Extensions API references. No prior reviews existed for this head.
Scope: This belongs in this repository. AGENTS.md assigns the public registry of Agent Canvas Apps to OpenHands/extensions, the change follows the existing apps/<name> package layout (manifest, self-contained extension.js, README, build script), and no code is moved into repositories that own the SDK or Canvas UI. Passing the scope gate, I continued with a technical review.
Verification in the workspace at the head SHA: the Canvas App validator passed (node skills/canvas-extension-api/scripts/validate-extension.mjs apps/godot-player); pytest -q tests/test_apps_catalog.py passed (2 tests, matching the PR description); the generated extension.js decompresses to a valid Godot 4.4.1.stable.official single-thread (nothreads) WASM runtime and a GDPC demo pack, consistent with the manifest, README, and embedded license/copyright files; the catalog entry is beta: true and app installation/enablement stays an explicit user action, so the heavy 13 MB entrypoint is opt-in.
Findings
-
Isolation-boundary claim conflicts with the repo's own v1 contract (inline,
apps/godot-player/src/player.js). This is the one material design concern; the code itself implements real containment (opaque-origin frame,connect-src 'none'CSP, memory-only fetch), but it does so through a pattern the repository's authoritative Canvas Extensions API documentation explicitly withholds from apps, and the PR description and README promise that boundary to users. Either the host contract needs to be confirmed as supporting this before merge, or the docs should stop framing the sandbox as a supported security boundary. -
The browser-side behavior of this app has no automated tests in the repository (inline,
apps/godot-player/src/player.js). The shippedtests/relay.gdcovers only the demo game's logic and requires a local Godot install; sibling apps (kanban-manager,whiteboard) ship JS tests for their app code, and the canvas-extension-api guidance asks for DOM tests of activation, mounting, disposal, and error paths. The README rebuild flow also cannot run in CI without Godot, so nothing here catches a regression inactivate/play/boot.
Checks on this head (re-read just before publishing): CodeQL, test, check, sync-extensions, check-pr-artifacts, and validate-claude-code pass. Three workflows fail for reasons that must be resolved before merge but are not code defects: the PR title is not a conventional-commit title ("Play Godot game packs in Agent Canvas"), the PR description's HUMAN section still contains the placeholder comment so Validate PR description fails, and sync-sdk-skill fails because skills/openhands-sdk has drifted from the docs site (pre-existing drift that a rebase onto a regenerated main or running python scripts/sync_openhands_sdk_skill.py will fix; it does not originate from this PR's files). There are no linked issues whose readiness labels need checking.
The engine bundle and licensing (MIT text plus the machine-readable copyright file) are present, the file-input path validates the GDPC magic before handing the pack to the engine, and all rendering of user-controlled strings (file name in the title and heading) uses DOM text assignment rather than HTML injection. I found no security defect in the player code beyond the contract question in finding 1.
🛑 Finding 1 requires an explicit decision before merge, and the three failing checks above block merge independently of code quality.
🔄 CHANGES REQUESTED
| function play(file) { | ||
| const frame = document.createElement('iframe'); | ||
| frame.title = file?.name || 'Periapsis'; | ||
| frame.setAttribute('sandbox', 'allow-scripts'); |
There was a problem hiding this comment.
Isolation-boundary pattern conflicts with the repo's own v1 contract.
skills/canvas-extension-api/references/v1-contract.md lists under "Current v1 limitations" (the section introduced with "Do not promise or implement these features without confirming a newer contract"): "iframe or worker isolation for App-authored frames: an App must not create its own frames or Workers to obtain an isolation boundary", naming the host-owned managed-backend view as the only sanctioned frame. This app builds exactly such an App-authored frame and rests its security story on it: the PR description says "the game runs in an opaque-origin sandboxed iframe", and apps/godot-player/README.md promises "Game code runs in a scripts-only sandboxed iframe, not in the trusted Canvas page".
The containment implemented here is real at the browser level (opaque origin, connect-src 'none', fetch restricted to the one in-memory WASM response), so I am not claiming the game can reach the backend or network. The issue is the contract conflict: the repository's authoritative guidance forbids promising or implementing app-authored frame isolation in v1 without a newer contract, while this change both implements it and advertises it as a supported boundary in user-facing docs. Before merge this needs either an explicit host-contract confirmation that app-created sandboxed frames are supported (and a matching update to the references), or docs that stop framing the sandbox as a security boundary. Per the workflow I am publishing COMMENT rather than REQUEST_CHANGES; this is the decision I'd want a maintainer to make explicitly.
| @@ -0,0 +1,76 @@ | |||
| // BUILD_ASSETS is replaced with the compressed web export by build.mjs. | |||
There was a problem hiding this comment.
The browser-side behavior of this app has no automated tests in this repository.
tests/relay.gd covers only the demo game's logic (win/loss/restart) and needs a locally installed Godot, so nothing here exercises activate, page mounting/disposal, the route guard, or the boot error paths (bad pack, missing assets, engine start failure). Sibling apps in this repo (apps/kanban-manager, apps/whiteboard) ship JS tests for their app code, and the canvas-extension-api guidance asks for DOM tests of activation, mounting, disposal, and error rendering. The app is beta/disabled-by-default, so this is not a merge blocker on its own, but any refactor of src/player.js would ship untested.
all-hands-bot
left a comment
There was a problem hiding this comment.
This review was posted by an AI agent (OpenHands).
Reviewed head 2fbccfa2d704e346ef4c69bdf36eb9c3b5c16c2a (feat/godot-player → main) at the current state of PR #992. A prior review by this account covered head 1f4d2270f67cfe39b4ec19d239c567b780e22df1; since then the head moved only by two chore commits (fbec644 sync SDK skill from upstream, 2fbccfa regenerate skills catalog index), and the previously failing sync-sdk-skill check is now green. The Godot Player app code is unchanged from the prior review and its two review threads remain unresolved, so this re-review re-verified those findings against the new head.
Scope: This belongs in this repository. AGENTS.md places the public registry of Agent Canvas Apps under apps/ (one directory per app: manifest plus a self-contained browser ESM entrypoint, registered in apps/catalog.json), and the change follows the existing layout of the sibling apps; no SDK, Canvas UI, or automation machinery is modified. Passing the scope gate, I continued the technical review.
Verification in the workspace at the head SHA: node skills/canvas-extension-api/scripts/validate-extension.mjs apps/godot-player passed; pytest -q tests/test_apps_catalog.py passed (2 tests) and the APPS_CATALOG export includes godot-player (beta: true); pytest -q tests/test_check_pr_description.py tests/test_refresh_linked_pr_checks.py passed (30 tests); python scripts/sync_extensions.py --check exits 0 (two non-blocking marketplace-coverage warnings concern pre-existing plugins, not files in this PR) and python scripts/sync_openhands_sdk_skill.py --check reports the SDK skill up to date. All 13 check runs on the exact head SHA are green, including CodeQL, test, check, sync-sdk-skill, check-pr-artifacts, and Validate PR description. Linked issue #1001 currently carries ready-for-dev (created 2026-11-26, after the rollout date), consistent with the passing description gate. I also inspected the shipped bundle: the embedded loader identifies itself as Godot 4.4.1.stable.official for the single-thread Web template, the WASM magic and the demo pack (GDPC, format version 2, engine 4.4) are intact, the entrypoint references only bundled assets (no runtime CDN or backend), and user-controlled strings such as the chosen file name are rendered via DOM text assignment rather than HTML. .pr/godot-player.png is a temporary PR artifact handled by the repository's own pr-artifacts.yml workflow and removed from main by the next release PR.
Findings
- App-authored sandboxed frame conflicts with the repository's authoritative v1 contract (inline,
apps/godot-player/src/player.js).skills/canvas-extension-api/references/v1-contract.mdstates that no iframe or worker sandbox exists for App-authored code in v1 and that an App must not create its own frames or Workers to obtain an isolation boundary; the one supported frame is the host-ownedhost.appBackendViewhelper (used correctly by the siblingvscodeapp). The player's containment is technically sound - an opaque-originsrcdocframe withsandbox="allow-scripts", a strict CSP withconnect-src 'none', and an in-realm fetch override that rejects external resources - but it implements the exact pattern the contract withholds, and both the PR description and the README promise that frame as the security boundary. I searched the contract documents and both the extensions and OpenHands repositories for evidence of a newer contract confirming App-authored sandboxed frames and found none. Before merge, either the Canvas Extensions API contract needs to be extended and this PR updated to reference it, or the PR and README should stop presenting the app-authored sandbox as a supported v1 boundary. The bundled demo is inert (no networking, no persistence) and the app is opt-inbeta, which limits exposure but does not resolve the contract conflict.
Non-blocking: the browser-side activate/play/boot/error paths have no automated tests in the repository - tests/relay.gd covers only the demo game's logic and requires a local Godot install, and the README rebuild flow needs an export toolchain - so CI cannot catch regressions in those paths. The PR's manual verification on a local Canvas install covers this for now; noted because the prior review raised the same point.
Checks on this head (re-read immediately before publishing): all green; no human replies to the open review threads; no additional linked issues.
Improve this review? If feedback seems incorrect or irrelevant, update the repository's .agents/skills/custom-codereview-guide.md (with the /codereview trigger), then re-request review. The reviewer reads the guide from the PR head.
Resolve with AI? Install the iterate skill and run /iterate.
Was this review helpful? React with 👍 or 👎.
[RISK ASSESSMENT]
This PR introduces a new architectural pattern for an App: an App-authored opaque-origin sandboxed iframe serving as the app's own security boundary, a pattern the repository's authoritative v1 contract explicitly withholds, shipped with documentation that promises that boundary. Resolving the conflict requires a maintainer decision on the Canvas Extensions API contract, which automation cannot grant. Exposure is limited (opt-in beta app, inert bundled demo, no network or persistence), but the PR should not auto-merge until the contract question is settled.
🔄 CHANGES REQUESTED
| function play(file) { | ||
| const frame = document.createElement('iframe'); | ||
| frame.title = file?.name || 'Periapsis'; | ||
| frame.setAttribute('sandbox', 'allow-scripts'); |
There was a problem hiding this comment.
App-authored sandboxed frame conflicts with the repo's own v1 contract.
skills/canvas-extension-api/references/v1-contract.md forbids App-authored frames for isolation: "an App must not create its own frames or Workers to obtain an isolation boundary" (line 307), and line 26 states that no iframe or worker sandbox exists in v1 for App-authored code or the App's own frame. The one supported frame is the host-owned host.appBackendView helper (see apps/vscode/extension.js:68), which this app does not use. The containment implemented here - opaque-origin srcdoc, sandbox="allow-scripts", CSP connect-src 'none', and an in-realm fetch override - is technically sound, and the PR description and README both promise it as the security boundary, but it is a pattern the repository's contract explicitly withholds. Either extend the Canvas Extensions API contract for App-authored sandboxed frames and reference it here, or stop presenting the sandbox as a supported v1 boundary. This needs an explicit maintainer decision on the contract before merge.
HUMAN:
Verified on a local Agent Canvas installation: the Godot/WebGL 2 renderer started in Chromium, input worked, an invalid pack showed an error, the exported demo pack loaded, and restart returned to the demo. Validator and catalog tests pass.
AGENT:
This PR was created by an AI agent (OpenHands) on behalf of Graham Neubig.
Why
Play and test a Godot game pack in Canvas without uploading it or setting up an external game server.
Summary
Adds Godot Player to the Apps catalog and ships Periapsis, an orbital timing game. The app embeds the Godot 4.4.1 single-thread Web runtime. Only the player shell runs in the Canvas realm; the game runs in an opaque-origin sandboxed iframe.
Issue Number
Fixes #1001
How to Test
Install this branch with repo path
apps/godot-player, enable it, and open Godot Player. Press Space or tap the playfield. Use Open .pck to replace the demo, or Restart demo to return to it.Verified on a local Agent Canvas installation: Chromium started the real Godot/WebGL 2 renderer, the game responded to input, an invalid pack showed an error, the exported demo pack loaded via file input, and restart returned to the bundled demo. The Canvas App validator passed;
pytest -q tests/test_apps_catalog.pypassed (2 tests); the headless Godot gameplay test exercised win, loss, and restart.Video/Screenshots
Notes
The self-contained entrypoint is about 13 MB, mostly compressed engine WASM. No runtime CDN or backend service. Audio, PWA features, and persistent saves are not supported.