XMPP MUC bridge + headless OpenRouter chat agent (prototypes)#11
Open
friedenberg wants to merge 2 commits into
Open
XMPP MUC bridge + headless OpenRouter chat agent (prototypes)#11friedenberg wants to merge 2 commits into
friedenberg wants to merge 2 commits into
Conversation
Add a Multi-User Chat client and a MUC<->clown-chat bridge so a human in an XMPP client can converse with an agent running under a spinclass/clown session, with one MUC room per session. - internal/xmpp/muc.go: ConnectMUC joins a room via mellium's muc package (driven through a mux so join presence is observed), SendGroup posts a groupchat message, and incoming bodies route to a GroupMessageHandler with self-echo / subject / history-replay filtered. Shares session negotiation with the 1:1 path via negotiateSession. - internal/xmppbridge: one-room <-> one-channel bridge. Inbound groupchat -> `clown chat send`; outbound polls `clown chat read --json` and posts agent messages back. Shells out to clown (does not link it), running with its own clown identity so its relays self-suppress on read. - trapeze xmpp-bridge subcommand wiring it up. - Unit tests for the bridge wiring (fake clown) and an env-gated MUC integration test (two occupants, delivery + self-echo suppression). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01U5aBpoX43KwauCMRMR5UPR
Add a headless, pure-conversational XMPP agent: `trapeze xmpp-agent` logs in as a 1:1 XMPP chat bot and answers each direct message with an OpenRouter chat completion (per-peer history, no TUI, no tools). This is the trapeze half of clown's headless `trapeze` provider (prototype 2). - internal/openrouter: minimal OpenAI-compatible /chat/completions client (default base https://openrouter.ai/api/v1), pure chat β no tools/stream. - internal/xmppagent: the loop. Incoming messages are enqueued off the XMPP serve goroutine and processed by a worker (avoids the mellium send-from-handler deadlock); per-peer bounded history; errors are reported back to the peer. - trapeze xmpp-agent subcommand; reads OPENROUTER_API_KEY/MODEL/BASE_URL and TRAPEZE_XMPP_PASSWORD from env as fallbacks. - Tests: openrouter client (httptest) and the agent loop (fake LLM/sender: history, per-peer isolation, error notice, history bound). Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01U5aBpoX43KwauCMRMR5UPR
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.
Two XMPP prototypes built on trapeze's existing
mellium.im/xmppclient.Prototype 1 β MUC β clown-chat bridge
Lets a human in an XMPP client converse with an agent running under a spinclass/clown session, one MUC room per session.
internal/xmpp/muc.goβConnectMUCjoins a room (driven through amuxso join presence is observed),SendGroupposts groupchat, incoming bodies route to a handler with self-echo / subject / history-replay filtered. Shares session negotiation with the 1:1 path.internal/xmppbridge+trapeze xmpp-bridgeβ one-room β one-channel bridge. Inbound groupchat βclown chat send; outbound pollsclown chat read --jsonand posts agent messages back. Shells out to clown (does not link it); runs with its own clown identity so its relays self-suppress on read.Prototype 2 β headless OpenRouter chat agent
trapeze xmpp-agent: a 1:1 XMPP chat bot that answers each DM with an OpenRouter completion (pure conversational, no TUI, no tools). This is the trapeze half of clown's--provider trapeze.internal/openrouterβ minimal OpenAI-compatible/chat/completionsclient.internal/xmppagentβ the loop: incoming messages enqueued off the serve goroutine and handled by a worker (avoids the mellium send-from-handler deadlock); per-peer bounded history; errors reported back to the peer.Verification
go build/go test/go vetpass for all new packages. The live XMPP/OpenRouter round-trips need a real server + key; see the dev harness incircus/zz-pocs/xmpp-muc-dev/.Related
amarbel-llc/circusβ krone Prosody + dev harness + architecture docsamarbel-llc/clownβ--provider trapezeamarbel-llc/spinclassβ session-lifecycle integration noteπ€ Generated with Claude Code
https://claude.ai/code/session_01U5aBpoX43KwauCMRMR5UPR
Generated by Claude Code