One OpenClaw Gateway session per Buzz channel, thread, and DM - #46
Open
jmfcamp wants to merge 1 commit into
Open
One OpenClaw Gateway session per Buzz channel, thread, and DM#46jmfcamp wants to merge 1 commit into
jmfcamp wants to merge 1 commit into
Conversation
Last-mile OpenClaw was binding every room to the process leftover `--session agent:<id>:buzz`. Conversation session/new now sends `_meta.sessionKey` so each channel, thread, and DM gets a stable Gateway key. Heartbeats still fall through to that leftover. The stdio child is not respawned per room. Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: jmfcamp <jmfcamp@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.
Summary
Hula last-mile bots (
buzz-acp@captain, etc.) exec oneopenclaw acp --session agent:<id>:buzzchild for the life of the unit. That flag is process-lifetimedefaultSessionKey. Every room mentioning Captain was writing into one Control UI session named ACP.buzz-acp already does per-channel
session/new. It never set_meta.sessionKey, so OpenClaw’s mapper (session-mapper.ts) fell through to--session agent:<id>:buzz._meta.sessionTitle/compose_session_title(Agent · #channel) is display-only and does not split Gateway store files.This change sends a stable Gateway key on every conversation
session/new:{ "_meta": { "sessionKey": "<stable key>", "sessionTitle": "<existing composed title>" } }Key shape (Slack-like,
buzznamespace, UUIDs never names):agent:<agentId>:buzz:channel:<channelUuid>agent:<agentId>:buzz:channel:<channelUuid>:thread:<rootEventId>t=dm)agent:<agentId>:buzz:direct:<channelUuid>agent:<agentId>:buzz:direct:<channelUuid>:thread:<rootEventId>--session agent:<id>:buzzThread id is the existing NIP-10
ThreadTags.root_event_idon the last batch event (parse_thread_tags). Same inbound again reuses the key. Different channel / thread / DM differ.SessionStatenow caches ACPsessionIdper conversation (channel + optional thread root) so a thread gets its ownsession/newinstead of reusing the parent channel session. One last-mile child still hosts all of them — we do not respawnopenclaw acpper room.--session agent:<id>:buzzstays on the process. Existing leftover history is not deleted; new work does not keep appending there. Agent id is parsed from that leftover flag (--session/--session=).Related issue
Hula last-mile OpenClaw session grain (VPS
buzz-acp@*). None found in-repo.Unchanged (on purpose)
--urlonopenclaw acpchannels.buzz, keys,install.sh, or subscribe=allrequire_mentionfalse only forchannel_type == dm)channel_id/ threadignore_selfstays onVPS deploy: rebuild Linux
buzz-acpinto~/.local/bin/buzz-acpand restartmo/captain/korg/quasar. A Desktop rebuild is not enough.Test plan
crates/buzz-acp/src/openclaw_session.rs: stable per (agent, channel, thread-or-none, DM); different conversations differ; same inbound matches; leftoveragent:<id>:buzzis not a conversation key;from_batchusesroot_event_idsession/newwire test:_meta.sessionKey+_meta.sessionTitleon one requestcargo test -p buzz-acp --lib(846 passed)cargo clippy -p buzz-acp --lib -- -D warnings@and replies land in that DM