fix: migrate OpenRouter verification to authenticated JSON APIs - #5
Merged
Conversation
mingyech
force-pushed
the
codex/openrouter-64-action-ids
branch
from
August 26, 2026 05:16
59396c1 to
54f4bc2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
/api/frontend/v1/private/users/current/api/frontend/v1/private/user/workspaces?scope=membergo test ./...in CI before the reproducible Nix image buildRoot cause
The original version of this PR assumed OpenRouter had changed the verifier's required Server Action IDs from 40–42 characters to 64 characters. Live authenticated inspection disproved that:
Widening the action-ID regex therefore could not restore registration.
Implementation
The existing Clerk refresh remains unchanged. After refresh, the verifier now:
default_workspace_id/api/frontend/v1/private/management-keys, rejecting incomplete or non-progressing paginationPOST /api/frontend/v1/private/workspace-api-keys/managementrequest using{"name":"..."}PATCH /api/frontend/v1/private/workspace-api-keys/{hash}and{"payload":{"deleted":true},"opts":{"is_provisioning_key":true}}Creation is not blindly retried. If the POST outcome is ambiguous, the verifier reconciles and removes a possible same-label orphan. Deletion only succeeds when the response explicitly confirms
data.deleted=true.All action-hash discovery, bundle downloads, RSC parsing, and HTML regex parsing have been removed from production.
Verification
Authenticated, read-only live validation against OpenRouter on 2026-08-26 UTC confirmed:
{data: ...}, with email and every required account toggledata,active_workspace_id, anddefault_workspace_id; the default ID matched a workspace item and its data-discount toggle was present{data:{keys,total_count}}, with the expected key metadata fieldsPR #7 independently live-tested the same management-key API with a 164-key account, including pagination and a create/list/delete roundtrip with cleanup. This branch preserves that pagination behavior while removing the legacy scraper fallback and making mutation failure handling safer.
Local verification:
go test -count=1 ./...go test -race -count=1 ./internal/openrouter ./internal/servergo vet ./...git diff --checkNo additional live mutation was performed against the authenticated account while preparing this update. The create/delete contract is covered by request/response integration tests, and the CI attestation job remains the final staging check before deployment.