Repository navigation
feat(providers): add model request transport overrides - #60200
Conversation
Greptile SummaryThis PR wires All changes are backed by targeted unit tests covering schema acceptance, runtime secret resolution, snapshot redaction, exec-ref parity, and attribution policy. No breaking changes to existing config surfaces. Confidence Score: 5/5Safe to merge — all new surfaces are additive, backward-compatible, and covered by targeted tests. All changes are either schema additions (new optional field on ModelProviderConfig), a clean hoist of existing schema definitions, or well-understood bug fixes (OpenRouter attribution host-gating). The runtime secret collector correctly removes the early No files require special attention. Reviews (1): Last reviewed commit: "Merge branch 'main' into refactor/provid..." | Re-trigger Greptile |
2c93d92 to
759399d
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2c93d922f8
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
* feat(providers): add model request transport overrides * chore(providers): finalize request override follow-ups * fix(providers): narrow model request overrides
* feat(providers): add model request transport overrides * chore(providers): finalize request override follow-ups * fix(providers): narrow model request overrides
* feat(providers): add model request transport overrides * chore(providers): finalize request override follow-ups * fix(providers): narrow model request overrides
* feat(providers): add model request transport overrides * chore(providers): finalize request override follow-ups * fix(providers): narrow model request overrides
* feat(providers): add model request transport overrides * chore(providers): finalize request override follow-ups * fix(providers): narrow model request overrides
* feat(providers): add model request transport overrides * chore(providers): finalize request override follow-ups * fix(providers): narrow model request overrides
* feat(providers): add model request transport overrides * chore(providers): finalize request override follow-ups * fix(providers): narrow model request overrides
* feat(providers): add model request transport overrides * chore(providers): finalize request override follow-ups * fix(providers): narrow model request overrides
* feat(providers): add model request transport overrides * chore(providers): finalize request override follow-ups * fix(providers): narrow model request overrides
Summary
models.providers.*had no first-classrequesttransport surface, so generic model-provider overrides could not express shared headers/auth/proxy/TLS and SecretRefs there were not runtime-real.models.providers.*.request, wired it through embedded model resolution, resolved and documented provider request SecretRefs end to end, and host-gated OpenRouter attribution to native/default routes.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
Root Cause / Regression History (if applicable)
models.providers.*still only exposed legacyheaders/authHeaderknobs and the secrets runtime only collected the older provider surfaces.git blame, prior PR, issue, or refactor if known): follows the recent provider request policy centralization work onmain.Regression Test Plan (if applicable)
src/agents/pi-embedded-runner/model.test.ts,src/secrets/runtime.test.ts,src/secrets/runtime.coverage.test.ts,src/secrets/target-registry.test.ts,src/agents/provider-attribution.test.ts.User-visible / Behavior Changes
models.providers.<id>.request.{headers,auth,proxy,tls}is now a supported config surface.provider: "openrouter"no longer injects OpenRouter attribution headers whenbaseUrlpoints at a custom proxy/self-hosted endpoint.Diagram (if applicable)
Security Impact (required)
Yes, explain risk + mitigation: this expands SecretRef-capable config on model providers; mitigation is explicit runtime resolution, snapshot redaction, target-registry coverage, and host-gating OpenRouter attribution off custom proxy routes.Repro + Verification
Environment
models.providers.<id>.request.*Steps
models.providers.openai.requestwith SecretRefs for headers/auth/proxy/TLS.provider: openrouterwith a custom proxybaseUrland inspect attribution policy.Expected
Actual
Evidence
Human Verification (required)
pnpm testsuite.Review Conversations
Compatibility / Migration
Risks and Mitigations
docs/reference/secretref-user-supplied-credentials-matrix.jsonanddocs/reference/secretref-credential-surface.md, plus registry tests.