fix(delegate): lease child pool credentials per task - #5580
Closed
MestreY0d4-Uninter wants to merge 2 commits into
Closed
fix(delegate): lease child pool credentials per task#5580MestreY0d4-Uninter wants to merge 2 commits into
MestreY0d4-Uninter wants to merge 2 commits into
Conversation
This was referenced Apr 6, 2026
teknium1
pushed a commit
that referenced
this pull request
Apr 7, 2026
Cherry-picked from PR #5580 by MestreY0d4-Uninter. - Share parent's credential pool with child agents for key rotation - Leasing layer spreads parallel children across keys (least-loaded) - Thread-safe acquire_lease/release_lease in CredentialPool - Reverted sneaked-in tool-name restoration change (kept original getattr + isinstance guard pattern)
teknium1
pushed a commit
that referenced
this pull request
Apr 7, 2026
Cherry-picked from PR #5580 by MestreY0d4-Uninter. - Share parent's credential pool with child agents for key rotation - Leasing layer spreads parallel children across keys (least-loaded) - Thread-safe acquire_lease/release_lease in CredentialPool - Reverted sneaked-in tool-name restoration change (kept original getattr + isinstance guard pattern)
Contributor
|
Merged via PR #5748. Both commits cherry-picked with authorship preserved. Removed the sneaked-in tool-name restoration change (kept original getattr + isinstance guard). Thanks @MestreY0d4-Uninter! |
gagan114662
added a commit
to gagan114662/hermes-agent
that referenced
this pull request
Apr 9, 2026
Five symbols were removed from our fork when the upstream merge used --theirs on conflicting files: - tools/registry.py: add ContextModifier dataclass + is_concurrency_safe support to ToolEntry and register() (our B9 feature) - hermes_cli/plugins.py: add emit_hook() fire-and-forget helper (our B6 feature) - model_tools.py: add coerce_tool_args/_coerce_value/_coerce_number/ _coerce_boolean (exists in upstream, was absent in our fork) - tools/environments/local.py: add _OUTPUT_FENCE, _clean_shell_noise, _extract_fenced_output helpers - tools/delegate_tool.py: add _resolve_child_credential_pool (from PR NousResearch#5580 credential pool sharing) All five were referenced by existing tests that were failing at collection. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Tommyeds
pushed a commit
to Tommyeds/hermes-agent
that referenced
this pull request
Apr 12, 2026
Cherry-picked from PR NousResearch#5580 by MestreY0d4-Uninter. - Share parent's credential pool with child agents for key rotation - Leasing layer spreads parallel children across keys (least-loaded) - Thread-safe acquire_lease/release_lease in CredentialPool - Reverted sneaked-in tool-name restoration change (kept original getattr + isinstance guard pattern)
angelburgosrosado
pushed a commit
to angelburgosrosado/hermes-agent
that referenced
this pull request
Apr 27, 2026
Cherry-picked from PR NousResearch#5580 by MestreY0d4-Uninter. - Share parent's credential pool with child agents for key rotation - Leasing layer spreads parallel children across keys (least-loaded) - Thread-safe acquire_lease/release_lease in CredentialPool - Reverted sneaked-in tool-name restoration change (kept original getattr + isinstance guard pattern)
02356abc
pushed a commit
to 02356abc/hermes-agent
that referenced
this pull request
May 14, 2026
Cherry-picked from PR NousResearch#5580 by MestreY0d4-Uninter. - Share parent's credential pool with child agents for key rotation - Leasing layer spreads parallel children across keys (least-loaded) - Thread-safe acquire_lease/release_lease in CredentialPool - Reverted sneaked-in tool-name restoration change (kept original getattr + isinstance guard pattern)
gweeteve
pushed a commit
to gweeteve/hermes-agent
that referenced
this pull request
Jun 2, 2026
Cherry-picked from PR NousResearch#5580 by MestreY0d4-Uninter. - Share parent's credential pool with child agents for key rotation - Leasing layer spreads parallel children across keys (least-loaded) - Thread-safe acquire_lease/release_lease in CredentialPool - Reverted sneaked-in tool-name restoration change (kept original getattr + isinstance guard pattern)
waefrebeorn
pushed a commit
to waefrebeorn/slermes
that referenced
this pull request
Jul 2, 2026
Cherry-picked from PR NousResearch#5580 by MestreY0d4-Uninter. - Share parent's credential pool with child agents for key rotation - Leasing layer spreads parallel children across keys (least-loaded) - Thread-safe acquire_lease/release_lease in CredentialPool - Reverted sneaked-in tool-name restoration change (kept original getattr + isinstance guard pattern)
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds lightweight lease management for delegated child agents that already have access to a credential pool.
Without leases, multiple parallel children can still stampede the same credential even when the pool has other available entries. That weakens the benefit of child pool participation under concurrent delegation.
This patch keeps the scope intentionally small:
CredentialPoolfinally, even on errorsWhat changed
agent/credential_pool.pyDEFAULT_MAX_CONCURRENT_PER_CREDENTIAL = 1acquire_lease()release_lease()active_lease_count()tools/delegate_tool.py_run_single_child()now acquires a lease when the child has a credential pool_swap_credential()finallyWhy
This is the next minimal extraction after #5576.
It still avoids the larger/more invasive pieces from #5374:
Validation
Automated
/home/ubuntu/.hermes/hermes-agent/venv/bin/python -m py_compile agent/credential_pool.py tools/delegate_tool.py tests/tools/test_delegate.py tests/test_credential_pool.py/home/ubuntu/.hermes/hermes-agent/venv/bin/python -m pytest -q -o addopts='' tests/tools/test_delegate.py -k 'ChildCredentialPoolResolution or ChildCredentialLeasing or DelegationProviderIntegration'Result:
15 passed, 44 deselected/home/ubuntu/.hermes/hermes-agent/venv/bin/python -m pytest -q -o addopts='' tests/test_credential_pool.py -k 'acquire_lease or release_lease'Result:
2 passed, 24 deselectedAdditional combined focused check:
/home/ubuntu/.hermes/hermes-agent/venv/bin/python -m pytest -q -o addopts='' tests/tools/test_delegate.py tests/test_credential_pool.py -k 'ChildCredentialPoolResolution or ChildCredentialLeasing or DelegationProviderIntegration or acquire_lease or release_lease'17 passed, 68 deselectedRelated context
fix(delegate): share credential pools with subagents)Scope notes
This PR should be reviewed as a follow-up slice, not as a standalone replacement for all credential-pool hardening work.