Skip to content

fix(vertex): bind model discovery to Google destinations - #821

Closed
luvs01 wants to merge 1 commit into
devfrom
fix/vertex-discovery-authority
Closed

luvs01 wants to merge 1 commit into
devfrom
fix/vertex-discovery-authority

Conversation

@luvs01

@luvs01 luvs01 commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Reject unsafe Vertex model-discovery destinations before reading ADC or ambient Google credentials. Discovery accepts HTTPS Google AI Platform authorities with the configured location; user information, nonstandard ports, fragments, and non-Google destinations are refused.
  • Bind asynchronously resolved credentials to the validated origin and check the exact outgoing URL immediately before every initial or paginated request. Provider configuration changes while credentials are resolving cannot redirect those credentials.
  • Apply the same checks to catalog discovery and the management discovery route. Add regression coverage and update the Vertex user guides and owning provider contracts.

This addresses the Daybreak finding. The branch is based on dev at 1d10758fa6ced80cdd780cb000bc5c4b83f84703; its reviewed tree is fadf8da26fb6aa997a09a4297e55bee0df96e0d6.

Verification

Linux and Bun 1.4.4, using mocked external transport:

  • bun scripts/test.ts --parallel=1 tests/adapters/google/vertex-model-discovery.test.ts tests/adapters/google/vertex-catalog.test.ts tests/server/management-provider-model-discovery.test.ts: 56 passed, 0 failed, 312 assertions on the final staged tree.
  • The final focused security regressions passed 9 tests / 109 assertions. An earlier seven-case regression comparison against unchanged production code produced 5 failures and 2 passes, demonstrating that the new cases exercise the original unsafe behavior.
  • bun run typecheck (2,533 files), bun run structure:check, bun run privacy:scan, and diff checks passed.
  • Documentation build passed: 775 pages / 117,806 internal links.
  • Independent read-only source review traced credential resolution, destination mutation, both discovery callers, every page, and the outbound transport guard. No concrete blocker was identified.

Validation limits: automatic approval review rejected the attempted broader test:changed run because selected tests make real outbound connections to api.deepseek.com. That run was stopped and is not claimed as passing; the focused tests above use mocked external transport. No live Google credential flow, installed application, or Windows/macOS test was performed.

Hosted follow-up: the automatically triggered changed-test job, gates, documentation build, and aggregate CI check have all completed successfully for this PR head (65db67235d2219cecd7e379321857dada9d56ae3). This hosted result is separate from the locally blocked attempt described above. No additional workflow was dispatched.

This PR remains Draft for maintainer security review and full platform acceptance.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

The last item records implementation and independent source review; it does not claim maintainer approval or full platform acceptance.

Summary by CodeRabbit

  • Documentation
    • Updated the Google Vertex AI guides with endpoint requirements for live model discovery and connection tests, including supported HTTPS endpoints and the standard HTTPS port.
    • Clarified that custom gateway endpoints do not receive Vertex credentials and that configured models remain available when a destination cannot be verified.
  • Bug Fixes
    • Vertex discovery and connection tests now verify each request destination before sending credentials, including paginated requests.

Validate the discovery destination before resolving ADC or ambient credentials, bind asynchronous credentials to that origin, and recheck the exact outgoing URL for initial and paginated catalog requests. Add regressions for hostile destinations and provider changes during credential resolution.
@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Vertex model discovery and connectivity tests now restrict credential use to approved Google AI Platform HTTPS origins. Each request, including pagination requests, is checked against its URL. The guides and provider documentation describe these endpoint rules.

Changes: Vertex destination authority

Layer / File(s) Summary
Destination admission and credential authority
src/providers/google-vertex-model-discovery.ts, tests/adapters/google/vertex-model-discovery.test.ts, structure/providers/google.md, structure/providers-and-adapters.md, docs-site/src/content/docs/guides/google-vertex.md, docs-site/src/content/docs/es/guides/google-vertex.md
Discovery accepts HTTPS URLs for the global Vertex host or a valid location-prefixed host. It rejects URLs with credentials, a port, or a fragment. Credential authority is bound to the approved origin, and send-time checks validate the request URL. Tests and documentation cover these rules and credential behavior.
URL-specific discovery and connectivity requests
src/codex/catalog/provider-models.ts, src/server/management/provider-routes.ts, tests/server/management-provider-model-discovery.test.ts
Catalog discovery and connectivity tests create outbound dependencies for each request URL, including paginated requests. Tests cover rejected destinations and approved regional requests with pagination.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Bug fix

Suggested reviewers: lidge-jun, xdober

Merge Risk: Minimal · up to 65db6

The change restricts Vertex discovery credentials to approved Google destinations while retaining configured models when discovery is rejected. No actionable merge-blocking issue is established; broader platform validation remains outstanding.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "fix(vertex): bind model discovery to Google destinations" matches the main change. The PR restricts Vertex model discovery to HTTPS Google AI Platform origins, binds resolved credentials to…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "fix(vertex): bind model discovery to Google destinations" matches the main change. The PR restricts Vertex model discovery to HTTPS Google AI Platform origins, binds resolved credentials to the validated origin, and rechecks each outgoing request URL. The title names the scope (Vertex) and the core security change without noise.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between 1d10758 and 65db672.

Files selected for processing: 9

  • docs-site/src/content/docs/es/guides/google-vertex.md
  • docs-site/src/content/docs/guides/google-vertex.md
  • src/codex/catalog/provider-models.ts
  • src/providers/google-vertex-model-discovery.ts
  • src/server/management/provider-routes.ts
  • structure/providers-and-adapters.md
  • structure/providers/google.md
  • tests/adapters/google/vertex-model-discovery.test.ts
  • tests/server/management-provider-model-discovery.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@github-actions

Copy link
Copy Markdown

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Nov 16, 2026

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@luvs01

luvs01 commented Nov 16, 2026 •

Copy link
Copy Markdown
Owner Author

No description provided.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant