Skip to content

fix(server,app): own the tunnel client, clearer login and npm errors, stale grants - #85

Merged
volod-vana merged 2 commits into
mainfrom
volod/cli-polish-oct7
Oct 7, 2026
Merged

volod-vana merged 2 commits into
mainfrom
volod/cli-polish-oct7

Conversation

@volod-vana

Copy link
Copy Markdown
Member

Four small fixes.

  1. Orphaned frpc. A server killed with kill -9 left its frpc running (ppid 1) through the supervisor's restart and vana server stop. The CLI now owns frpc's lifetime for a data dir: startLocalServer stops any frpc whose command is frpc -c <dataDir>/tunnel/frpc.toml when the server exits and before every (re)start (the data dir lock is held, so such an frpc can only be stale). vana server stop stops it too, for the stopped server's dir or, with nothing running, this account's own dirs. Other data dirs (another account, Vana Desktop) never match. New module src/personal-server/local/tunnel-process.ts.
  2. vana login says "Your Personal Server is not running." when this account has a data dir here or the gateway lists a registration for it (next: vana server start, with --network when it lives on the other network, and the existing start offer at a terminal uses that network). "No Personal Server found" stays for new accounts.
  3. Runtime install: tries npm beside Node, then any npm on PATH (still run under the chosen Node). A missing or unstartable npm gives a clear message (reinstall npm, nvm install <version>, or set VANA_PDPP_NODE), server-failed / npm-missing, exit 6. A failing npm ci or native module check says where the log is instead of a stack.
  4. vana app requests show and list check each grantId at the gateway. Revoked (revokedAt set) or replaced (grant scopes no longer cover the request's approved scopes) report live: false, data.grant.state and a reason, with next vana app request --scopes .... Gateway unreachable: stored status kept, grant.state: unverified. Approved scopes are no longer overwritten on later refreshes.

Tests: unit tests for frpc matching and stopping, a real-process supervisor test (fake entry spawns a fake frpc, kill -9, restart reaps the orphan, stop reaps the new one), login message cases, npm fallback and missing npm, revoked / replaced / unverified grants. All with temp HOME and fake processes or gateway. pnpm validate green (738 tests).

https://claude.ai/code/session_01Fcv6uEy4zcXaigzDNxeW3j

… stale grants

- The CLI now owns frpc's lifetime for its data dir: a server killed hard
  left its frpc running (ppid 1) through restarts and `vana server stop`.
  The supervisor stops any frpc on <dataDir>/tunnel/frpc.toml when the
  server exits and before every (re)start; `vana server stop` stops it too.
- `vana login` says "Your Personal Server is not running" when this account
  has a data dir here or a registration at the gateway, and keeps "No
  Personal Server found" for new accounts.
- Installing the server runtime falls back to an npm on PATH when the one
  beside Node is missing or broken, and otherwise explains how to fix it
  (exit 6) instead of crashing with `spawn .../npm ENOENT`.
- `vana app requests show|list` check each grant at the gateway and report
  revoked or replaced grants with live: false and a new `vana app request`
  as next; an unreachable gateway is reported as unverified.

Claude-Session: https://claude.ai/code/session_01Fcv6uEy4zcXaigzDNxeW3j
The real-process supervisor tests sent kill -9 as soon as the fake server
wrote its pid file, which it does just before its ready line. On a busy
runner the kill could land in between: a server that dies before it is
ready is a failed first start, which is never restarted, so the test
waited 10s for a restart that could not come. Wait for server-ready too.
Also bound the ps that a restart waits on.

Claude-Session: https://claude.ai/code/session_01Fcv6uEy4zcXaigzDNxeW3j
@volod-vana
volod-vana merged commit 0a7c784 into main Oct 7, 2026
6 checks passed
github-actions Bot pushed a commit that referenced this pull request Oct 7, 2026
## [0.38.10](v0.38.9...v0.38.10) (2026-10-07)

### Bug Fixes

* **server,app:** own the tunnel client, clearer login and npm errors, stale grants ([#85](#85)) ([0a7c784](0a7c784))
@github-actions

github-actions Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 0.38.10 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to 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