fix: keep delegate credential pools provider-coherent - #39862
Conversation
teknium1
left a comment
There was a problem hiding this comment.
Thanks for tracing the parent-pool rebinding path. The reported non-custom mismatch remains on current main: tools/delegate_tool.py:3009-3010 can return a parent pool without checking the pool's provider, then tools/delegate_tool.py:1385-1389 attaches it after child construction and :1770-1778 leases it.
Problems
- The new exact-string matcher at
tools/delegate_tool.py:1366in this PR would reject valid named custom pools. Currentagent/credential_pool.py:448-483intentionally matches a child runtimeprovider="custom"toprovider="custom:<name>"only when its base URL resolves to the same endpoint key. - The resolver patch predates the current custom-endpoint branch at
tools/delegate_tool.py:2971-3007; that branch must remain endpoint-scoped.
Suggested changes
- Reuse
credential_pool_matches_provider(..., base_url=...)at both resolver and lease boundaries rather than adding a local exact comparison. - Add a lease-path regression for a matching
custom:<name>pool, alongside the mismatched-provider case.
This is an automated hermes-sweeper review.
|
|
||
| child_pool = getattr(child, "_credential_pool", None) | ||
| leased_cred_id = None | ||
| if child_pool is not None and not _pool_matches_provider( |
There was a problem hiding this comment.
This exact provider-name check regresses named custom pools on current main: a child runtime uses provider="custom", while a correctly scoped production pool is keyed custom:<name>. Please reuse agent.credential_pool.credential_pool_matches_provider(..., base_url=child.base_url) so only the matching custom endpoint is accepted.
There was a problem hiding this comment.
Addressed in the current-main companion PR Waritboo#2 (a85af2c49): it reuses credential_pool_matches_provider(..., base_url=...), preserves matching custom:<name> pools, and adds lease-path coverage. It also extends coherence to same-provider/different-endpoint pools (Azure vs public OpenAI).
|
Extended this PR with a current-main, endpoint-aware follow-up:
I could not push directly to the contributor fork despite |
|
Tracking issue for the same-provider/different-endpoint credential-boundary bug: #68237 The local/current-main endpoint-aware validation is covered by companion PR Waritboo#2 and is intended to extend this PR. |
Summary
Test Plan
python -m pytest tests/tools/test_delegate.py -k 'credential or provider or runtime or pool' -o 'addopts=' -qpython -m pytest tests/tools/test_delegate.py -o 'addopts=' -qpython -m py_compile tools/delegate_tool.py tests/tools/test_delegate.pygit diff --check origin/main...HEADOPENCODE_FC_OK,CODEX_FC_OKDELEGATE_FRESH_E2E_OKbad_count=0)