Repository navigation
✨ agents: CLI auto-memory off by default; clear_memory_on_kick wipes per-agent memory before each kick - #17055
clubanderson wants to merge 2 commits into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of No conflicting open PRs or same-file overlaps were found. |
6f649b1 to
c5231e0
Compare
…per-agent memory before each kick
Adds agents.cli_memory {auto_memory, clear_on_kick} with per-agent override,
seeds the vendor off-switches (Claude env var, Codex [features] memories,
Copilot settings.json memory) and removes the agent's own memory stores next
to the /clear kick when clear_on_kick is set.
Fixes #17032
Signed-off-by: Andrew Anderson <andy@clubanderson.com>
… cli_memory in agent-knowledge-and-memory.md Signed-off-by: Andrew Anderson <andy@clubanderson.com>
c5231e0 to
0940aab
Compare
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. @clubanderson this PR is held at Failing checks:
Next: the hive does not push to your branch. Push a new head (or reply here); CI and the review swarm re-run automatically and the PR returns to the normal path. |
There was a problem hiding this comment.
Decision needed: @clubanderson should decide whether this PR or #17040 lands for #17032 — both add the same agents.cli_memory.{auto_memory,clear_on_kick} keys with different mechanisms, so only one can merge; this one also needs its base retargeted to v5 now that #17039 (943d807) merged.
Two things block this independently of the code.
-
Base branch. #17039 merged to
v5as 943d807, sofix/agent-memory-isolationis gone as a target and this PR shows CONFLICTING. Retargeting tov5should leave only the last commit, as the body says. -
Conflict with #17040 (Karibhou), which implements the same issue. Both add
agents.cli_memorywithauto_memory/clear_on_kick, a newsrc/crux/agent/cli_memory.goandsrc/crux/config/cli_memory.go, parity leaves and the dashboard allowlist entry. I read both diffs in full. Same intent and config shape, different code — so they cannot both merge. The substantive differences:
| #17055 (this) | #17040 | |
|---|---|---|
| Config type | AutoMemory *bool (src/crux/config/cli_memory.go:23), nil inherits fleet |
AutoMemory bool (:19) |
| Claude disable | CLAUDE_CODE_DISABLE_AUTO_MEMORY=1 in the launch env (src/crux/agent/cli_memory.go:34) |
merge-only "autoMemoryEnabled": false in settings.json (:31) |
| Codex | pins memories = <policy>, overwriting an existing operator line (:68) |
adds memories = false only when the operator wrote nothing (:89) |
| Copilot CLI | overwrites memory in per-agent ~/.copilot/settings.json (:136) |
nothing seeded |
| Store discovery | perAgentCLIHomes specs from #17039 (:176) |
Lstat symlink-bridge walk (:213) |
One thing a maintainer should weigh: this PR's Codex and Copilot seeds overwrite an operator's own value (by design, :145 "OVERWRITES the key"), while #17040 and the rest of hive's seeds are merge-only. That is a deliberate policy difference, not a bug, but it is the kind of behaviour the issue did not specify.
I have not closed anything. I posted the same comparison on #17040.
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
Fixes #17032
Why
Even with per-agent homes (#17039), each subscription CLI keeps a hidden long-lived notebook (Claude auto-memory
MEMORY.md, Codexmemories/, Copilotmemory) that accumulates stale one-off inferences and survives every/clear—clear_on_kickonly resets the conversation. Hive agents get durable context from beads/knowledge/kick prompt, so the default should be off, with an opt-in and a per-kick wipe.Config
CLIMemoryConfig(crux/config/cli_memory.go), stamped onto each agent likesession_recycle;AutoMemoryEnabled()is nil-safe (default false). Settings-parity leaves + dashboard allowlist updated.Exact vendor switches (seeded only when
auto_memoryis false;truepins the opposite so an operator's own setting is never shadowed)CLAUDE_CODE_DISABLE_AUTO_MEMORY=1in the agent env (per-process → per-agent override works)[features] memories = falsemerged into$CODEX_HOME/config.toml(codexConfigSeed, alongside the update-check pin)"memory": falsein the per-agent~/.copilot/settings.json(the key `/memory onclear_on_kickmanager_kick.go: before every non-resume kick, right before the/clearblock,clearCLIMemoryForKickremoves this agent's~/.claude/projects/*/memory/,$CODEX_HOME/memories*/,~/.gemini/GEMINI.md(RemoveAll, su-execrm -rffallback on EPERM). Skipped for uid 0 /HIVE_SHARED_AGENT_HOME=1(would touch the shared tree). Copilot memory is server-side — no local store.Tests (
-race, no sleeps)crux/agent/cli_memory_test.go: env pin default + opt-in; Codex TOML merge cases incl. existing[features]table andcodexConfigSeed(nil,false); Copilot settings seed + owns-the-key; kick wipe removes only this agent's stores and leaves the sibling/shared trees; off-by-default and shared-home skip.pkg/config/cli_memory_test.go: YAML parse, defaults, per-agent override stamping.internal/settingsparityleaves;manager_test.goenv-count adjusted for the Claude pin.Docs:
docs/agent-configuration.md—cli_memoryin the per-agent YAML example and a new "CLI auto-memory (agents.cli_memory)" section with the table above. Changelogchangelog.d/added-agent-cli-memory-config.md.