Repository navigation
Description
Summary
buzz-acp keeps its channel → ACP session mapping only in process memory. Restarting a managed Codex agent or Buzz Desktop therefore loses that mapping. The next event in the same channel calls session/new; codex-acp maps that request to Codex threadStart, creating another cloud-backed conversation instead of resuming the existing one.
Those conversations appear in the user's personal Codex/ChatGPT history. On an affected macOS installation, Recents contains many separate conversations beginning with:
[Base] You are operating inside the Buzz platform — a Nostr-based messaging platform for human-agent collaboration...
This is distinct from eager pool fan-out (#2631), history isolation (#2660), and session-title plumbing (#2334 / #3028 / agentclientprotocol/codex-acp#338). Those issues can reduce the number of initial sessions, hide them in a separate store, or name them correctly, but none restores channel-session continuity after a process restart.
Environment
- Official Buzz Desktop
0.5.7, downloaded frombuzz.xyz - macOS, arm64
- Managed Codex agents
codex-acp1.1.10, built from exact PR fix(desktop): kill WebSocket flood and fix Markdown <p><div> nesting #368 head71d77db55a53c915cd9dce4247271f0c5d5f6054
The network/root changes in codex-acp #368 are unrelated to session creation; the same lifecycle is present in the released adapter path.
Observed behavior
After repeated managed-agent/Desktop starts, the user's Codex/ChatGPT Recents list contains many separate Buzz-created conversations. The conversations are cloud-backed Codex threads, not merely local Buzz Activity rows.
The current title is the shared [Base] prompt because the installed codex-acp does not yet consume Buzz's _meta.sessionTitle; agentclientprotocol/codex-acp#338 addresses that cosmetic naming problem. Correct titles would make the rows readable but would not stop duplicate thread creation.
Source-level cause
At tag desktop-v0.5.7:
crates/buzz-acp/src/pool.rsstores per-channel sessions inSessionState.sessions, an in-memoryHashMap<Uuid, String>.- During prompt dispatch, a missing channel entry calls
create_session_and_apply_model(...), which callssession_new_full(...)and inserts the returned ID only into that in-memory map. - No persisted channel-session receipt is loaded at harness startup, and the normal restart path does not call
session/resumeorsession/load. - In codex-acp
1.1.10,CodexAcpClient.newSession()callscodexClient.threadStart(...). BothresumeSession()andloadSession()already exist and callthreadResume(...), but Buzz does not use them to restore channel continuity after restart.
This behavior is also acknowledged by open Buzz PR #4721, whose body says:
The harness starts a new session after a process restart, so this does not attempt same-session continuity across restarts; that would be a separate resume feature.
Steps to reproduce
- Start a Codex-backed managed agent in Buzz Desktop.
- Mention it in a channel and let it complete a turn.
- Confirm the resulting Codex thread appears in Codex/ChatGPT history.
- Stop and restart that same managed agent, or quit and relaunch Buzz Desktop.
- Mention the same agent again in the same channel.
- Observe that Buzz creates a new Codex thread rather than resuming the previous channel session.
- Repeat the restart and observe another new history entry.
Expected behavior
For the same relay, managed-agent identity, and channel, restarting the harness should resume the existing valid ACP/Codex session. A new cloud thread should be created only when:
- no prior session exists;
- the user explicitly requests rotation;
- the adapter does not support resume; or
- resume fails validation and Buzz deliberately falls back to a new session.
Actual behavior
The mapping disappears whenever the harness process exits. The next accepted event creates a new cloud-backed Codex conversation, polluting personal history and losing full-session continuity.
Suggested direction
- Persist a versioned session receipt keyed by at least relay/community, managed-agent pubkey, and channel ID.
- On startup or first use, validate the receipt and call ACP
session/resumewhen the adapter advertises resume support. - Fall back to
session/newonly when no valid receipt exists or resume fails. - Invalidate persisted receipts on explicit
!rotate, agent removal, identity change, or incompatible configuration changes. - Keep history isolation (Isolate Buzz-managed Codex sessions from the user's Codex sidebar and Remote project list #2660 / fix: active community rail, Codex nest isolation, ecosystem docs #2710) and session naming (codex-acp#338) as complementary fixes, not substitutes for continuity.
- Add an integration test: complete a channel turn, restart the harness, dispatch another turn in the same channel, and assert the adapter receives
session/resumewith the original session ID and no secondsession/new.
Related work
- [Bug] Default parallelism 24 eagerly spawns large Codex ACP pools, consuming ~14 GB and flooding Recents #2631 — eager parallel pools consume resources and flood Recents
- Isolate Buzz-managed Codex sessions from the user's Codex sidebar and Remote project list #2660 — isolate Buzz-managed sessions from personal Codex/ChatGPT history
- fix: active community rail, Codex nest isolation, ecosystem docs #2710 — proposed nested
CODEX_HOMEisolation - Managed ACP sessions show base prompt as title in Codex (and other harness UIs) #2334 / feat(acp): title agent sessions from the agent and channel name #3028 — Buzz-side session-title plumbing
- feat: name Codex threads from session/new _meta.sessionTitle agentclientprotocol/codex-acp#338 — consume
_meta.sessionTitle - feat(acp): live per-channel MCP control via session/resume #4480 — demonstrates existing ACP
session/resumesupport for live reconfiguration - fix(acp): persist session identity receipts for both runtimes #4721 — persists identity receipts but explicitly excludes restart continuity
A screenshot of the affected Recents list is available, showing many [Base] You are operating inside the Buzz platform... conversations.
Activity
cmyk commentedon Aug 8, 2026
Additional 0.5.7 evidence: every duplicate thread also repeats the full Buzz prompt on every turn
The affected official Buzz Desktop 0.5.7 installation shows that these are not merely duplicate cloud threads with an unfortunate title. Inside each Codex conversation, every Buzz turn begins again with the complete:
followed by the Buzz CLI guide and the remaining platform instructions. The same large block appears many times within a single Codex thread.
This matches the 0.5.7 source path:
crates/buzz-acp/src/queue.rs::format_prompt()runs for every dispatched event.has_system_prompt_support == false, it prepends[Base],[System], team instructions, agent core memory, and channel canvas to that turn's ordinary user-message blocks.This per-turn amplification is tracked separately in #3242. The relationship is multiplicative:
Fixing restart continuity prevents unnecessary additional threads but does not remove repeated prompt injection inside the resumed thread. Conversely, fixing #3242 reduces per-turn duplication but does not stop new cloud threads after a harness restart. Both fixes are required.
This also has an instruction-authority consequence: on the ACP-v1 compatibility path, text labeled
[System]is transported inside an ordinary user prompt; the label does not give it protocol-level system/developer precedence.No secret values are included in this report. The displayed base prompt names authentication environment variables but does not reveal their values.
cmyk commentedon Aug 9, 2026
Fresh supervised restart evidence with the persistent-prompt candidates
A supervised macOS acceptance of #5386 together with agentclientprotocol/codex-acp#379 reproduced this restart-continuity bug structurally:
019fe5c1-cb8f-74b0-8e58-b726541d641e019fe5de-3f13-77c1-aa0e-a2a07b3eb1ddThe test also cleanly separates #5342 from the persistent-prompt work:
No identity, credential, or private message content is included in this evidence.
Reduce repeated ACP session context (#5423)
SHL0MS commentedon Aug 13, 2026
One host-side observation that may make this recoverable without new protocol work:
buzz-acpnever callssession/loadfor any runtime, including runtimes that advertise support for it.Searching the tree at
dc2dbfe,session/load,loadSession, andsessionCapabilitiesappear nowhere incrates/buzz-acp/. The only hits repo-wide arebuzz-agentdeclaring its own floor and unrelated ONNX loading inbuzz-voice:At least one runtime advertises the opposite. From the harness log pasted in #3768:
So the in-process mapping is not the only constraint. For an agent that advertises
loadSession, the host could persist the channel to session mapping and callsession/loadon restart instead ofsession/new.That does not fix Codex on its own, since codex-acp would need its own support. But the host-side change is a prerequisite either way, and it resolves the duplicate-conversation symptom for any runtime that already advertises the capability. The host reads the
initializeresponse already, soagentCapabilities.loadSessionis available at the point the decision gets made.Reduce repeated ACP session context (block#5423)
Reduce repeated ACP session context (block#5423)
Reduce repeated ACP session context (block#5423)
bmbouter commentedon Nov 3, 2026
We hit the same root cause with Claude rather than Codex, on always-on server agents instead of Desktop. One more data point for prioritizing
session/loadsupport.Setup: about 15 buzz-acp agents running headless on k3s and in OpenShell sandboxes. Each runs
@agentclientprotocol/claude-agent-acp0.84.0 under buzz-acp built from block/buzz16eb0b66(plus a small local--heartbeat-gatepatch), with per-thread sessions.What we see: every image roll, pod reschedule or sandbox move restarts buzz-acp. After that, a reply in any existing thread starts a fresh session that rereads the recent thread messages. The agent answers sensibly, but loses its tool context from earlier in the thread: files it read, commands it ran, decisions it made. On server deployments restarts are routine (we roll images several times a day), so long-running threads lose continuity often. We confirmed it after moving an agent between runtimes: asked in a two-week-old thread, it said plainly that it was a new session.
Why
session/loadwould fix it for us:claude-agent-acp0.84.0 implementsloadSessionand advertisesloadSession: truein its agent capabilities, and its sessions persist on a volume that survives restarts. A small persisted thread-to-session map in buzz-acp's state dir, plus asession/loadattempt before falling back tosession/new, would restore continuity. +1 to the approach in the comment above.Note: this comment was drafted by Claude, an AI assistant, working with Brian Bouterse (@bmbouter) and on his behalf. It is AI generated and human reviewed.