Skip to content

Read the health-check token from the keychain like the CLI does. - #322

Merged
Brooooooklyn merged 1 commit into
mainfrom
health-keychain-token
Sep 14, 2026
Merged

Brooooooklyn merged 1 commit into
mainfrom
health-keychain-token

Conversation

@Brooooooklyn

@Brooooooklyn Brooooooklyn commented Sep 14, 2026 •

Copy link
Copy Markdown
Member

What

vp run health / vp run health:staging failed after void auth login: the CLI stores the token in the system keychain now, and the script only read ~/.void/config.json.

The script now resolves the token in the same order as getToken() in packages/void/src/cli/auth.ts:

VOID_TOKEN env  →  keychain (dev.void.cli / token | stagingToken)  →  ~/.void/config.json

It only reads. The CLI still owns the file-to-keychain migration. @napi-rs/keyring is added to the api package as a devDependency at 2.0.0, the version the CLI pins. The addon is imported lazily, so a missing native binary falls through to the env or file token instead of aborting the script.

Verified

Case Result
keychain token, no file token Health check: PRODUCTION, 4 passed 0 failed
VOID_TOKEN=invalid env token sent; /projects returns 401
keyring import broken (resolve hook), VOID_TOKEN set env token used, no crash
keyring import broken, file token only file token used
keyring import broken, nothing set prints the new error, exit 1
vp fmt --check, vp run lint:platform clean

🤖 Generated with Claude Code

https://claude.ai/code/session_01WNXbwieSdsSErZwQ7HWRwG


Note

Low Risk
Dev-only health script and dependency change; no production API or auth server behavior is modified.

Overview
Fixes vp run health / health:staging after void auth login when tokens live only in the system keychain instead of ~/.void/config.json.

The platform API health script now resolves credentials in the same order as CLI getToken(): VOID_TOKEN → keychain (dev.void.cli / token or stagingToken) → ~/.void/config.json. It only reads from the keychain (no file migration). @napi-rs/keyring 2.0.0 is added as a devDependency on @voidcloud/api; the module is lazy-imported so missing native binaries in CI/Docker still allow env or file fallbacks. Error text and usage docs now mention VOID_TOKEN and void auth login.

Reviewed by Cursor Bugbot for commit 149e71e. Bugbot is set up for automated code reviews on this repo. Configure here.

`vp run health` still read the token from `~/.void/config.json`, but
`void auth login` now stores it in the system keychain, so the check
failed on a machine that had just logged in.

The script now resolves the token in the same order as `getToken()` in
the CLI: `VOID_TOKEN`, then the keychain (`dev.void.cli` / `token` or
`stagingToken`), then the config file. It only reads; the CLI owns the
file-to-keychain migration. The keyring addon is imported lazily so a
missing native binary falls through to the env or file token instead of
aborting the script.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WNXbwieSdsSErZwQ7HWRwG
@cursor

cursor Bot commented Sep 14, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_bec565ee-42ab-495a-b39f-89ec212d176f)

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 14, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-14T13:38:47.925191Z 149e71e PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Brooooooklyn
Brooooooklyn merged commit 47d303c into main Sep 14, 2026
16 checks passed
@Brooooooklyn
Brooooooklyn deleted the health-keychain-token branch September 14, 2026 13:50
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.

1 participant