Skip to content

fix(frontend): make workbench Run work over non-localhost HTTP - #414

Merged
tianzhou merged 1 commit into
mainfrom
claude/verdict-issue-413-history-h3s6ye
Sep 1, 2026
Merged

fix(frontend): make workbench Run work over non-localhost HTTP#414
tianzhou merged 1 commit into
mainfrom
claude/verdict-issue-413-history-h3s6ye

Conversation

@tianzhou

@tianzhou tianzhou commented Sep 1, 2026

Copy link
Copy Markdown
Member

Fixes #413

Opening the workbench by IP from a remote machine rendered fine, but the Run button failed with TypeError: crypto.randomUUID is not a function. crypto.randomUUID is only exposed in secure contexts (HTTPS or localhost), while crypto.getRandomValues is available everywhere.

This adds a generateId() helper in frontend/src/lib/utils.ts that uses crypto.randomUUID when present and otherwise builds an RFC 4122 v4 UUID from crypto.getRandomValues, and routes the three call sites through it (JSON-RPC request id in api/tools.ts, result/error tab ids in ToolDetailView.tsx).

Verified with pnpm run build in frontend/ (typecheck + Vite build pass).

🤖 Generated with Claude Code

https://claude.ai/code/session_01CeoyVWAJhRngvgvQvN7jVx


Generated by Claude Code

crypto.randomUUID is only exposed in secure contexts (HTTPS or
localhost), so opening the workbench by IP from a remote machine made
every query fail with "crypto.randomUUID is not a function". Route the
three id call sites through a generateId helper that falls back to
building a v4 UUID from crypto.getRandomValues, which is available in
insecure contexts.

Fixes #413

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01CeoyVWAJhRngvgvQvN7jVx
Copilot AI lite review requested due to automatic review settings September 1, 2026 06:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes the workbench “Run” failure when the frontend is accessed over non-localhost HTTP by removing direct reliance on crypto.randomUUID (secure-context only) and routing ID generation through a safe helper.

Changes:

  • Added generateId() helper that uses crypto.randomUUID() when available, otherwise generates an RFC 4122 v4 UUID via crypto.getRandomValues.
  • Updated JSON-RPC request IDs to use generateId() in the tool execution client.
  • Updated result/error tab IDs in the workbench tool detail view to use generateId().

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
frontend/src/lib/utils.ts Adds generateId() with a randomUUIDgetRandomValues fallback for non-secure contexts.
frontend/src/components/views/ToolDetailView.tsx Routes result and error tab ID generation through generateId().
frontend/src/api/tools.ts Routes JSON-RPC request id generation through generateId().

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@tianzhou
tianzhou merged commit 08d98b3 into main Sep 1, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: workbench limited to localhost, expand to remote ports via HTTPS

3 participants