Repository navigation
Conversation
Use the existing local account policy to run agy version and usage probes in the selected WSL distro. Reuse guarded process and shell helpers while preserving quota safety checks and native execution.
📝 Walkthrough
Priority: ➖ Normal Severity of issue fixed: Medium Merge Risk: 🔵 Low · up to
|
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
912d2fe3-0880-40d9-87e6-1080ce3bf80a
📒 Files selected for processing: 10
src/main/provider-account-services.tssrc/main/rate-limits/antigravity-usage-command.tssrc/main/rate-limits/antigravity-usage-fetcher.test.tssrc/main/rate-limits/antigravity-usage-fetcher.tssrc/main/rate-limits/antigravity-usage-wsl.test.tssrc/main/rate-limits/service-antigravity-usage.test.tssrc/main/rate-limits/service/service-configuration.tssrc/main/rate-limits/service/service-full-cycle-preparation.tssrc/main/rate-limits/service/service-state.tssrc/main/rate-limits/service/service-types.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
| maxOutputBytes: ANTIGRAVITY_USAGE_MAX_OUTPUT_BYTES, | ||
| signal: options.signal | ||
| }) | ||
| return wslCommand ? { ...result, stdout: wslCommand.readStdout(result.stdout) ?? '' } : result |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Do not classify unfenced WSL stderr as CLI output.
For WSL probes, buildWslAntigravityCommand redirects agy stderr into the fenced stdout with 2>&1. As a result, result.stderr holds only output from outside the fence: login-shell startup files, the shell itself, and wsl.exe. The fenced stdout feeds the version parse and stdoutShowsModelTurn. The unchanged classifier at Line 219 still receives ${result.stdout}\n${result.stderr}. Startup noise from a user's profile can therefore drive the sign-in, rate-limit, or server classification. This breaks the startup-output fencing that the PR applies to every other read.
The fix is to clear stderr in the WSL branch of runProbe. The fenced stdout already contains the CLI's real stderr, so no CLI output is lost.
🛡️ Proposed fix
--- "a/src/main/rate-limits/antigravity-usage-fetcher.ts"
+++ "b/src/main/rate-limits/antigravity-usage-fetcher.ts"
@@ -162,7 +162,10 @@
maxOutputBytes: ANTIGRAVITY_USAGE_MAX_OUTPUT_BYTES,
signal: options.signal
})
- return wslCommand ? { ...result, stdout: wslCommand.readStdout(result.stdout) ?? '' } : result
+ // Why: agy stderr is merged into the fence; raw stderr is only login-shell/wsl.exe noise.
+ return wslCommand
+ ? { ...result, stdout: wslCommand.readStdout(result.stdout) ?? '', stderr: '' }
+ : result
}
// Recheck each read: the CLI can be replaced while Orca runs; unsupported reads spend quota.📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| return wslCommand ? { ...result, stdout: wslCommand.readStdout(result.stdout) ?? '' } : result | |
| // Why: agy stderr is merged into the fence; raw stderr is only login-shell/wsl.exe noise. | |
| return wslCommand | |
| ? { ...result, stdout: wslCommand.readStdout(result.stdout) ?? '', stderr: '' } | |
| : result |
ELI5
If Antigravity is installed inside WSL, Orca now asks that WSL installation for quota. Previously, Windows Orca searched only Windows and reported that the CLI was missing.
What Changed
Pass the existing local account runtime target to each Antigravity usage fetch. On Windows with a WSL target, run the version and usage commands through the selected distribution's login shell using the shared WSL helpers. Resolve the guest executable, fence parsed output against startup banners, and set the probe environment inside the guest.
Keep the minimum version, timeouts, output limit, abort signal, sign-in classification, and process-wide model-turn latch. Reuse the background distro gate so polling cannot boot a stopped or unconfirmed distribution. Native execution, Claude/Codex fetchers, UI code, and translations remain unchanged.
Why
The Windows PATH cannot locate a CLI installed only in the Linux guest. Reusing the account policy keeps quota retrieval aligned with the selected runtime without another setting. Shared process and shell helpers preserve Orca's Windows launch protections and prevent login banners from satisfying a version check or appearing as quota output.
Linked Issue
Fixes #31740
Visual Proof
N/A — no UI change. Not launched locally; the change only decides which machine runs the existing quota probe, so the status bar shows the same Antigravity meter it already renders on macOS and Linux.
Testing
Executed on Linux in the WSL workspace:
ORCA_BACKGROUND_LAUNCH=1 nice -n 19 npx vitest run --config config/vitest.config.ts src/main/rate-limits --maxWorkers=1: 838 passed, 1 opt-in real-CLI test skipped.ORCA_BACKGROUND_LAUNCH=1 nice -n 19 pnpm tc:node: passed, no type errors in 17,255 files.git diff --check: passed.The WSL regression suite executes the actual generated POSIX scripts with isolated fake login-shell and CLI fixtures. It covers named/default distributions, guest-only PATH lookup, paths containing spaces, probe environment, startup noise, minimum version and failure guards, missing fences, sign-in errors, timeout handling, the model-turn latch, and stopped distributions. Native-platform routing and runtime changes between refreshes also have regression coverage.
Also ran the generated guest script against a real signed-in
agy1.4.3 in Ubuntu-26.04 (the partwsl.exe --exechands to the distro): the version check returned1.4.3past the login-shell banner, and/usagereturned the Gemini and Claude/GPT weekly and five-hour pools, parsed by the existing reader without spending a model turn.Windows, macOS, SSH, mobile, and rendered UI were not manually tested. Full repository lint/typecheck/test/build remain for CI. Dependency setup logged an Electron archive extraction failure because
unzipwas unavailable; no Electron application was launched, and the requested checks completed successfully.AI Disclosure
Written with OpenAI Codex (GPT-6-Astra) and Claude Code (Claude Opus 5.5). Reported by a Japanese-speaking user.
Review
Reviewed the runtime wiring, guest environment delivery, output capture, version guard, and native execution path. The service boundary test checks that runtime settings are read again on subsequent refreshes and remain independent of Codex account selection.
Agent skill upstream boundary
Notes
WSL routing is restricted to Windows. No settings schema, RPC contract, renderer state shape, or mobile protocol changes are introduced. Execution does not depend on a repository or worktree, so folder workspaces use the same account policy. Remote/native Linux execution keeps the native path. All launches use the existing process wrapper and quoted shell arguments.
Runtime setting changes apply on the next full fetch cycle. Existing Antigravity stale-result/cache behavior during an in-flight runtime switch is unchanged; target-specific cache invalidation is outside this fix.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)Not launched locally, and full lint/typecheck/test/build are left to CI.