GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(core): normalize Link welcome label for Workspace.IDs and validate in Link.dial by kitlangton · Pull Request #66298 · anomalyco/opencode

Conversation

@kitlangton

@kitlangton kitlangton commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Fixes a live-proven Noise XX handshake bug where Link.serveDirect sent raw Workspace.IDs (e.g. wrk_01..., containing _ and uppercase) as the encrypted welcome label, causing Rust opencode-worker serve to refuse every workspace connection with HandshakeError(InvalidMachineName).

Before: Link.handshake encrypted the raw Environment.ID as the welcome message (wrk_2114...), which fails Rust opencode-worker's is_valid_machine_name check (^[a-z][a-z0-9-]{1,62}$ and != "local"). TypeScript's Link.dial did not enforce that check, so unit tests missed the mismatch.

After:

const isWelcomeName = Schema.is(Machines.Name)
const isValidWelcomeName = (name: string): boolean => isWelcomeName(name)
const toWelcomeName = (machine: string) => {
  if (isValidWelcomeName(machine)) return machine
  const slug = machine.toLowerCase().replace(/[^a-z0-9-]/g, "-")
  const candidate = (/^[a-z]/.test(slug) ? slug : `w-${slug}`).slice(0, 63)
  return isValidWelcomeName(candidate) ? candidate : "workspace"
}
  • Valid Machines.Name values pass through byte-for-byte unchanged (Link.serve / paired machines unaffected).
  • Workspace.IDs normalize cleanly (wrk_01AbC... -> wrk-01abc...) for the worker's welcome/log label while the home retains the exact Workspace.ID for routing.
  • Link.dial now enforces Schema.is(Machines.Name) (matching Rust opencode-worker/src/link.rs:391) so TypeScript tests catch any future welcome-label drift.
Metric Value
Base dev
Breaking changes None (works with all deployed opencode-worker binaries without a worker upgrade)
Verification Live proof against compiled Rust opencode-worker serve (f7120e8), bun check + tsc -b (core), 42/42 machine-link + machine-frames + worker-client tests, lint, lint:effect-simplifications

Read: packages/core/src/machine/link.ts, packages/core/test/machine-link.test.ts, and packages/core/test/worker-client.test.ts.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@kitlangton
fix(core): normalize Link welcome label for Workspace.IDs and validat…
969071c
…e in Link.dial
@github-actions github-actions Bot added the contributor label Nov 25, 2026
opencodejr[bot]
opencodejr Bot reviewed Nov 25, 2026
View reviewed changes

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

The change looks sound. Valid Machines.Name values pass through unchanged, so paired machines and Link.serve are unaffected. Workspace.IDs are turned into a valid machine name only for the welcome label, and the home still routes by the exact ID. Making Link.dial refuse invalid labels, as the Rust worker does, is a reasonable way to keep the two sides from drifting apart again.

How I checked: the machine-link, worker-client and machine-frames tests pass (42/42). The new and changed tests fail against the base link.ts, and tsc -b is clean for core. I couldn't run the compiled Rust opencode-worker here, so the live handshake fix isn't independently verified.

Public API: unchanged. The welcome label is internal to the Link handshake, and Link.dial only accepts labels the Rust worker already requires.

No blocking concerns.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@kitlangton
kitlangton merged commit af4c115 into dev Nov 25, 2026
11 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@kitlangton
kitlangton deleted the fix-link-welcome branch November 25, 2026 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@opencodejr opencodejr[bot] opencodejr[bot] left review comments

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

contributor

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@kitlangton
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.