Problem
buildSessionKey() in helpers.ts constructs the Honcho session key from ctx.sessionKey + ctx.messageProvider:
const baseKey = ctx?.sessionKey ?? "default";
const provider = ctx?.messageProvider ?? "unknown";
return `${baseKey}-${provider}`;
Two issues have been reported:
1. Infinite session accumulation across /new and /reset
If OpenClaw's sessionKey is a stable chat/room identifier that persists across /new or /reset, Honcho maps all messages into one ever-growing session. The before_reset hook flushes unsaved messages but doesn't signal session boundaries — subsequent messages continue appending to the same Honcho session key.
The plugin hook context includes sessionId (ephemeral UUID that changes per conversation), but buildSessionKey doesn't use it.
2. -unknown suffix from missing messageProvider
Reports indicate OpenClaw 2026.4.5 may not populate ctx.messageProvider, causing all session keys to end in -unknown instead of the correct platform tag (e.g., -telegram, -discord).
Reported workaround
Users have patched buildSessionKey in dist/helpers.js to:
- Extract the provider from
ctx.sessionKey string splitting instead of ctx.messageProvider
- Append
ctx.sessionId to force session separation on /new
Proposed fix
Update buildSessionKey to incorporate ctx.sessionId when available:
export function buildSessionKey(ctx?: {
sessionKey?: string;
sessionId?: string;
messageProvider?: string;
}): string {
const baseKey = ctx?.sessionKey ?? "default";
const sessionId = ctx?.sessionId;
const provider = ctx?.messageProvider;
const parts = [baseKey];
if (sessionId) parts.push(sessionId);
if (provider && provider !== "unknown") parts.push(provider);
return parts.join("-").replace(/[^a-zA-Z0-9-]/g, "-");
}
Note: This changes the session key format, which means existing sessions won't carry over. The before_reset flush should handle saving any in-flight data, but this is a breaking change to session continuity that should be documented in the changelog.
Needs verification
Files affected
| File |
Change |
helpers.ts |
Update buildSessionKey signature and logic |
All callers of buildSessionKey |
Pass ctx.sessionId through |
Problem
buildSessionKey()inhelpers.tsconstructs the Honcho session key fromctx.sessionKey+ctx.messageProvider:Two issues have been reported:
1. Infinite session accumulation across
/newand/resetIf OpenClaw's
sessionKeyis a stable chat/room identifier that persists across/newor/reset, Honcho maps all messages into one ever-growing session. Thebefore_resethook flushes unsaved messages but doesn't signal session boundaries — subsequent messages continue appending to the same Honcho session key.The plugin hook context includes
sessionId(ephemeral UUID that changes per conversation), butbuildSessionKeydoesn't use it.2.
-unknownsuffix from missingmessageProviderReports indicate OpenClaw 2026.4.5 may not populate
ctx.messageProvider, causing all session keys to end in-unknowninstead of the correct platform tag (e.g.,-telegram,-discord).Reported workaround
Users have patched
buildSessionKeyindist/helpers.jsto:ctx.sessionKeystring splitting instead ofctx.messageProviderctx.sessionIdto force session separation on/newProposed fix
Update
buildSessionKeyto incorporatectx.sessionIdwhen available:Note: This changes the session key format, which means existing sessions won't carry over. The
before_resetflush should handle saving any in-flight data, but this is a breaking change to session continuity that should be documented in the changelog.Needs verification
ctx.messageProvideris not populated on OpenClaw 2026.4.5ctx.sessionKeyis stable across/new//resetctx.sessionIdchanges on/new//resetisSubagentSessionchecks for:subagent:insessionKey)Files affected
helpers.tsbuildSessionKeysignature and logicbuildSessionKeyctx.sessionIdthrough