Log only the origin of the `gh-aw` engine's base URL, so credentials in `PAI_BASE_URL` stay out of run logs

Merged
DS
15d ago
+29-9

Why we make these changes

The gh-aw engine's startup line printed the base URL as configured. Userinfo or a query-string credential in PAI_BASE_URL, or in the OPENAI_BASE_URL / ANTHROPIC_BASE_URL fallback, therefore reached the workflow run log, which is not private. The OTLP endpoint on the same line was already reduced to its origin. Both fields now go through one originForLog function: the URL's origin, or (unparsable) when the value does not parse.

New public surface

None.

User-visible behavior

-[pydantic-ai] provider=(PAI_BASE_URL) model=gpt-5 baseUrl=https://user:token@endpoint.example/v1?key=value
+[pydantic-ai] provider=(PAI_BASE_URL) model=gpt-5 baseUrl=https://endpoint.example

The client still receives the URL as configured.

Verification

test_the_startup_log_names_only_endpoint_origins covers userinfo, a query string, and an unparsable value, for both baseUrl= and otlp=, and checks that the client's base URL is unchanged. It failed on main in all three cases.

What changes for existing users

The startup log line now shows only the base URL's scheme, host and port; requests are unchanged.

PR decisions

2026-11-20 · Shared originForLog for baseUrl and OTLP · iter -

  • Decision: Replace the OTLP try/catch with one originForLog(url) arrow used by both baseUrl= and otlp=; log origin, else (unparsable)
  • Why: Two call sites, so not a single-use helper; one copy of the redaction keeps the two log fields from drifting; origin matches the existing OTLP control and the issue plan
  • Source: https://github.com/pydantic/pydantic-ai/issues/10484#issuecomment-6235846967
  • Session: ecc3bae9-fc39-4b9a-bdc7-b7f72226b90c

2026-11-20 · Keep the baseUrl= key and drop the path · iter -

  • Decision: Keep the log key baseUrl= while its value is now the origin only; the path is not logged
  • Why: otlp= already logs an origin under the endpoint's name; a path can also carry a token, and no tracked file parses the line (git grep)
  • Source: https://github.com/pydantic/pydantic-ai/issues/10484
  • Session: ecc3bae9-fc39-4b9a-bdc7-b7f72226b90c

2026-11-20 · Pinned engine import left for a pin bump · iter -

  • Decision: Do not edit .github/aw/imports/ or the .lock.yml workflows; they pin the engine to a merge commit and move in a separate pin-bump PR
  • Why: The pin needs this PR's merge commit; repo workflows set a credential-free endpoint, per the issue
  • Source: https://github.com/pydantic/pydantic-ai/pull/13924
  • Session: ecc3bae9-fc39-4b9a-bdc7-b7f72226b90c

2026-11-20 · pre-push review 1 of 3 at 55b6348c273a0fbb763c812b6effe3320e895c4c · iter -

2026-11-20 · pre-push review 1 of 3 at 55b6348c273a0fbb763c812b6effe3320e895c4c · iter -

2026-11-20 · Step 7 second opinion: none · iter -

  • Decision: No additional review surface; required reviews gate
  • Why: Overmanager's pick for David, 2026-11-20T12:53Z: an S change to one log line, no public API, docs or request change, three reviewers approved head 55b6348c
  • Source: https://github.com/pydantic/pydantic-ai/pull/14081
  • Session: ecc3bae9-fc39-4b9a-bdc7-b7f72226b90c

Checklist

  • No breaking changes in accordance with the version policy.
  • Any permitted compatibility impact has a label, warning, migration and release note, and an exact API-check waiver if the gate reports it.
  • PR title is fit for the release changelog.

Summary by cubic

Stops the gh-aw engine's startup log from printing the configured base URL, so credentials carried in PAI_BASE_URL (or the OPENAI_BASE_URL / ANTHROPIC_BASE_URL fallbacks) no longer reach workflow run logs, which are not private. The baseUrl= field now logs only the URL's origin, matching the existing behavior for otlp=; unparsable values log as (unparsable), and the client keeps receiving the URL as configured.

Details

  • Both log fields now share one originForLog helper, replacing the OTLP-only try/catch.
  • Adds a parametrized test covering userinfo, query-string credentials, and unparsable values for both fields, and asserts the client's base URL is unchanged.