Skip to content

fix(hermes): split recall context for prefetch#195

Open
RerankerGuo wants to merge 1 commit into
TencentCloud:mainfrom
RerankerGuo:fix/hermes-recall-context-split
Open

fix(hermes): split recall context for prefetch#195
RerankerGuo wants to merge 1 commit into
TencentCloud:mainfrom
RerankerGuo:fix/hermes-recall-context-split

Conversation

@RerankerGuo

@RerankerGuo RerankerGuo commented Jun 11, 2026

Copy link
Copy Markdown

Description | 描述

Split Gateway recall responses into stable system context and dynamic L1 prefetch context for Hermes.

This fixes the Hermes path where /recall only returned appendSystemContext, so L1 memories recalled by auto-recall were not injected through prefetch(). The Gateway now returns:

  • system_context for persona / scene navigation / tool guidance
  • prepend_context for dynamic L1 memories
  • context as a backward-compatible combined field for older clients

The Hermes provider prefers prepend_context in prefetch() and caches system_context for system_prompt_block(), while still falling back to the legacy context response.

Related Issue | 关联 Issue

Fix #101

Change Type | 修改类型

  • Bug fix | Bug 修复
  • New feature | 新功能
  • Documentation update | 文档更新
  • Code optimization | 代码优化

Self-test Checklist | 自测清单

  • Verified locally | 本地验证通过
  • No existing features affected | 无影响现有功能

Additional Notes | 其他说明

Verified with npx vitest run src/gateway/server.test.ts, npm test, and npm run build using Node v24.15.0.
Also ran python3 -m py_compile for the Hermes provider files. pytest is not installed in this environment, so the Python pytest suite could not be executed here.

Signed-off-by: Ziyang Guo <121015044+RerankerGuo@users.noreply.github.com>
@Maxwell-Code07

Copy link
Copy Markdown
Collaborator

Thanks for this PR! Splitting the recall response into stable and dynamic context makes a lot of sense for Hermes integration. We'll review it internally and get back to you shortly.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

hermes的plugin目前用法看的应该可以再优化一下

2 participants