Skip to content

fix(auxiliary): rebuild closed cached clients - #39790

Open
alex107ivanov wants to merge 3 commits into
NousResearch:mainfrom
alex107ivanov:pr/auxiliary-closed-client-cache
Open

alex107ivanov wants to merge 3 commits into
NousResearch:mainfrom
alex107ivanov:pr/auxiliary-closed-client-cache

Conversation

@alex107ivanov

Copy link
Copy Markdown
Contributor

Summary

  • evict cached auxiliary sync clients once their underlying HTTP client is closed
  • handle closed-client detection without treating mock attributes as closed clients
  • add regression coverage for cache reuse/rebuild behavior

Tests

  • .venv/bin/python -m pytest tests/agent/test_auxiliary_client.py tests/agent/test_crossloop_client_cache.py -q

@alt-glitch alt-glitch added type/bug Something isn't working comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P2 Medium — degraded but workaround exists labels Jun 5, 2026
@alex107ivanov
alex107ivanov force-pushed the pr/auxiliary-closed-client-cache branch 2 times, most recently from ee56912 to 8febed3 Compare June 6, 2026 19:25
@alex107ivanov

Copy link
Copy Markdown
Contributor Author

Rebased this PR onto upstream main (ef7e5168b52e) and force-pushed with lease.

Head moved ee5691243c96 -> 8febed3fddbb. GitHub readback reports mergeable=true; PR remains blocked because no fork check runs have started yet / maintainer workflow approval may still be required.

Fresh local validation after the rebase:

  • PYTHONPATH=$PWD .venv/bin/python -m pytest tests/agent/test_auxiliary_client.py tests/agent/test_crossloop_client_cache.py -q -> passed
  • git diff --check upstream/main...HEAD -> passed

Ready for maintainer review; please approve/run fork workflows if needed.

@alex107ivanov

Copy link
Copy Markdown
Contributor Author

PR hygiene update (20260607T013539Z)

  • Upstream base: 8f7567c32513 (8f7567c325139a4cc7034002d7cacedf6271797b)
  • Head rebased: 8febed3fddbb -> 6635ad544442
  • Validation: PYTHONPATH=$PWD /workspace/repos/hermes-agent/.venv/bin/python -m pytest tests/agent/test_auxiliary_client.py tests/agent/test_crossloop_client_cache.py -q passed
  • Diff hygiene: git diff --check upstream/main...HEAD passed
  • Readback: fork branch pr/auxiliary-closed-client-cache and PR head now point to 6635ad544442
  • GitHub mergeability after push: mergeable=True, mergeable_state=blocked
  • Checks for exact head SHA: no check runs/statuses observed (likely pending maintainer approval for fork workflows)

PR hygiene cron 20260607T013539Z: 8febed3fddbb->6635ad544442

@alex107ivanov
alex107ivanov force-pushed the pr/auxiliary-closed-client-cache branch from 6635ad5 to d6fff33 Compare June 7, 2026 08:01
@alex107ivanov

Copy link
Copy Markdown
Contributor Author

PR hygiene update: rebased onto upstream/main 44c0c2d4ac05.

  • Head: 6635ad544442 -> new head d6fff3302d0f
  • Validation: PYTHONPATH=$PWD /workspace/repos/hermes-agent/.venv/bin/python -m pytest tests/agent/test_auxiliary_client.py tests/agent/test_crossloop_client_cache.py -q passed
  • Whitespace: git diff --check upstream/main...HEAD passed
  • GitHub readback: PR head d6fff3302d0f, mergeable None, mergeable_state unknown
  • Checks: No check runs observed for this fork PR head yet; maintainer approval may be required.

Maintainers: please approve/run fork workflows if checks remain absent.

@alex107ivanov
alex107ivanov force-pushed the pr/auxiliary-closed-client-cache branch from d6fff33 to 985d358 Compare June 11, 2026 13:06
@alex107ivanov

Copy link
Copy Markdown
Contributor Author

