@guildex.net/openclaw-teams-push
v0.1.0
Published
OpenClaw plugin that pushes Guildex teammate replies (sessions_send inter-session messages from agent:guildex-*) to the main session's last-known channel (Telegram, etc.), fixing the runtime gap where main's auto-responses to inter-session messages never
Readme
@guildex.net/openclaw-teams-push
OpenClaw plugin that pushes Guildex teammate replies into the user's main session's last-known channel (Telegram, etc.).
What it fixes
When a Guildex worker (e.g. guildex-mason-grey) calls sessions_send to deliver work to the user's main agent, OpenClaw's runtime correctly wakes main and main produces a visible assistant reply. But OpenClaw's reply pipeline only routes turns triggered by a real user message (with originatingChannel/originatingTo set). Inter-session turns have neither, so main's reply lands in the jsonl and never reaches Telegram / Slack / Discord.
This plugin hooks agent_end, detects inter-session turns from agent:guildex-* sources, looks up the session's last-known channel destination, and pushes the assistant text there via OpenClaw's documented runMessageAction SDK.
Sprint 17.B.1 status: SPIKE
Day-1 minimal viable implementation. Known gaps for day-2:
- Destination lookup uses filesystem jsonl scan; day-2 will use Gateway
sessions.describeRPC. - No dedupe ring; teammates that send duplicate inter-session messages will cause duplicate pushes.
runMessageAction({ cfg: undefined })relies on SDK's runtime-context fallback. May need explicit cfg threading.
Install (local development)
cd /Users/joe/Projects/Guildex/plugins/openclaw-teams-push
npm install
npm run build
# Link from a local checkout (per docs/plugins/manage-plugins.md):
openclaw plugins install --link /Users/joe/Projects/Guildex/plugins/openclaw-teams-push
# Enable the conversation-access permission (required by agent_end hook):
openclaw config patch 'plugins.entries.guildex-teams-push.hooks.allowConversationAccess' true --boolean
# Restart Gateway so the new plugin is imported:
openclaw gateway restart
# Verify the plugin registered its hook:
openclaw plugins inspect guildex-teams-push --runtime --jsonUninstall
openclaw plugins uninstall guildex-teams-push
openclaw gateway restartHow it activates
For each turn ending on agent:main:*:
- Skip if turn has
messageProviderorchannelId(already routed by OpenClaw). - Look at user-role messages for
[Inter-session message] sourceSession=<key>. - If
<key>starts withagent:guildex-, proceed. - Extract the most recent assistant text from the turn.
- Walk main's session jsonl backwards for the most recent
chat_id: "<channel>:<id>"block (set by inbound channel adapters like Telegram). - Call
runMessageAction({ action: "send", params: { channel, to, message, accountId } }).
Configuration
In ~/.openclaw/openclaw.json:
{
"plugins": {
"entries": {
"guildex-teams-push": {
"config": {
"enabled": true,
"attributionPrefix": false,
"sourceSessionPrefix": "agent:guildex-"
},
"hooks": {
"allowConversationAccess": true,
"timeouts": { "agent_end": 15000 }
}
}
}
}
}