Repository navigation
Conversation
ApprovabilityVerdict: Approved at Macroscope's review found this PR approvable — Usage-access requests now preserve literal whitespace at directory-path boundaries while still rejecting blank paths. This corrects path representation without changing consent or file-access permissions. Notes:
You can add or adjust custom eligibility rules. Learn more. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
9214e2a to
9268c02
Compare
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Dismissing prior approval to re-evaluate e27743f
Problem
UsageAccessRequest.pathsinpackages/contracts/src/usage.tsusesSchema.Array(TrimmedNonEmptyString)instead ofSchema.Array(NonBlankString), unlikeUsageBucket.sourcePathandUsageSourceFingerprint.resolvedHomePathin the same file. When an enabled, unasked provider resolves a transcript directory with leading or trailing whitespace (for example Pi withPI_CODING_AGENT_SESSION_DIRor--session-dir),UsageService.accessRequestspopulates the raw path, andserver.getUsageSummarysilently trims it during RPC wire encoding/decoding.Deterministic repro on
origin/main(6a4651b206788c3f21dafc7b950bcced57e05ee6)Save
prove-access-request-paths.mjsfrom the before/after runtime transcript outside the checkout, runvp i, then runnode /path/to/prove-access-request-paths.mjs "$(mktemp -d)". It starts an isolated server withpienabled (unasked) andPI_CODING_AGENT_SESSION_DIR="<tmp>/pi-sessions ", authenticates viat3 pair->/api/auth/browser-session->/api/auth/websocket-ticket/rpc, and callsserver.getUsageSummaryover/ws.accessRequests[0].pathson the wire is["<tmp>/pi-sessions"](trailing space stripped, exit 1).accessRequests[0].pathspreserves["<tmp>/pi-sessions "]while blank strings remain rejected (exit 0).Change
Switch
UsageAccessRequest.pathsinpackages/contracts/src/usage.tsfromSchema.Array(TrimmedNonEmptyString)toSchema.Array(NonBlankString)so literal edge whitespace survivesserver.getUsageSummarywire encoding and decoding while still rejecting blank strings. Because the shared contract is used by the server and all clients (web, desktop, mobile), no server or client call-site changes are needed; current web/mobile access prompt UIs render driver descriptions rather thanpaths, while RPC callers receive the exact resolved directories.Scope
Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.
Verification
packages/contracts/src/rpc.test.ts(preserves literal edge whitespace in UsageAccessRequest paths over server.getUsageSummary):origin/main(6a4651b206788c3f21dafc7b950bcced57e05ee6):AssertionError: expected [ '/tmp/pi-sessions', …(1) ] to deeply equal [ ' /tmp/pi-sessions', …(1) ].706a29291372a92a637293f46ebb0ba5a78c525b).Wire accessRequest.pathschanged from["/tmp/.../pi-sessions"](base, exit 1) to["/tmp/.../pi-sessions "](head, exit 0).vp run check:changedexited0: format (0.6s), lint (1.3s), knip (14.9s), typecheck across 39 packages (41.3s), and 6 tests across 2 files (8.2s) all passed.UsageAccessRequest.paths); relay/tunnel sessions; providers other than Pi; full CI.Authored by Gemini 4 Neon (Antigravity); reviewed by GPT-6.2 Sol (Codex).
Not shown