feat(agent-mention): collaborative-pod cue auto-replicates execute-not-handoff posture#436
Closed
samxu01 wants to merge 1 commit into
Closed
feat(agent-mention): collaborative-pod cue auto-replicates execute-not-handoff posture#436samxu01 wants to merge 1 commit into
samxu01 wants to merge 1 commit into
Conversation
…t-handoff posture Surfaced from the 2026-05-23 multi-agent huddle: when @-mentioned with a concrete spec in a collaborative pod (multiple agents + a human), openclaw moltbot agents reflexively reach for board-task delegation or heartbeat handoff to absent agents — a 2-hour-latency triple-hop chain where ~10 lines of code-change should be ~5 minutes. The reference incident is logged in docs/audits/ui-smoke-2026-05-23/ huddle-observations.md, finding #8. Sam (human) corrected the posture mid-huddle with one in-pod message; all 4 agents pivoted within 2 minutes. That proved the posture IS correctable in-context — the missing piece is auto-injecting the correction so future huddles don't need manual intervention. This commit adds a new inline cue (`formatCollaborativePodCue`) and threads a `collaborativePod: boolean` flag through `buildContentForTarget` to `agentMentionService.enqueueMentions`. Composes with the existing pod-context / consultation / reply-mechanics cues — same shape as the established ADR-012 §9 DM cue + pod-context cue per the `feedback-llm-inline-cue-beats-metadata` rule. ## When the cue fires Pod has ≥2 active non-utility agent installations AND pod.type is NOT 'agent-room' or 'agent-dm' AND target agent is NOT a code specialist (codex/cloud-codex/claude-code) AND event type is 'chat.mention' (not thread.mention) Utility helpers (commonly-bot, pod-welcomer, task-clerk, pod-summarizer) don't count as collab peers — the heuristic excludes them when counting. Code specialists already self-execute reliably; the cue is noise for them. Thread mentions are a different posture and don't need it. ## Cue body Tells the agent to: - EXECUTE the work itself when the spec is concrete and tools available - NOT wait for board-task assignment - NOT enqueue work for absent agents via heartbeat handoff - PICK UP orphaned work (claim-the-orphan) when a peer stalled - DELEGATE only via sync @-mention or 1:1 DM to a peer in this pod Companion principles captured in commonly-skills/memory/feedback-agents-collab-execute-not-handoff.md and feedback-claim-the-orphan-stalled-peer-work.md. ## Token cost ~110 tokens per qualifying mention. Cheap relative to the multi-hour delegation chains it prevents. No effect on non-qualifying paths (1:1 pods, utility-only pods, specialist targets, threads). ## Tests backend/__tests__/unit/services/agentMentionService.test.js — six new test cases under `describe('collaborative-pod cue')`: - chat.mention + ≥2 non-utility agents + non-specialist → cue PRESENT - chat.mention + single agent → cue NOT present (solo pod) - chat.mention + specialist target → cue NOT present (noise for codex) - chat.mention + 2 agents but both utility helpers → cue NOT present - chat.mention + pod.type='agent-room' → cue NOT present - thread.mention + ≥2 agents → cue NOT present (wrong posture) ## Companion audit docs/audits/2026-05-24-phase-3/openclaw-moltbot-workspace-audit.md captures the related Phase 3.B finding (moltbot workspace isn't a git worktree, so theo/nova/pixel/ops can't push code — explains why Cody shipped 5/5 commits in the 2026-05-23 sprint while moltbots stayed in review-only mode). That's the next Phase 3 PR to ship. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
samxu01
added a commit
that referenced
this pull request
May 24, 2026
…t-handoff posture (#436) When a @-mention lands in a collaborative pod (≥2 active non-utility agent installations, not an agent-room/agent-dm 1:1 pod), prepend an inline cue to the chat.mention payload.content telling the target agent to execute the work themselves (or collaborate sync via @-mention/DM) rather than enqueueing a board task for an absent agent via heartbeat handoff. Auto-replicates the in-pod correction Sam had to make manually during the 2026-05-23 multi-agent huddle. Same pattern as the established ADR-012 §9 DM cue and pod-context cue — inline cue beats structured metadata per `feedback-llm-inline-cue-beats-metadata`. ## Reference incident 2026-05-23 huddle (docs/audits/ui-smoke-2026-05-23/ huddle-observations.md, finding #8): Nova (openclaw moltbot, gpt-5.4-mini, full capability) chose a ~2-hour-latency triple-hop chain for a ~10-line install.ts fix: human → board task → Nova claim heartbeat (≤60min) → DM sam-local-codex → sam-local-codex heartbeat (≤60min) → diff lands Sam corrected the posture with one in-pod message; all 4 agents pivoted within 2 minutes. That proved the behavior IS in-context- correctable; this commit auto-injects the same correction. ## Gating Cue fires when ALL of: - Pod has ≥2 active non-utility agent installations (utility helpers: commonly-bot / pod-welcomer / task-clerk / pod-summarizer do NOT count toward the threshold) - pod.type is NOT 'agent-room' or 'agent-dm' (1:1 by design) - Target agent is NOT a code specialist (codex/cloud-codex/claude-code self-execute already) - Event type is chat.mention (not thread.mention) Token cost ~110 per qualifying mention. Cheap relative to the multi-hour delegation chains it prevents. ## Composes with existing cues chat.mention + non-specialist + collab → [Pod context:] [Collaborative pod:] [Collaboration:] [Reply mechanics:] chat.mention + non-specialist + solo → [Pod context:] [Collaboration:] [Reply mechanics:] chat.mention + specialist → [Pod context:] [Reply mechanics:] thread.mention → (no collab cue) ## Companion artifact docs/audits/2026-05-24-phase-3/openclaw-moltbot-workspace-audit.md captures the related Phase 3.B finding (moltbot workspace isn't a git worktree). Filed as GH issue #437 with the full ~75-LOC fix shape; verification needs a full deploy-test loop so deferred to a dedicated session. ## Tests backend/__tests__/unit/services/agentMentionService.test.js — six new test cases under describe('collaborative-pod cue'): - chat.mention + ≥2 non-utility agents + non-specialist → PRESENT - chat.mention + single agent → NOT present (solo pod) - chat.mention + specialist target → NOT present (noise for codex) - chat.mention + 2 agents both utility helpers → NOT present - chat.mention + pod.type='agent-room' → NOT present - thread.mention + ≥2 agents → NOT present (wrong posture) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Merged via local squash to main as 8287956 (preserves multi-author trailers per feedback-pr-merge-pattern). |
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
When a multi-agent collaborative pod receives a
chat.mention, prepend an inline cue topayload.contenttelling the target agent to execute the work themselves (or collaborate sync via @-mention/DM) rather than enqueueing a board task for an absent agent via heartbeat handoff.Auto-replicates the in-pod correction Sam had to make manually during the 2026-05-23 multi-agent huddle. Same pattern as the established ADR-012 §9 DM cue and pod-context cue — inline cue beats structured metadata per
feedback-llm-inline-cue-beats-metadata.Reference incident
In the 2026-05-23 huddle (
docs/audits/ui-smoke-2026-05-23/huddle-observations.md, finding #8), Nova (openclaw moltbot, gpt-5.4-mini, full capability) chose a ~2-hour-latency triple-hop chain for a ~10-line install.ts fix:Sam corrected the posture with one in-pod message; all 4 agents pivoted within 2 minutes. That proved the behavior IS in-context-correctable; this PR auto-injects the same correction.
When the cue fires
Utility helpers (commonly-bot, pod-welcomer, task-clerk, pod-summarizer) don't count toward the ≥2 peer threshold. Code specialists already self-execute; the cue is noise for them. Thread mentions are a different posture.
Cue body (final shape)
~110 tokens per qualifying mention. Cheap relative to the multi-hour delegation chains it prevents.
Composes with existing cues
Final cue composition for chat.mention + non-specialist + collaborative pod:
Tests
backend/__tests__/unit/services/agentMentionService.test.js— six new test cases underdescribe('collaborative-pod cue'):Related
commonly-skills/memory/feedback-agents-collab-execute-not-handoff.md+feedback-claim-the-orphan-stalled-peer-work.mddocs/audits/ui-smoke-2026-05-23/huddle-observations.md(Phase-4 finding Fix GitHub workflow test commands #8 + Fix GitHub workflow to test frontend with coverage #9)docs/audits/2026-05-24-phase-3/openclaw-moltbot-workspace-audit.md(also included in this commit).Test plan
[Collaborative pod:appears in the chat.mention event content (via mongoagentevents.payload.content)🤖 Generated with Claude Code