Repository navigation
Port upstream v0.60.1 Vertex OAuth validation - #494
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 code-quality review (Oracle-coordinated read-only swarm) Verdict: BLOCKED pending live-path ownership and lifetime validation. Merge-blocking finding: rust/src/providers/vertexai/token_refresher.rs:181-198 validates the response only inside VertexAITokenRefresher, but rust/src/providers/vertexai/mod.rs:104-179 shows the production path uses VertexAIProvider::refresh_access_token and its own serde_json::Value parsing. The new validation therefore does not protect the live OAuth request and adds a second refresh implementation. Make one owner canonical: wire the refresher into the provider path and remove the duplicate, or move the typed validation into the provider method and delete the unused implementation. A second merge-blocking boundary is rust/src/providers/vertexai/token_refresher.rs:77, 159-160, 193: expires_in remains an unchecked f64 with a silent default and an unconditional cast. Validate a finite, bounded whole-second lifetime before constructing expiry state, or explicitly preserve a documented default only when the field is absent. Focused parser tests pass, but they do not prove the live path until the ownership issue is repaired. |
|
Thermo verdict confirmed — BLOCKED. Oracle’s adjudication confirms that the typed response validation added here is isolated to VertexAITokenRefresher, which is not on the production path. The live provider still uses VertexAIProvider::refresh_access_token in rust/src/providers/vertexai/mod.rs:104-179 and parses through serde_json::Value. Harden that live path with one typed response parser and remove or defer the unused parallel implementation so the port changes production behavior. |
|
Thermo follow-up: blocker fixed and validated. Oracle had blocked this PR because typed validation was added only to the unused Validation: Vertex live response tests 4/4; Rust clippy with Oracle post-fix verdict: PASS. Hosted CI remains a separate process gate. |
Summary
Port the Windows equivalent of upstream CodexBar v0.60.1 commit
237bf22a1.A successful Vertex AI OAuth refresh now requires a usable
access_token. Missing, empty, and whitespace-only tokens are rejected instead of silently reusing the previous access token.Scope
rust/src/providers/vertexai/token_refresher.rs.reqwestform builder.Other v0.60.1 upstream changes were audited and left out because the Windows implementation already covers them or uses a platform-specific design.
Validation
cargo fmt --allcargo clippy --manifest-path rust/Cargo.toml --all-targets -- -D warningscargo clippy --manifest-path apps/desktop-tauri/src-tauri/Cargo.toml --all-targets -- -D warningscargo test --manifest-path rust/Cargo.toml vertexai::token_refresher— 7 passedcargo test --manifest-path apps/desktop-tauri/src-tauri/Cargo.toml— passedgit diff --checkcost_scanner::codex::tests::reasoning_survives_scan_rebuild_and_cache_reloadfailure; the failing test also fails when rerun alone.