Cron PR hygiene rebase report for PR #39790

  • Upstream base: a2d7f538d49c7cc282c25ebcc803c8349cae9cff (upstream/main)
  • Head: d6fff3302d0f5bceb37abc69137fe7e876f73429 -> 985d358cb8f126702d743c301f6d566f52c87388
  • git diff --check upstream/main...HEAD -> exit 0
  • Validation:
  • env PYTHONPATH=$PWD /workspace/repos/hermes-agent/.venv/bin/python -m pytest tests/agent/test_auxiliary_client.py tests/agent/test_crossloop_client_cache.py -q -> exit 0; import audioop; -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html; 224 passed, 1 warning in 20.29s
  • Readback: fork branch 985d358cb8f126702d743c301f6d566f52c87388, PR head 985d358cb8f126702d743c301f6d566f52c87388
  • GitHub mergeability after push: mergeable=None, mergeable_state=unknown
  • Checks for exact head: none observed; fork workflows may require maintainer approval

Maintainers: please approve/run fork workflows if GitHub has not started checks for this head SHA.

@alex107ivanov
alex107ivanov force-pushed the pr/auxiliary-closed-client-cache branch 2 times, most recently from e43ccd3 to 0c68594 Compare June 12, 2026 08:00
@alex107ivanov

Copy link
Copy Markdown
Contributor Author

PR hygiene cron update (2026-06-12 UTC): rebased this branch onto current upstream/main.

  • upstream base: 906bee9cf7917326bc41d2df559647ec14c4ee7d
  • old->new head: 985d358cb -> 0c68594cd (0c68594cd818fc891bf3339575b48dd0d361f112 read back from PR)
  • validation: .venv/bin/python -m pytest tests/agent/test_auxiliary_client.py tests/agent/test_crossloop_client_cache.py -q => 224 passed, 1 warning in 24.48s
  • git diff --check upstream/main...HEAD => passed
  • GitHub mergeability after push: mergeable=True, mergeable_state=blocked
  • Checks for exact head 0c68594cd: no check runs/status contexts observed yet for this fork PR head; GitHub status API reports pending, likely awaiting maintainer approval/run of fork workflows

Maintainers: please approve/run fork workflows if required; I did not observe CI success for this head.

@alex107ivanov
alex107ivanov force-pushed the pr/auxiliary-closed-client-cache branch from 0c68594 to 8a68c75 Compare June 12, 2026 14:16
@alex107ivanov

Copy link
Copy Markdown
Contributor Author

PR hygiene rebase d62979a -> 8a68c75620ae

Rebased this branch onto upstream main d62979a6f34f64f2ed840f159aac66e24d7cad78.

  • Old head: 0c68594cd818fc891bf3339575b48dd0d361f112
  • New head: 8a68c75620ae021209893b928f5c378c8d7df9df
  • Readback fork branch: 8a68c75620ae021209893b928f5c378c8d7df9df
  • PR head readback: 8a68c75620ae021209893b928f5c378c8d7df9df
  • Mergeability readback: None / unknown
  • Combined status: pending
  • No check runs were visible for the new fork head SHA; combined status is pending (likely maintainer approval required for fork workflows).

Validation run:

  • PYTHONPATH=$PWD /workspace/repos/hermes-agent/.venv/bin/python -m pytest tests/agent/test_auxiliary_client.py tests/agent/test_crossloop_client_cache.py -q -> exit 0
  • git diff --check upstream/main...HEAD -> exit 0

Maintainer action: please approve/run fork workflows if GitHub is still waiting on checks for this new head.

@alex107ivanov
alex107ivanov force-pushed the pr/auxiliary-closed-client-cache branch from 8a68c75 to b27d713 Compare June 12, 2026 20:33
@alex107ivanov

Copy link
Copy Markdown
Contributor Author

Autonomous PR hygiene update (2026-06-12 20:42 UTC)

Rebased this branch onto upstream main at a118b94a856ef80301cb26d16be6d08c0104e0db and force-pushed with an explicit lease.

  • Head: 8a68c75620ae021209893b928f5c378c8d7df9df -> b27d713ae9f30b322fdb2d17295ad4bf121220b0
  • git diff --check upstream/main...HEAD -> passed
  • Validation:
  • PYTHONPATH=$PWD /workspace/repos/hermes-agent/.venv/bin/python -m pytest tests/agent/test_auxiliary_client.py tests/agent/test_crossloop_client_cache.py -q -> 224 passed, 1 warning in 23.35s
  • GitHub readback: mergeable=True, mergeable_state=blocked, combined_status=pending
  • Checks for b27d713ae9f30b322fdb2d17295ad4bf121220b0: No GitHub check runs observed for this PR head SHA in this cron run; combined status is pending (likely waiting for maintainer approval/run of fork workflows if workflows are configured for this PR).

