Skip to content

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

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

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

Conversation

@zccyman

@zccyman zccyman commented May 18, 2026

Copy link
Copy Markdown
Contributor

Description

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 result.

Testing

  • ✅ New test test_writes_notification_to_transcript — verifies the transcript is written with correct session ID
  • ✅ New test test_transcript_write_skipped_when_no_session — verifies graceful handling when no session store exists
  • ✅ All 30 tests in tests/gateway/test_update_command.py pass

Fixes #27846


Note: This is a clean rebuild of the #27846 portion from PR #27884 which was closed due to scope overlap with PR #27833 (contextual rationale for approval prompts). This PR contains only the update notification transcript fix and its tests.

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.
@zccyman

zccyman commented May 18, 2026

Copy link
Copy Markdown
Contributor Author

Note for reviewers: BoardJames-Bot previously identified a Windows encoding issue (open(_cfg_path) missing encoding="utf-8") in the old PR #27884 branch. That issue was specific to the old branch's code and does not exist on this clean branch based on origin/main.

@alt-glitch alt-glitch added type/bug Something isn't working comp/gateway Gateway runner, session dispatch, delivery duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have labels May 18, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #27899 — same author, same fix, same issue #27846. Both write update notification to session transcript in gateway/run.py. #27899 was triaged first and is the cleaner split from #27884.

@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. This appears to be the newer replacement for #27899, so prefer this PR over the older duplicate.

@zccyman

zccyman commented May 18, 2026

Copy link
Copy Markdown
Contributor Author

Closing in favor of #27899 as alt-glitch noted it's the cleaner split. Thanks for the triage!

@zccyman zccyman closed this May 18, 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 duplicate This issue or pull request already exists 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