feat(agentMentionService): unified inline cue composition (supersedes #416 + #417) - #420
Merged
Conversation
samxu01
added a commit
that referenced
this pull request
May 21, 2026
…artbeat templates (#419) Adds a tight 'Consultation — when to phone a code specialist' section to the heartbeat templates of theo (dev-pm), pixel (frontend-engineer), and ops (devops-engineer). Nova (backend- engineer) already has an elaborate sam-local-codex delegation pattern, untouched here. Per the user-reinforced strategic frame: openclaw agents stay first-class for routine work; they CONSULT codex/claude-code specialists via 1:1 DM only when their own tools hit a limit. This is collaboration, NOT delegation. Composes with PR #420 (unified inline cue composition for chat.mention/thread.mention payloads) — heartbeat-template covers autonomous heartbeats, payload cue covers @-mentions. Per registry.js source-of-truth: fresh installs pick this up; live dev agents with curated HEARTBEAT.md keep their version unless config.customizations.heartbeat is force-overridden. Closes #419.
This was referenced May 21, 2026
…416 + #417) Per code-review feedback on PR #416 + #417: those two PRs touch the same content-build expression in enqueueMentions and have a mechanical merge conflict — whichever lands second hits it. Plus #416 didn't gate on eventType, so thread.mention events got the consultation cue erroneously. This PR composes both cues in one place with the correct 4-way matrix: chat.mention + non-specialist → [Pod] [Collab] [Reply] body chat.mention + specialist → [Pod] [Reply] body thread.mention + non-specialist→ [Pod] [Collab] body thread.mention + specialist → [Pod] body Rules: - Pod-context cue: ALWAYS (existing behavior, untouched) - Consultation cue: WHEN target agent is NOT a code specialist (codex / cloud-codex / claude-code). Both chat.mention AND thread.mention paths — code-help is a useful affordance in either context. - Reply-mechanics cue: ONLY for chat.mention. thread.mention replies post via a different openclaw path and don't have the heartbeat- clobber race shape. New helper: buildContentForTarget(podId, rawContent, eventType, targetAgentName) — single place to extend the cue composition in future iterations. Applied at all 3 enqueue paths (direct-match, agentName fallback, mention-autoJoin). Tests cover all 5 combinations (4 from the matrix + claude-code parity check for specialist gating). Closes #416 and #417 — both supersede here. Also incorporates reviewer's suggestion to soften the 403 case in the consultation cue: 'if you get a 403, they're not [a peer] — skip', so agents don't silently fail when a specialist isn't in any shared pod.
samxu01
force-pushed
the
feat/inline-cues-unified
branch
from
May 22, 2026 10:01
be0db9d to
158d81b
Compare
samxu01
marked this pull request as ready for review
May 22, 2026 10:19
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
Supersedes #416 (consultation cue) and #417 (reply-mechanics cue) per code-review feedback. Those two PRs both replaced the same
const content = ...line inenqueueMentions— whichever landed second would hit a guaranteed merge conflict. Plus #416 didn't gate oneventType, sothread.mentionevents erroneously got the consultation cue.This PR composes both cues in one place with explicit per-event-type gating.
Composition matrix (the cue layering rules)
chat.mentionchat.mentionthread.mentionthread.mentionAPI
Single helper called from all 3
enqueueMentionsenqueue sites (direct-match, agentName fallback, mention-autoJoin).Tests
5 cases in
agentMentionService.test.js:What's borrowed from #416 / #417 (now superseded)
formatConsultationCue()andisCodeSpecialistAgent()from feat(agentMentionService): inline cross-runtime consultation cue #416formatMentionReplyCue(podId)from feat(agentMentionService): inline reply-mechanics cue (heartbeat-clobber mitigation) #417Token cost
Per-event:
Action for #416 + #417
Once this PR is reviewed + merged, close #416 and #417 with a "superseded by #420" comment.
🤖 Generated with Claude Code