feat(gateway): config-driven per-chat channel_context injection - #65148
feat(gateway): config-driven per-chat channel_context injection#65148Lazymonter wants to merge 1 commit into
Conversation
|
Thanks for incorporating the #43728 review feedback. Current main still only prepends adapter-provided The PR constructs a platform-qualified key in No blocking correctness issue was identified in the PR diff. The existing This is an automated hermes-sweeper review. |
SummaryTwo open PRs address #43650 through inline and file-backed per-chat context injection. #43728 adds the initial loader and inbound integration, while #65148 retains that configuration shape and adds canonical platform-qualified keys, profile-aware resolution, robust cache invalidation, bounded validation, non-mutating context composition, integration coverage, and documentation. Related pull requests
Duplicates#43728 and #65148 implement the same configuration-driven per-chat inbound-context feature for #43650; #65148 is the superseding implementation that incorporates the documented review feedback on #43728. Suggested consolidationKeep #65148 open with a salvage path: preserve its canonical-key resolver, profile-aware runtime integration, robust bounded file cache, non-mutating merge behavior, regression coverage, and documentation while the author rebases or splits out a mergeable cut. Close #43728 as a duplicate of #65148 because the latter supersedes its implementation and addresses the COMMENTED keep_open review's specific defects. Complex graphflowchart 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
I43650(["issue #43650 (open)"])
subgraph Dup43728 ["PRs duplicating each other"]
P43728["PR #43728 (open)"]
P65148["PR #65148 (open)"]
end
P65148 -->|best fix| I43650
class I43650 open
class P43728 open
class P65148 open
class P65148 best
class P65148 target
click I43650 "https://github.com/NousResearch/hermes-agent/issues/43650"
click P43728 "https://github.com/NousResearch/hermes-agent/pull/43728"
click P65148 "https://github.com/NousResearch/hermes-agent/pull/65148"
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 (state tag in the node label). Cross-PR triage: Reviewed 2 pull requests and 1 issue in this complex. Each diff was read against this issue; Assessment working set: 50 kB of PR diffs, 8 kB of issue/PR text, 3 kB of discussion (3 comments), 3 verify verdicts. verdicts reflect diff content, not PR titles. Part of an automated triage batch. |
Problem
The inbound pipeline already accepts adapter-provided
event.channel_context, but operators cannot attach deterministic context to a specific chat through configuration. Dynamic orchestrators therefore have to patchgateway/run.pyand re-apply that patch after every update.This keeps the inline/file config shape proposed by @liuhao1024 in #43728 and provides a current-
mainimplementation that incorporates the review feedback there around canonical keys, cache identity, runtime config resolution, and integration coverage.Solution
Add
gateway.channel_context_mapwith inline and JSON-file forms:<platform>:<chat_id>form, preserving native colons and never falling back to an unqualified ID.HERMES_HOME;~and${ENV_VAR}are supported through the existing runtime config path.[Configured chat context]without mutating the inbound event.Testing
scripts/run_tests.sh tests/gateway/test_channel_context_map.py tests/gateway/test_session.py tests/gateway/test_shared_group_sender_prefix.py tests/gateway/test_context_ref_expansion_runtime.py tests/gateway/relay/test_channel_context_consume.py -q— 145 passed.git diff --checkpass.Closes #43650