Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Thermo-nuclear reviewScope: Spec conformance: matches. Reason text comes only from the typed variant ( Findings
No blocking structural issues. Fixing item 1 in a follow-up commit. |
Thermo-nuclear review follow-upReviewed by Codex gpt-6-luna (xhigh); verified and validated by Claude. Fixed: item 1 (collapsed the two Left as is: items 2 (watch item), 3 (deliberate tested guard) and 4 (deferred by spec). Codex found no other valid findings. Commands run: |
CUA proof (rerun)Build commit: 093031c (PR head at capture time, verified via gh pr view). Debug build via pnpm run tauri:build:debug, not rebuilt for this run. Proof-only patches (uncommitted, not part of the PR): root Cargo.toml [patch.crates-io] dirs shim redirecting home/config dirs to CODEXBAR_PROOF_HOME, plus the matching Cargo.lock dirs source/checksum lines. No source files patched, no seed, no mock server. Real AntigravityProvider::fetch_usage path with no agy binary and 3 empty proof conversation .db files. Commands: bash launch.sh trayPanel; bash launch.sh popOut; negative control (conversations folder renamed) with bash launch.sh popOut; driven with cua-driver.exe serve / call list_windows / call get_window_state --screenshot-out-file.
Screenshots (local, not committed): C:\Users\FSOS\AppData\Local\Win-CodexBar\port-audit\proof\672\shots\01-traypanel.png, C:\Users\FSOS\AppData\Local\Win-CodexBar\port-audit\proof\672\shots\02-popout.png, C:\Users\FSOS\AppData\Local\Win-CodexBar\port-audit\proof\672\shots\03-negative-control.png |
….0-antigravity-offline-reason
Port the rest of upstream CodexBar v0.65.0 steipete#3865: failed agy print-usage runs are classified into fixed text (signed out, eligibility, network, exit code, missing or unlaunchable executable) from captured stderr that is never logged or displayed, and local language-server failures keep their HTTP status, session-expired, timeout or connection category for the offline "Live usage" row. Oversized output on either stream is rejected before the exit status, like upstream SubprocessRunner.
Lane A review: fixes at 3444791Reviewed the whole branch against its base ( Defects found at 093031c
What changed (merge of the base at 15f1091, then one commit)
Commands and results (toolchain 1.98.0, run in the lane-a worktree through the build gate)
No frontend, locale or bridge change. No new dependencies. Pushed as a fast-forward (093031c..3444791). A browser-use UI proof at this head follows. |
UI proof (browser-use)Head: 3444791. Built from that commit with Setup
Screenshots are kept locally in the proof kit (
Seen but not caused by this PR (unchanged here)
Not covered in the UI
The PR stays a draft for the maintainer. |
Summary
When live Antigravity usage fails and the offline conversation-history snapshot is returned instead, the result carries one fixed-text display-detail row ("Live usage") that says why:
Live Antigravity usage is unavailable; showing offline data. <reason>The reason is a typed
LiveFailureReasonchosen where the failure happens (antigravity/offline_reason.rs). No error message, response body, URL, local path or stderr is ever read for it:agyfoundagyrun)agy -p /usagecould not startagy -p /usageexited non-zeroAuthRequired)agyfailures:cli_fallback.rsnow captures stderr through the same bounded reader as stdout (1 MiB cap per stream, drained concurrently with the exit wait). stderr is only matched against upstream's fixed markers in the newcli_print_failure.rs(a port ofAntigravityCLIPrintFailure). It is never logged, stored or displayed. A login prompt or sign-in marker maps toAuthRequired. As in upstreamSubprocessRunner, oversized output on either stream is rejected before the exit status is considered.A successful live fetch carries no row. The row renders through the existing
displayDetailspath (tray panel card, provider settings usage section andcodexbar usageCLI output), so no frontend change is needed.Upstream reference
f28ddcaf3).Sources/CodexBarCore/Providers/Antigravity/AntigravityProviderDescriptor.swift(AntigravityOfflineFetchStrategy.diagnostic(forPriorFailure:),reason(for:)),AntigravityCLIPrintFailure.swift,AntigravityStatusProbe.swift(cliReportFailed,timedOut,apiErrordescriptions),Host/Process/SubprocessRunner.swift(output limit before exit status),ProviderFetchPlan.swift(resolveFallbackError).Tests/CodexBarTests/AntigravityCLIUsageReportTests.swift: the four stderr cases (eligibility plus network, not eligible, signed out, network) with Windows.cmdfixtures that print upstream's stderr samples, the unrecognized-stderr case, and the "print failure does not expose stderr" case.ProvidersTab.tsx::providerSidebarSubtitleshows the snapshot's source label and no provider has a Version row.Interplay with #615 (Antigravity CLI override safety)
#615 makes an unusable
ANTIGRAVITY_CLI_PATHfail closed withProviderError::NotInstalled("ANTIGRAVITY_CLI_PATH is set but does not point to a usable agy file: <path> ..."). This PR only derives reasons from typed constructors, so that error reduces to the fixed hint "check Diagnostics for per-source details" and the local path never reaches the card. With both merged, #615's managed-branchfailure = Some(error)needsfailure = Some(error.into())because the fallback failure is now aLiveFailure; the?intry_print_usage_fallbackconverts on its own. That adaptation belongs on #615's branch when it is brought onto this stack.Ported / Deferred
Ported:
diagnostic(forPriorFailure:),reason(for:)) for every failure category Windows can produce: not running, timeout, HTTP 401/403 (session expired), other HTTP status, refused connection (upstream showsURLError(.cannotConnectToHost)text for transport failures), classified CLI failure, and the fixed hint for everything else.AntigravityCLIPrintFailure: executable not found, launch failed,exited <code>with network, eligibility-network and not-eligible reasons, sign-in detection (upstream's login prompts and sign-in markers).resolveFallbackError: a CLI fallback that is unavailable (noagy) keeps the earlier local failure; a failed CLI run replaces it.Deferred or not applicable:
AntigravityRemoteFetchErrorreasons: the remote/OAuth strategy is not ported (oauthreturnsUnsupportedSource).AuthRequiredis terminal and surfaces the sign-in error instead of offline data.agyreadiness timeout: still an untyped error (generic hint). It is only reachable when the CLI fallback with the same binary also fails, and that later failure replaces it.ANTIGRAVITY_CLI_PATH(see Port Antigravity CLI override safety #615 above); it shows the generic hint.docs/antigravity.mdparagraph: Windows docs have no Antigravity provider page (docs/PROVIDERS.mdhas no Antigravity section), so no doc was added.resolve_runtime_fallback_with_offline: that path runs the Windows managed-agylookup against the real machine. The branch's output (LiveFailure::not_running()) is covered by the typed-failure table.Validation
Toolchain 1.98.0, build gate (4 jobs, E-cores).
cargo +1.98.0 fmt --all --check: cleancargo +1.98.0 clippy --workspace --all-targets -- -D warnings: passcargo +1.98.0 test -p codexbar: 2262 passed, 0 failed, 1 ignoredcargo +1.98.0 test -p codexbar-desktop-tauri: 477 passed, 1 failed:bootstrap_payload_exposes_every_provider_variant(known catalog-size drift, Isolate bootstrap payload test from real settings #684, fixed by Make the bootstrap catalog test hermetic (#684) #711; unrelated to this PR)New tests:
cli_print_failure.rs(fixed descriptions match upstream, the upstream stderr table, blank/unrecognized stderr, login prompts and sign-in markers, non-ASCII bytes around a prompt, word boundaries for network markers, spawn errors, stderr never retained);cli_fallback.rs(oversized stdout or stderr rejected before the exit status, success ignores stderr, Windows.cmdfixtures for each upstream stderr case plus signed out, missingagy.exe);offline_reason_tests.rs(row text per failure, HTTP body never echoed, HTTP failure without history keeps the original error, masked CLI failure explained, unavailable CLI keeps the local reason, real loopback timeout and refused connection classified without the URL, leak table,AuthRequiredadds no row, live success adds no row).mod.rsstays at 994 lines; the offline tests moved out oftests.rs(805 lines).Affected areas
rust/src/providers/antigravity/)UI proof
browser-use proof at 3444791: #672 (comment) (A0-A6 PASS).
agy: the row carries the generic "check Diagnostics for per-source details" hint.PATHthat keeps the language-server scan from starting; the kit exe made no outbound connection.The earlier CUA proof at 093031c (not-running reason) is superseded.