Skip to content

fix(gateway): publish compression tip before reusing session history#26088

Closed
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:hermes/fix-25921-gateway-compression-tip
Closed

fix(gateway): publish compression tip before reusing session history#26088
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:hermes/fix-25921-gateway-compression-tip

Conversation

@LeonSGP43

Copy link
Copy Markdown
Contributor

Fixes #25921.

Summary

  • follow the latest compression continuation before loading gateway transcript history and rebind Telegram topic lanes to that tip
  • publish compression-driven session splits back into gateway route state instead of leaving stale parent session ids behind
  • refuse cached-agent reuse when the cached agent session id no longer matches the canonical route session id

Testing

  • python3 -m pytest -o addopts='' tests/gateway/test_telegram_topic_mode.py tests/gateway/test_agent_cache.py -q
  • uv run --frozen ruff check gateway/run.py tests/gateway/test_telegram_topic_mode.py tests/gateway/test_agent_cache.py
  • git diff --check

Attribution

  • Local proof: .paperclip_artifacts/quality-gate/proof-67cdc6216c7662ff6dd76313c0c8ff0c67b9f0be.json
  • Recent company PRs #26081, #26068, and #26059 share the same red Tests / test and Tests / e2e failures while attribution, lint, nix, and supply-chain checks stay green, so any repeat of those lanes should be treated as preexisting_unrelated baseline noise unless this diff shows a new signature.

@teknium1

Copy link
Copy Markdown
Contributor

Automated hermes-sweeper review: this appears to be implemented on current main.

Evidence:

  • gateway/run.py:8635 propagates a compression-rotated agent_result["session_id"] into session_entry.session_id, persists session_store._save(), and syncs the topic binding when applicable.
  • gateway/run.py:7927 walks stale Telegram topic bindings through SessionDB.get_compression_tip() before transcript load; gateway/run.py:7956 rewrites the binding to the descendant.
  • gateway/run.py:8110 loads the next turn's transcript from the updated session_entry.session_id, so the next inbound turn reads the compact child transcript instead of the oversized parent.
  • gateway/run.py:14607 detects mid-run compression splits and gateway/run.py:14717 returns the effective session id to the outer gateway path.
  • tests/gateway/test_telegram_topic_mode.py:452 covers the stale parent-binding case and asserts the route/binding advance to the compression child.
  • tests/gateway/test_compression_session_id_persistence.py:1 documents the infinite preflight compression loop class and pins the route persistence invariant.
  • Commit db96fc60d0d3dc3f9e95dc6541d8edcccb2f2171 shipped the Telegram topic compression-child alignment/read-path self-heal and is contained in v2026.6.5.

Thanks for the detailed fix and for the local proof in the PR body. This is an automated hermes-sweeper review.

@teknium1 teknium1 closed this Jun 12, 2026
@teknium1 teknium1 added the sweeper:implemented-on-main Sweeper: behavior already present on current main label Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P1 High — major feature broken, no workaround sweeper:implemented-on-main Sweeper: behavior already present on current main type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Gateway can reuse parent-sized history after compression split, causing infinite preflight compression

3 participants