feat(routing): add thread parent binding inheritance for Discord#3892
Conversation
|
CLAWDINATOR FIELD REPORT // PR Closure I am CLAWDINATOR — cybernetic crustacean, maintainer triage bot for OpenClaw. I was sent from the future to keep this repo shipping clean code. Feature freeze is in effect. We’re purging new feature PRs so the maintainers can focus on stabilization. This PR is in the blast radius, so I’m shutting it down. Hasta la vista, feature — at least for now. Want it reconsidered after the freeze? Come with me if you want to ship. Head to #pr-thunderdome-dangerzone on Discord — READ THE TOPIC or risk immediate termination. Give the maintainers a clear briefing: what it does, why it matters, how it was tested. Stay br00tal. 🤖 This is an automated message from CLAWDINATOR, the OpenClaw maintainer bot. |
|
Not my PR, but can we reconsider this feature? I really hate it that threads in a channel fallback to main agent instead to specific one i told it to use. |
When a Discord thread message doesn't match a direct peer binding, now checks if the parent channel has a binding and uses that agent. This enables multi-agent setups where threads inherit their parent channel's agent binding automatically. Changes: - Add parentPeer parameter to ResolveAgentRouteInput - Add binding.peer.parent match type - Resolve thread parent early in Discord preflight - Pass parentPeer to resolveAgentRoute for threads Fixes thread routing in Discord multi-agent configurations where threads were incorrectly routed to the default agent instead of inheriting from their parent channel's binding.
e9deb81 to
61b8dfd
Compare
|
Landed via temp rebase onto main.
Thanks @aerolalit! |
…nclaw#3892) * feat(routing): add thread parent binding inheritance for Discord When a Discord thread message doesn't match a direct peer binding, now checks if the parent channel has a binding and uses that agent. This enables multi-agent setups where threads inherit their parent channel's agent binding automatically. Changes: - Add parentPeer parameter to ResolveAgentRouteInput - Add binding.peer.parent match type - Resolve thread parent early in Discord preflight - Pass parentPeer to resolveAgentRoute for threads Fixes thread routing in Discord multi-agent configurations where threads were incorrectly routed to the default agent instead of inheriting from their parent channel's binding. * ci: trigger fresh macOS runners * Discord: inherit thread bindings in reactions * fix: add changelog for thread parent binding (openclaw#3892) (thanks @aerolalit) --------- Co-authored-by: Lalit Singh <lalit@clawd.bot> Co-authored-by: OSS Agent <oss-agent@clawdbot.ai> Co-authored-by: Shadow <shadow@clawd.bot>
…uard, context window cap, thread binding) Notable changes: - fix: cap context window resolution (openclaw#6187) - fix: update compaction safeguard to respect context window tokens - fix: secure chrome extension relay cdp - fix(security): restrict MEDIA path extraction to prevent LFI (openclaw#4930) - fix(lobster): block arbitrary exec via lobsterPath/cwd (GHSA-4mhr-g7xj-cg8j) - feat(routing): add thread parent binding inheritance for Discord (openclaw#3892) - Discord: add PluralKit sender identity resolver (openclaw#5838) Conflicts resolved: 3 files (duplicate imports from our custom security patches)
…nclaw#3892) * feat(routing): add thread parent binding inheritance for Discord When a Discord thread message doesn't match a direct peer binding, now checks if the parent channel has a binding and uses that agent. This enables multi-agent setups where threads inherit their parent channel's agent binding automatically. Changes: - Add parentPeer parameter to ResolveAgentRouteInput - Add binding.peer.parent match type - Resolve thread parent early in Discord preflight - Pass parentPeer to resolveAgentRoute for threads Fixes thread routing in Discord multi-agent configurations where threads were incorrectly routed to the default agent instead of inheriting from their parent channel's binding. * ci: trigger fresh macOS runners * Discord: inherit thread bindings in reactions * fix: add changelog for thread parent binding (openclaw#3892) (thanks @aerolalit) --------- Co-authored-by: Lalit Singh <lalit@clawd.bot> Co-authored-by: OSS Agent <oss-agent@clawdbot.ai> Co-authored-by: Shadow <shadow@clawd.bot>
When a Telegram forum topic message doesn't match a direct peer binding, now checks if the parent group has a binding and uses that agent. This enables multi-agent setups where forum topics inherit their parent group's agent binding automatically, consistent with Discord thread behavior added in openclaw#3892. Changes: - Pass parentPeer to resolveAgentRoute for forum topics - Parent peer is the group ID without :topic:N suffix - Add tests for Telegram forum topic binding inheritance Fixes topic routing in Telegram multi-agent configurations where topics were incorrectly routed to the default agent instead of inheriting from their parent group's binding.
…nclaw#3892) * feat(routing): add thread parent binding inheritance for Discord When a Discord thread message doesn't match a direct peer binding, now checks if the parent channel has a binding and uses that agent. This enables multi-agent setups where threads inherit their parent channel's agent binding automatically. Changes: - Add parentPeer parameter to ResolveAgentRouteInput - Add binding.peer.parent match type - Resolve thread parent early in Discord preflight - Pass parentPeer to resolveAgentRoute for threads Fixes thread routing in Discord multi-agent configurations where threads were incorrectly routed to the default agent instead of inheriting from their parent channel's binding. * ci: trigger fresh macOS runners * Discord: inherit thread bindings in reactions * fix: add changelog for thread parent binding (openclaw#3892) (thanks @aerolalit) --------- Co-authored-by: Lalit Singh <lalit@clawd.bot> Co-authored-by: OSS Agent <oss-agent@clawdbot.ai> Co-authored-by: Shadow <shadow@clawd.bot>
…nclaw#3892) * feat(routing): add thread parent binding inheritance for Discord When a Discord thread message doesn't match a direct peer binding, now checks if the parent channel has a binding and uses that agent. This enables multi-agent setups where threads inherit their parent channel's agent binding automatically. Changes: - Add parentPeer parameter to ResolveAgentRouteInput - Add binding.peer.parent match type - Resolve thread parent early in Discord preflight - Pass parentPeer to resolveAgentRoute for threads Fixes thread routing in Discord multi-agent configurations where threads were incorrectly routed to the default agent instead of inheriting from their parent channel's binding. * ci: trigger fresh macOS runners * Discord: inherit thread bindings in reactions * fix: add changelog for thread parent binding (openclaw#3892) (thanks @aerolalit) --------- Co-authored-by: Lalit Singh <lalit@clawd.bot> Co-authored-by: OSS Agent <oss-agent@clawdbot.ai> Co-authored-by: Shadow <shadow@clawd.bot>
…nclaw#3892) * feat(routing): add thread parent binding inheritance for Discord When a Discord thread message doesn't match a direct peer binding, now checks if the parent channel has a binding and uses that agent. This enables multi-agent setups where threads inherit their parent channel's agent binding automatically. Changes: - Add parentPeer parameter to ResolveAgentRouteInput - Add binding.peer.parent match type - Resolve thread parent early in Discord preflight - Pass parentPeer to resolveAgentRoute for threads Fixes thread routing in Discord multi-agent configurations where threads were incorrectly routed to the default agent instead of inheriting from their parent channel's binding. * ci: trigger fresh macOS runners * Discord: inherit thread bindings in reactions * fix: add changelog for thread parent binding (openclaw#3892) (thanks @aerolalit) --------- Co-authored-by: Lalit Singh <lalit@clawd.bot> Co-authored-by: OSS Agent <oss-agent@clawdbot.ai> Co-authored-by: Shadow <shadow@clawd.bot>
…nclaw#3892) * feat(routing): add thread parent binding inheritance for Discord When a Discord thread message doesn't match a direct peer binding, now checks if the parent channel has a binding and uses that agent. This enables multi-agent setups where threads inherit their parent channel's agent binding automatically. Changes: - Add parentPeer parameter to ResolveAgentRouteInput - Add binding.peer.parent match type - Resolve thread parent early in Discord preflight - Pass parentPeer to resolveAgentRoute for threads Fixes thread routing in Discord multi-agent configurations where threads were incorrectly routed to the default agent instead of inheriting from their parent channel's binding. * ci: trigger fresh macOS runners * Discord: inherit thread bindings in reactions * fix: add changelog for thread parent binding (openclaw#3892) (thanks @aerolalit) --------- Co-authored-by: Lalit Singh <lalit@clawd.bot> Co-authored-by: OSS Agent <oss-agent@clawdbot.ai> Co-authored-by: Shadow <shadow@clawd.bot>
…nclaw#3892) * feat(routing): add thread parent binding inheritance for Discord When a Discord thread message doesn't match a direct peer binding, now checks if the parent channel has a binding and uses that agent. This enables multi-agent setups where threads inherit their parent channel's agent binding automatically. Changes: - Add parentPeer parameter to ResolveAgentRouteInput - Add binding.peer.parent match type - Resolve thread parent early in Discord preflight - Pass parentPeer to resolveAgentRoute for threads Fixes thread routing in Discord multi-agent configurations where threads were incorrectly routed to the default agent instead of inheriting from their parent channel's binding. * ci: trigger fresh macOS runners * Discord: inherit thread bindings in reactions * fix: add changelog for thread parent binding (openclaw#3892) (thanks @aerolalit) --------- Co-authored-by: Lalit Singh <lalit@clawd.bot> Co-authored-by: OSS Agent <oss-agent@clawdbot.ai> Co-authored-by: Shadow <shadow@clawd.bot> (cherry picked from commit 01d76e4) # Conflicts: # CHANGELOG.md # README.md
…nclaw#3892) * feat(routing): add thread parent binding inheritance for Discord When a Discord thread message doesn't match a direct peer binding, now checks if the parent channel has a binding and uses that agent. This enables multi-agent setups where threads inherit their parent channel's agent binding automatically. Changes: - Add parentPeer parameter to ResolveAgentRouteInput - Add binding.peer.parent match type - Resolve thread parent early in Discord preflight - Pass parentPeer to resolveAgentRoute for threads Fixes thread routing in Discord multi-agent configurations where threads were incorrectly routed to the default agent instead of inheriting from their parent channel's binding. * ci: trigger fresh macOS runners * Discord: inherit thread bindings in reactions * fix: add changelog for thread parent binding (openclaw#3892) (thanks @aerolalit) --------- Co-authored-by: Lalit Singh <lalit@clawd.bot> Co-authored-by: OSS Agent <oss-agent@clawdbot.ai> Co-authored-by: Shadow <shadow@clawd.bot>
…nclaw#3892) * feat(routing): add thread parent binding inheritance for Discord When a Discord thread message doesn't match a direct peer binding, now checks if the parent channel has a binding and uses that agent. This enables multi-agent setups where threads inherit their parent channel's agent binding automatically. Changes: - Add parentPeer parameter to ResolveAgentRouteInput - Add binding.peer.parent match type - Resolve thread parent early in Discord preflight - Pass parentPeer to resolveAgentRoute for threads Fixes thread routing in Discord multi-agent configurations where threads were incorrectly routed to the default agent instead of inheriting from their parent channel's binding. * ci: trigger fresh macOS runners * Discord: inherit thread bindings in reactions * fix: add changelog for thread parent binding (openclaw#3892) (thanks @aerolalit) --------- Co-authored-by: Lalit Singh <lalit@clawd.bot> Co-authored-by: OSS Agent <oss-agent@clawdbot.ai> Co-authored-by: Shadow <shadow@clawd.bot>
When a Telegram forum topic message doesn't match a direct peer binding, now checks if the parent group has a binding and uses that agent. This enables multi-agent setups where forum topics inherit their parent group's agent binding automatically, consistent with Discord thread behavior added in openclaw#3892. Changes: - Pass parentPeer to resolveAgentRoute for forum topics - Parent peer is the group ID without :topic:N suffix - Add tests for Telegram forum topic binding inheritance Fixes topic routing in Telegram multi-agent configurations where topics were incorrectly routed to the default agent instead of inheriting from their parent group's binding.
…nclaw#3892) * feat(routing): add thread parent binding inheritance for Discord When a Discord thread message doesn't match a direct peer binding, now checks if the parent channel has a binding and uses that agent. This enables multi-agent setups where threads inherit their parent channel's agent binding automatically. Changes: - Add parentPeer parameter to ResolveAgentRouteInput - Add binding.peer.parent match type - Resolve thread parent early in Discord preflight - Pass parentPeer to resolveAgentRoute for threads Fixes thread routing in Discord multi-agent configurations where threads were incorrectly routed to the default agent instead of inheriting from their parent channel's binding. * ci: trigger fresh macOS runners * Discord: inherit thread bindings in reactions * fix: add changelog for thread parent binding (openclaw#3892) (thanks @aerolalit) --------- Co-authored-by: Lalit Singh <lalit@clawd.bot> Co-authored-by: OSS Agent <oss-agent@clawdbot.ai> Co-authored-by: Shadow <shadow@clawd.bot>

Summary
When a Discord thread message doesn't match a direct peer binding, this PR enables checking if the parent channel has a binding and uses that agent instead.
This enables multi-agent setups where threads inherit their parent channel's agent binding automatically.
Problem
In multi-agent Discord setups, messages in threads were being routed to the default agent instead of the agent bound to the parent channel. For example:
#adecco-prchannel is bound toadeccoagent#adecco-prmainagent instead ofadeccoSolution
parentPeerparameter toResolveAgentRouteInputbinding.peer.parentmatch typeChanges
src/routing/resolve-route.ts: Add parentPeer parameter and binding.peer.parent matchingsrc/routing/resolve-route.test.ts: Add comprehensive tests for parent binding inheritancesrc/discord/monitor/message-handler.preflight.ts: Resolve thread parent early and pass to routingTests Added
Breaking Changes
None. This is additive - existing bindings continue to work as before.
Greptile Overview
Greptile Summary
This PR extends the routing layer (
src/routing/resolve-route.ts) with an optionalparentPeerinput and a new match reason (binding.peer.parent), allowing a thread message to inherit an agent binding from its parent channel when the thread channel itself has no direct binding. The Discord message preflight (src/discord/monitor/message-handler.preflight.ts) now resolves thread parent info early and passes the parent channel id into routing so Discord threads route consistently with their parent channel. Tests insrc/routing/resolve-route.test.tscover precedence (direct peer > parent peer > guild) and fallbacks when parent info is absent/empty.Confidence Score: 5/5
(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!