Maintainers: please approve/run fork workflows if required; no CI success is claimed here unless checks above report it for this exact SHA.

@alex107ivanov
alex107ivanov force-pushed the pr/auxiliary-closed-client-cache branch from b27d713 to fb96aeb Compare June 13, 2026 02:49
@alex107ivanov

Copy link
Copy Markdown
Contributor Author

Automated PR hygiene update.

  • Base rebased onto upstream/main 492c40277457.
  • Head updated: b27d713ae9f3 -> fb96aebab31a.
  • Validation: /workspace/repos/hermes-agent/.venv/bin/python -m pytest tests/agent/test_auxiliary_client.py tests/agent/test_crossloop_client_cache.py -q exited 0.
  • Diff check: git diff --check upstream/main...HEAD exited 0.
  • Current mergeability: mergeable=True state=blocked.
  • Current checks: No check runs observed for this PR head yet (fork workflows may require maintainer approval).

@alex107ivanov
alex107ivanov force-pushed the pr/auxiliary-closed-client-cache branch from fb96aeb to fc8c945 Compare June 13, 2026 09:09
@alex107ivanov

Copy link
Copy Markdown
Contributor Author

Maintainer rebase update (hermes-pr-cron:39790:fc8c94546fbdbd038ea0994de1a6638adb2b15e2)

  • Base: upstream/main 3803e5fc28ef (3803e5fc28ef36bf81f5b6921aa44aac986f12bc)
  • Head: fb96aebab31a -> fc8c94546fbd
  • Rebase: clean onto current upstream/main
  • Validation: PYTHONPATH=$PWD /workspace/repos/hermes-agent/.venv/bin/python -m pytest tests/agent/test_auxiliary_client.py tests/agent/test_crossloop_client_cache.py -q -> rc=0 time=29.7s; import audioop | -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html | 224 passed, 1 warning in 22.36s
  • Diff check: git diff --check upstream/main...HEAD -> rc=0 time=0.1s
  • Readback: fork branch and PR head both fc8c94546fbd
  • GitHub mergeability after push: mergeable=None, state=unknown
  • Checks: no check runs observed for this fork head SHA; GitHub status state is pending

If fork workflows are approval-gated, please approve/run checks for this new head SHA.

@alex107ivanov
alex107ivanov force-pushed the pr/auxiliary-closed-client-cache branch from fc8c945 to 2b055ba Compare June 13, 2026 15:45
@alex107ivanov

alex107ivanov commented Jun 13, 2026 •

Copy link
Copy Markdown
Contributor Author

Maintainer rebase hygiene update (2026-06-13 15:47 UTC).

  • cron rebase hygiene: fc8c9454 -> 2b055bad
  • upstream/main: cc14b74
  • validation: /workspace/repos/hermes-agent/.venv/bin/python -m pytest tests/agent/test_auxiliary_client.py tests/agent/test_crossloop_client_cache.py -q -> exit 0
  • git diff --check upstream/main...HEAD -> exit 0
  • readback: fork ref 2b055bad9bc3, PR head 2b055bad9bc3
  • GitHub mergeability now reports mergeable=True, mergeable_state=blocked; checks: no check runs observed for this head SHA yet (fork workflows may require maintainer approval).

Next maintainer action: approve/run fork workflows if GitHub has not started checks for this rebased head.

@teknium1

Copy link
Copy Markdown
Collaborator

Thanks for the focused regression fix. The premise remains valid on current main: agent/auxiliary_client.py:5792-5806 validates async cache hits, while the sync branch at agent/auxiliary_client.py:5808-5809 returns a cached client without checking its underlying transport. The proposed is_closed check therefore closes a real pre-use liveness gap rather than duplicating the existing post-error eviction at agent/auxiliary_client.py:6973-6980.

No substantive correctness or design-fit issue found in the two-file diff. The current cache function has moved since the PR base, but the intended insertion points remain equivalent and the salvage should be mechanical.

Automated hermes-sweeper review.

