mirror of
https://github.com/webstudio-is/webstudio.git
synced 2026-12-01 21:05:42 +09:00
1b9ae61fa1eb326a50b74cb0ed2c19d804f14666
3
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
3c7dac7eb0 |
fix: resolve MCP preview and content graph reports (#6511)
## Summary - Raise the document-reference graph budget independently of the 20-file content hydration limit, and document the 2,000-document graph cap. This lets the reported 29-post referenced query complete. - Make iterative preview startup verify the generated project identity endpoint instead of compiling the application route; exact route validation remains with screenshot/capture. - Keep production preview readiness tied to the application route even when no CSS assets are present. - Include a stable structured diagnostic when the browser DevTools connection closes, while preserving the existing reconnect behavior. - Document and test a safe leaves-first `convert-instance` migration for required-part composite trees. Closes #6508, #6515 Ref #6509, #6510 ## Verification - Content Engine suite: 656 tests passed. - Vision suite: 85 tests passed. - CLI preview/readiness/controller tests: 32 passed; project-build instance conversion tests: 89 passed. - CLI typecheck, targeted lint, formatting, and diff checks passed. - The full CLI suite timed out in unrelated launcher/fixture tests under parallel load. The preview-script and launcher tests passed with fewer workers, and the MDX fixture test passed alone in 29 seconds. No full local agent evaluation command was run. - All required GitHub checks passed on latest commit `7f7b981` (29 successful; visual regression skipped). ## Remaining scope - #6509 remains open: this PR improves diagnostics but does not establish a stable Edge DevTools capture. - #6510 remains open: this PR removes the initial route-compilation dependency, but does not yet provide route-specific preparing/retry status. ## Checklist - [x] Review the change and preserve production preview route checks. - [x] Add regression coverage for the review fix and required-part conversion recipe. - [x] Update MCP manual docs with the supported conversion order. - [x] Run focused tests, typecheck, lint, and formatting. - [ ] Run the full local agent evaluation suite (not run). - [x] Confirm required CI checks pass on the latest commit. |
||
|
|
75840a119c |
fix: Start previews and diagnose runtime failures (#6321)
## Summary Preview startup now binds loopback directly instead of scanning network interfaces first. MCP no longer exposes or accepts a fixed preview host or port: the CLI asks the operating system for an available loopback port and returns the resulting URL. The CLI also returns safe, structured diagnostics when the runtime blocks preview networking or Chromium IPC, when generated IDs collide, and when a listening preview fails its HTTP readiness probe. Preview startup retries only a genuine automatic-port race; HTTP and connection failures return immediately instead of repeating the full startup timeout five times. ## Issue checklist - [x] #6318 — reproduced the `uv_interface_addresses` failure, replaced interface discovery with a direct TCP bind, and added a regression test for the exact failure. - [x] #6319 — reproduced Chromium aborting before DevTools startup when the managed runtime blocks browser IPC/socket operations. The host restriction cannot be bypassed by the CLI, but future reports now include a safe `browser_ipc_permission_denied` issue without raw stderr, paths, or tokens. - [x] #6320 — ran four reported insert variants sequentially across two pages; all generated unique IDs. Future collision errors now include the affected namespace and insertion stage without exposing the generated ID. - [x] #6324 — reproduced the generic readiness timeout with a real generated preview whose root probe returned HTTP 500 after the server printed its Local URL. The MCP contract and documentation also allowed agents to force a busy port; network binding is now runner-owned. - [x] #6325 — confirmed the responsive screenshot uses the same readiness path. Future reports distinguish HTTP, refused-connection, timeout, and permission failures, non-port failures are no longer retried, and screenshots cannot request a fixed preview port. - [x] Documentation impact reviewed. Updated MCP examples and vision guidance to omit runner-owned host and port fields. ## Technical notes - Removes the CLI's direct `get-port` dependency. That package calls `os.networkInterfaces()` even when a host is supplied. - Binds `{ host: "127.0.0.1", port: 0 }`, reads the assigned TCP port, then closes the temporary server. - Removes `host` and `port` from MCP preview and screenshot input schemas and rejects those fields at runtime. - Returns the selected preview URL from `preview.start`; managed screenshots reuse that active target. - Returns `PREVIEW_NETWORK_RESTRICTED` with a stable `network_permission_denied` issue when the OS rejects loopback binding. - Reads at most the last 4 KB of Chromium startup stderr, maps only the reproduced IPC/socket denial to a safe diagnostic, and discards the buffer after startup. - Preserves browser startup issues through CLI browser fallback aggregation and the MCP screenshot error boundary. - Reports generated record collisions with `generated_id_conflict`, the namespace constraint, and the fragment insertion stage. - Preserves structured readiness diagnostics when preview output is appended. - Reports HTTP 5xx and local connection failures without exposing raw fetch errors. - Retries with a newly allocated port only for `EADDRINUSE` / `PREVIEW_PORT_IN_USE`. ## Verification - [x] New regression tests were shown to fail before implementation and pass afterward. - [x] Reproduced the old generic timeout through the real preview controller; after the fix, the same path returned `PREVIEW_HTTP_ERROR` with `http_status:500`. - [x] Verified MCP advertised and accepted fixed host/port fields before the change, then rejected both fields after the change. - [x] Preview readiness/controller tests: 2 files, 29 tests passed. - [x] Vision tests: 13 files, 81 tests passed. - [x] Project-build tests: 88 files, 2,282 tests passed. - [x] CLI tests: 66 files, 1,038 tests passed. - [x] Vision, project-build, and CLI typechecks passed. - [x] Lint passed with warnings denied. - [x] Package-boundary and MCP documentation checks passed. - [x] Fixture impact reviewed; no fixture inputs or generated fixture outputs are affected. Generated documentation was updated; the generated runtime operation contract did not change. Agent evaluations were not run because they require separate approval. Closes #6318 Ref #6319 Ref #6320 Ref #6324 Ref #6325 |
||
|
|
cbe4950cd0 |
fix: Use available package manager for previews (#6251)
## Summary - Use the npm or pnpm launcher that started Webstudio for preview dependency installation, builds, and server startup. - Use pnpm-compatible isolated-install flags and report the selected package-manager path on failure. - Preserve the existing installed-dependency reuse path before package-manager resolution. ## Technical choices - Read the standard `npm_execpath` metadata already supplied by npm and pnpm; users do not need to configure another environment variable. - Run JavaScript launchers such as `pnpm.cjs` with the selected Node runtime, supporting bundled Node distributions without adjacent npm. - Keep the existing npx-to-npm mapping and fallback behavior unchanged. - Distinguish numeric package-manager exit codes from process-launch errors such as `ENOENT`. ## Todo - [x] Reproduce the bundled Node + pnpm + missing adjacent npm failure. - [x] Add fail-before/pass-after coverage for dependency installation, production build, and preview startup. - [x] Reuse the detected pnpm launcher. - [x] Preserve installed-dependency reuse. - [x] Include the selected launcher path in installation failures. - [x] Report package-manager exits and process-launch errors accurately. - [x] Review documentation impact and update the CLI manual plus generated MCP documentation. - [x] Review fixture impact; no fixture inputs or outputs are affected. ## Verification - Focused install diagnostic regression suite — 28 tests passed. - `pnpm --filter webstudio typecheck` - `pnpm lint` - `pnpm --filter webstudio test` — 1,029 of 1,030 tests passed; an existing process-supervisor cleanup test hit a transient `ENOENT`, then passed 4/4 when rerun in isolation. - Generated documentation checks passed. - Real pnpm JavaScript launcher invocation with isolated preview install flags. - Agent evaluations were not run because they require separate approval. Closes #6250 |