fix(delegation): keep credential pools endpoint-coherent - #68240
fix(delegation): keep credential pools endpoint-coherent#68240oferlaor wants to merge 4 commits into
Conversation
|
Reviewed against
Both leak paths are closed: One minor note (non-blocking): LGTM — this resolves the reported bug. |
teknium1
left a comment
There was a problem hiding this comment.
Thanks for targeting the real delegation credential-boundary gap. Current main still shares same-provider pools without an endpoint check at tools/delegate_tool.py:3462-3463, then leases and swaps an entry at tools/delegate_tool.py:1991-1996.
Problems
- Blocking: the proposed pool guard accepts a pool when any entry matches (
tools/delegate_tool.py:3239in this PR), but_run_single_childthen calls unfilteredacquire_lease()and swapscurrent()(tools/delegate_tool.py:1832-1837).CredentialPool.acquire_lease()selects across all available entries by lease count and priority, with no endpoint filter (agent/credential_pool.py:1940-1955). A mixed same-provider pool can therefore still lease a public-OpenAI entry for an Azure child.
Suggested changes
- Bind only an endpoint-matching entry, or validate the exact leased entry before
_swap_credential()and release it on mismatch. - Add a two-entry regression test where the nonmatching entry wins the normal lease selection.
Automated hermes-sweeper review.
|
Rebased the fix locally on current upstream Focused verification: I could not update this PR branch because the available PAT lacks the |
|
Maintainer assistance requested: the corrected current-main rebase is verified locally, but my fork PAT cannot update the rebased branch because it lacks GitHub's Ready patch: |
a85af2c to
4b83e2b
Compare
SummaryOne open PR, #68240, addresses #68237 by making delegated credential-pool eligibility provider-and-endpoint aware and filtering the actual lease selection so an Azure child cannot receive a public OpenAI credential from a mixed pool. Related pull requests
Suggested consolidationKeep #68240 open with a salvage path: preserve the endpoint-filtered lease selection, pre-lease coherence guard, and mixed-pool regression coverage now visible in the diff, and obtain contributor confirmation that these changes resolve the blocking keep_open review. There are no competing PRs in this complex to close as duplicates. Complex graphflowchart LR
classDef open fill:#dbeafe,stroke:#1d4ed8,color:#1e3a8a
classDef merged fill:#dcfce7,stroke:#15803d,color:#14532d
classDef closed fill:#e5e7eb,stroke:#6b7280,color:#1f2937
classDef unverified fill:#f3f4f6,stroke:#9ca3af,color:#374151
classDef best stroke-width:3px,stroke:#b45309
classDef target stroke-width:3px,stroke:#4338ca
I68237(["issue #68237 (open)"])
P68240["PR #68240 (open)"]
P68240 -->|best fix| I68237
class I68237 open
class P68240 open
class P68240 best
class P68240 target
click I68237 "https://github.com/NousResearch/hermes-agent/issues/68237"
click P68240 "https://github.com/NousResearch/hermes-agent/pull/68240"
Graph: solid arrow = fixes / best fix, dashed arrow = partial or unverified (see edge label); boxed group = PRs duplicating each other; amber border = best fix; indigo border = target; gray node = closed (state tag in the node label). Cross-PR triage: Reviewed 1 pull request and 1 issue in this complex. Each diff was read against this issue; Assessment working set: 11 kB of PR diffs, 5 kB of issue/PR text, 6 kB of discussion (6 comments), 3 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch. |
4b83e2b to
24e71b8
Compare
|
Refreshed onto current main and the mixed-pool blocking review is now addressed by filtering the actual credential lease by normalized endpoint. The review thread is resolved; 125 focused tests plus Ruff/compile/diff checks pass. GitHub reports the branch mergeable. CI is awaiting maintainer approval: https://github.com/NousResearch/hermes-agent/actions/runs/30846277217 |
|
Refreshed onto current main at |
6a297c9 to
065df34
Compare
d7d57d7 to
826fc47
Compare
826fc47 to
9031c96
Compare
Summary
current()cursor; revalidate that exact entry before swapping and fail closed if it disappeared or mismatched.custom:<name>and legacy adapter compatibility.delegation.inherit_fallback_providers(defaulttrue; setfalseto pin children to the primary route).Fixes #68237. Supersedes the historical endpoint-coherence attempt in #39862 and the temporary contributor-fork handoff Waritboo#2.
Current-main refresh
acc614e72fa6b635a19e5eddbc29ed147147a0909031c961825d846b1938384d7e05d27b4662a5c6Validation
python -m pytest tests/tools/test_delegate.py tests/agent/test_credential_pool_provider_boundary.py tests/agent/test_credential_pool.py tests/agent/test_credential_pool_lease_refresh_reselect.py -q -o 'addopts='→140 passedgit diff --check origin/main...HEAD→ passedpool.current()to a wrong-endpoint entry after lease acquisition and proves the child still binds the exact matching leased entry.