Repository navigation
Conversation
…s by default Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
… turns (#71) * fix: match helper session keys like OpenClaw, keep recall for host-generated turns, let env override config Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> * chore(release): 2.2.0 Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com> --------- Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
By default the plugin now makes zero Supermemory calls from its
before_prompt_build(recall) andagent_end(capture) hooks for OpenClaw subagent sessions, host helper runs, host-generated inputs, and headless runs. Interactive TUI / Control UI / channel turns behave exactly as before. Two opt-in flags restore today's behaviour.What is detected and how (OpenClaw's own signals)
Checked against openclaw/openclaw
main@ 7ab0143 and the publishedopenclaw@2026.11.1CLI.ctx.sessionKeycontains asubagent:segment (agent:<id>:subagent:<uuid>, incl.incognito-and nested)docs/tools/subagents.md("Each one runs in its own session (agent:<agentId>:subagent:<uuid>)"),src/sessions/session-key-utils.tsisSubagentSessionKey/getSubagentDepthactive-memory:(active-memory recall run,extensions/active-memory/recall-run.ts),helper:(session-memory slug generator,src/hooks/bundled/session-memory/handler.ts),update-repair:(src/infra/update-repair-agent.runtime.ts),internal-session-effects:(session forks, side-chat companion, memory flush,src/config/sessions/internal-session-key.ts),dreaming-narrative-(isDreamingNarrativeSessionStoreKey)inputProvenance.kindisinter_sessionorinternal_system:ctx.inputProvenanceonbefore_prompt_build, the last user message'sprovenanceonagent_endsrc/sessions/input-provenance.tsisHostGeneratedInputProvenance;docs/plugins/hooks/prompt-and-session.md("ctx.trigger === "user"is a run trigger, not an origin classification … Use typed provenance to distinguish those inputs")openclaw agent exec("Run one isolated headless embedded agent turn",src/cli/program/register.agent-turn.ts; "exec matches no channel",src/commands/agent-exec-input.ts) and scriptedopenclaw agent --messageturns run with nomessageProvider/channel, while every interactive surface stamps one (TUI/Control UIwebchat=INTERNAL_MESSAGE_CHANNEL, chat channels,node, system agentopenclaw). A run is treated as headless whenctx.triggeris set and both fields are empty; hosts that predatectx.triggerkeep the legacy behaviour.src/utils/message-channel-constants.ts,src/agents/command/run-embedded-attempt.ts, observed ctx belowExisting cron / heartbeat / memory-flush skips are unchanged. Subagents inherit
messageProvider: "webchat"andtrigger: "user"from their parent (observed below), so the session key is the only usable subagent signal.Opt-in flags (plugin config in
openclaw.json, or env for the OpenClaw process; each re-enables both recall and capture for its class):captureSubagents: true/SUPERMEMORY_CAPTURE_SUBAGENTS=true: subagents, helper runs, host-generated inputscaptureHeadless: true/SUPERMEMORY_CAPTURE_HEADLESS=true: headless runs (a subagent spawned from a headless run needs both)Stored data, container tags, customIds, and metadata shapes are untouched; explicit memory tool calls are unaffected. README and CHANGELOG are updated.
Verification on the real host
openclaw@2026.11.1from npm, gateway +openclaw tuidriven in a tmux pty (interactive),openclaw agent execandopenclaw agent --message(headless). The model was a local OpenAI-compatible stub (models.providers.stub,api: "openai-completions") that returns asessions_spawntool call when the prompt says SPAWNCHILD, so the host spawned a realagent:main:subagent:<uuid>session. The plugin was pointed at a recording Supermemory stub (baseUrl: http://127.0.0.1:18081, dummysm_key) that logs every method+path. The same 4-step script ran per scenario (stub servers and scripts are not committed):captureSubagentsconfigSUPERMEMORY_CAPTURE_SUBAGENTS=truecaptureHeadlessconfigSUPERMEMORY_CAPTURE_HEADLESS=trueopenclaw agent execopenclaw agent --message(gateway, no channel)Default run, Supermemory stub log (all calls):
Hook contexts the host passed in that run (from a second, logging-only plugin), showing the subagent and the announce turn really ran:
On main, the 4 extra calls in step 2 were the subagent's own profile + capture and the parent's capture of
[Inter-session message] sourceSession=agent:main:subagent:….The helper-run session keys (active-memory, helper, update-repair, internal-session-effects, dreaming) were verified by replaying the host's key shapes and triggers through the hook handlers, not by driving those host features live: 0 calls by default, 2 with
captureSubagents. Interactive webchat, a Telegram-shaped context, the system agent (manual/openclaw), and a legacy context withouttriggerkeep their 2 calls in every configuration.bun run check-typesandbiome ci .(CI's 2.3.8) pass. The repo has no test suite.Not detectable / out of scope
openclaw agent --channel … --deliver) carries that channel and is treated as interactive.agent:<id>:acp:…, external Codex/Claude harnesses viasessions_spawn runtime: "acp") run outside OpenClaw's embedded hooks, so this plugin never saw them and nothing changes.src/gateway/dashboard-session-title.ts,src/auto-reply/reply/conversation-label-generator.ts) go throughrunUtilityCompletion(src/agents/utility-completion.ts), a plain completion that never firesbefore_prompt_build/agent_end, so the plugin never saw them. I did not find a separate branch-name generator.