Skip to content

fix(gateway): write update notification to session transcript (#27846)#27899

Open
zccyman wants to merge 1 commit into
NousResearch:mainfrom
atyou2happy:fix/27846-update-transcript
Open

fix(gateway): write update notification to session transcript (#27846)#27899
zccyman wants to merge 1 commit into
NousResearch:mainfrom
atyou2happy:fix/27846-update-transcript

Conversation

@zccyman

@zccyman zccyman commented May 18, 2026

Copy link
Copy Markdown
Contributor

Summary

When the gateway restarts after hermes update, _send_update_notification sends a standalone adapter.send() that lands outside the conversation history. The agent cannot see that an update already occurred, causing it to repeat upgrade prompts and lose context of the update outcome.

Fix

Writes the notification as a system message into the session transcript before sending via adapter.send(), so the agent retains full context of the update outcome across restarts.

Changes

  • gateway/run.py: In _send_update_notification(), before await adapter.send(), look up the session_key from the pending marker, find the session_id via session_store._entries, and call session_store.append_to_transcript(entry.session_id, {"role": "system", "content": msg})
  • tests/gateway/test_update_command.py: Add test_writes_notification_to_session_transcript regression test

Verification

pytest tests/gateway/test_update_command.py -v
# 29 passed (including new regression test)

Closes #27846

When the gateway restarts after 'hermes update', _send_update_notification
sends a standalone adapter.send() that lands outside the conversation history.
The agent then cannot see that an update already occurred, causing it to repeat
upgrade prompts and lose context of the update outcome.

The fix writes the notification as a system message into the session transcript
before sending, so the agent retains full context of the update outcome.

Fixes NousResearch#27846.
@alt-glitch alt-glitch added type/bug Something isn't working comp/gateway Gateway runner, session dispatch, delivery P3 Low — cosmetic, nice to have labels May 18, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Related to #27884 (same author, same title, same fix target #27846). This PR is the cleaner split — only gateway/run.py + test, no bundled junk files. #27884 should be closed in favor of this one.

@BoardJames-Bot

Copy link
Copy Markdown

Board James triage pass: check-attribution and e2e are green. The only red check is test, and the logs show cancellation late in the suite (~95% progress) rather than a branch-local assertion/error. I opened #27931 for the shared main-line CI drift found while triaging this batch; after that lands, please rebase/rerun checks. Since #27906 appears to be the newer duplicate/replacement with the same title, recommend closing this older branch in favor of #27906 unless there is a deliberate delta to keep.

@zccyman

zccyman commented May 27, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @alt-glitch for confirming this is the cleaner split. #27884 has been closed. This PR targets only gateway/run.py + test for #27846 (write update notification to session transcript). Ready for review.

@BoardJames-Bot — noted the test check cancellation at ~95% progress. This appears to be a CI infrastructure timeout, not a branch-local failure.

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 P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] hermes update 过程中对话上下文丢失

3 participants