Skip to content

fix: resolve console device URLs - #44029

Merged
kitlangton merged 1 commit into
devfrom
dev-device-url
Aug 22, 2026
Merged

fix: resolve console device URLs#44029
kitlangton merged 1 commit into
devfrom
dev-device-url

Conversation

@kitlangton

Copy link
Copy Markdown
Contributor

What

Port the Console device authorization URL fix to both implementations currently present on dev.

Before / After

Before: The Console API returns an origin-rooted /console/device?... verification path. Both dev implementations appended that value to the path-bearing https://opencode.ai/console server string, producing /console/console/device and routing signed-in users to their organization instead of device approval.

After: Both implementations use standard URL resolution. Origin-rooted paths resolve from the origin, path-relative values resolve beneath the configured server base, absolute HTTP(S) URLs remain unchanged, and malformed or non-HTTP(S) values enter each implementation's existing typed error channel.

How

  • packages/opencode/src/account/account.ts resolves the verification URL inside Account.login and maps invalid values to AccountServiceError.
  • packages/core/src/plugin/provider/opencode.ts resolves the verification URL inside the existing V2 OAuth method and maps invalid values through Integration.AuthorizationError.
  • Adds production-shaped and malformed-response regressions to each implementation's existing test suite.

Scope

This does not change account APIs, integration APIs, endpoints, credentials, token polling, or the Console response. It only replaces string concatenation at the two verification URL boundaries on dev.

Testing

  • bun run test test/account/service.test.ts from packages/opencode: 15 passed
  • bun run test test/plugin/provider-opencode.test.ts from packages/core: 12 passed
  • bun typecheck from packages/opencode
  • bun typecheck from packages/core
  • Push hook: repository-wide Turbo typecheck, 30 tasks passed
  • git diff --check

Flow

sequenceDiagram
participant Client as Account/Core client
participant Console as Console API
participant Browser
Client->>Console: POST /console/auth/device/code
Console-->>Client: verification_uri_complete=/console/device?...
Client-->>Client: Resolve against server URL
Client->>Browser: Open https://opencode.ai/console/device?...
Loading

Ports the fix from #44021 to dev.

@kitlangton
kitlangton enabled auto-merge (squash) August 22, 2026 00:15
@kitlangton
kitlangton merged commit e00890c into devAug 22, 2026
11 checks passed
@kitlangton
kitlangton deleted the dev-device-url branch August 22, 2026 00:25
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@kitlangton