@teknium1 teknium1 added the sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform label Jul 14, 2026
@alex107ivanov
alex107ivanov force-pushed the pr/auxiliary-closed-client-cache branch from 2b055ba to 21dca01 Compare July 16, 2026 18:21
@alex107ivanov

Copy link
Copy Markdown
Contributor Author

Rebased this PR onto upstream/main.

  • upstream base: bd37ff9138d30b3e27f617320884222f1fc656b8
  • head: 2b055bad9bc3 -> 21dca01715bc
  • validation: PYTHONPATH=$PWD /workspace/repos/hermes-agent/.venv/bin/python -m pytest tests/agent/test_auxiliary_client.py tests/agent/test_crossloop_client_cache.py -q -> exit 0; ........................................................................ [ 88%] | ....................................... [100%] | 327 passed in 57.04s; git diff --check upstream/main...HEAD -> exit 0
  • GitHub checks for new head: 0 workflow runs, 0 check runs observed immediately after push

@alex107ivanov

Copy link
Copy Markdown
Contributor Author

Rebased this PR onto upstream/main.

  • upstream base: d8fd45e9a81875e2878229c56fa459322905a405
  • head: 21dca01715bc -> a3b45814085f
  • validation: PYTHONPATH=$PWD /workspace/repos/hermes-agent/.venv/bin/python -m pytest tests/agent/test_auxiliary_client.py tests/agent/test_crossloop_client_cache.py -q -> exit 0; ........................................................................ [ 88%] | ....................................... [100%] | 327 passed in 50.44s; git diff --check upstream/main...HEAD -> exit 0
  • GitHub checks for new head: 0 workflow runs, 0 check runs observed immediately after push

@alex107ivanov
alex107ivanov force-pushed the pr/auxiliary-closed-client-cache branch from 21dca01 to a3b4581 Compare July 18, 2026 19:59
@alex107ivanov

Copy link
Copy Markdown
Contributor Author

Rebased this PR onto upstream/main.

  • upstream base: d7b36070ef807841699ad32c5b6af547fee3ff64
  • head: a3b45814085f -> 90bdae61fe60
  • validation: PYTHONPATH=$PWD /workspace/repos/hermes-agent/.venv/bin/python -m pytest tests/agent/test_auxiliary_client.py tests/agent/test_crossloop_client_cache.py -q -> exit 0; ........................................................................ [ 88%] | ....................................... [100%] | 327 passed in 51.33s; git diff --check upstream/main...HEAD -> exit 0
  • GitHub checks for new head: 0 workflow runs, 0 check runs observed immediately after push

@alex107ivanov
alex107ivanov force-pushed the pr/auxiliary-closed-client-cache branch 2 times, most recently from 90bdae6 to 0014500 Compare July 22, 2026 23:41
@alex107ivanov

Copy link
Copy Markdown
Contributor Author

Rebased this PR onto upstream/main.

  • upstream base: 8d6e045b8f0506ffbc6ffef496eab413de263fd7
  • head: 90bdae61fe60 -> 0014500acb13
  • validation: PYTHONPATH=$PWD /workspace/repos/hermes-agent/.venv/bin/python -m pytest tests/agent/test_auxiliary_client.py tests/agent/test_crossloop_client_cache.py -q -> exit 0; ........................................................................ [ 88%] | ....................................... [100%] | 327 passed in 42.73s; git diff --check upstream/main...HEAD -> exit 0
  • GitHub checks for new head: 0 workflow runs, 0 check runs observed immediately after push

@alex107ivanov
alex107ivanov force-pushed the pr/auxiliary-closed-client-cache branch from 0014500 to fc1ba29 Compare July 25, 2026 01:17
@alex107ivanov

Copy link
Copy Markdown
Contributor Author

Rebased this PR onto upstream/main.

  • upstream base: d372fda6f0cf321b14aed84599a5b2a2d68e0338
  • head: 0014500acb13 -> fc1ba2939c74
  • validation: PYTHONPATH=$PWD /workspace/repos/hermes-agent/.venv/bin/python -m pytest tests/agent/test_auxiliary_client.py tests/agent/test_crossloop_client_cache.py -q -> exit 0; ........................................................................ [ 97%] | ........ [100%] | 368 passed in 111.35s (0:01:51); git diff --check upstream/main...HEAD -> exit 0
  • GitHub checks for new head: 0 workflow runs, 0 check runs observed immediately after push

@alex107ivanov
alex107ivanov force-pushed the pr/auxiliary-closed-client-cache branch from fc1ba29 to 2ae2cad Compare July 28, 2026 02:59
@alex107ivanov

Copy link
Copy Markdown
Contributor Author

Rebased this PR onto upstream/main.

  • upstream base: 6cf572c9e5d88a33e0e51cfc5bcfe47f02682731
  • head: fc1ba2939c74 -> 2ae2cadc3cf3
  • validation: PYTHONPATH=$PWD /workspace/repos/hermes-agent/.venv/bin/python -m pytest tests/agent/test_auxiliary_client.py tests/agent/test_crossloop_client_cache.py -q -> exit 0; ........................................................................ [ 96%] | ............... [100%] | 375 passed in 44.84s; git diff --check upstream/main...HEAD -> exit 0
  • GitHub checks for new head: 0 workflow runs, 0 check runs observed immediately after push

@GottZ GottZ left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was generated by AI during triage.

Summary

Two PRs address the same sync auxiliary-client cache liveness gap: both evict a cached client when an underlying transport reports is_closed as the boolean True, then rebuild it, with equivalent regression coverage. #39790 is the current rebased replacement for closed #39023; the diffs do not show an additional mock-safety refinement because both implementations reject non-boolean mock attributes.

Related pull requests

  • #39023 [closed] duplicate — (+62/-2) — superseded duplicate: Adds boolean-only closed-transport detection, cache eviction and rebuild behavior, plus a focused regression test. It remains relevant as the original implementation, but was closed as superseded by #39790.
  • #39790 related — (+63/-2) — preferred replacement: Implements the same fix and regression coverage as #39023 on the current code layout; its isinstance(closed, bool) and closed condition is behaviorally equivalent to #39023's getattr(..., False) is True for avoiding false positives from mock attributes. This aligns with the contributor keep_open review on #39790, which confirms the sync pre-use liveness gap remains valid and reports no substantive correctness or design-fit issue.

Duplicates

#39023 and #39790 are substantive duplicates: both detect boolean-true is_closed values through the same wrapper candidates, evict the poisoned sync cache entry, rebuild the client, and add equivalent regression coverage.

Suggested consolidation

Merge #39790 as the current rebased replacement with contributor keep_open support; keep #39023 closed as superseded by #39790.

Complex graph

flowchart 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
    subgraph Dup39023 ["PRs duplicating each other"]
        P39023["PR #39023 (closed)"]
        P39790["PR #39790 (open)"]
    end
    class P39023 closed
    class P39790 open
    class P39790 target
    click P39023 "https://github.com/NousResearch/hermes-agent/pull/39023"
    click P39790 "https://github.com/NousResearch/hermes-agent/pull/39790"
Loading

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 or no verify verdict yet (state tag in the node label).

Cross-PR triage: Reviewed 2 pull requests and 0 issues in this complex. Each diff was read against this issue; Assessment working set: 8 kB of PR diffs, 5 kB of issue/PR text, 6 kB of discussion (18 comments), 1 verify verdict. verdicts reflect diff content, not PR titles. Part of an automated triage batch.

@alex107ivanov
alex107ivanov force-pushed the pr/auxiliary-closed-client-cache branch from 2ae2cad to d9bf57c Compare August 1, 2026 06:02
@alex107ivanov

Copy link
Copy Markdown
Contributor Author

Rebased this PR onto upstream/main.

  • upstream base: 29eac371d1b0c4eba9f2952f98dc0649f1b7a27d
  • head: 2ae2cadc3cf3 -> d9bf57c73e0c
  • validation: PYTHONPATH=$PWD /workspace/repos/hermes-agent/.venv/bin/python -m pytest tests/agent/test_auxiliary_client.py tests/agent/test_crossloop_client_cache.py -q -> exit 0; ........................................................................ [ 88%] | ................... [100%] | 163 passed in 24.67s; git diff --check upstream/main...HEAD -> exit 0
  • GitHub checks for new head: 1 workflow runs, 30 check runs observed immediately after push

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P2 Medium — degraded but workaround exists sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants