Repository navigation
Conversation
Stranded the nova↔theo smoke: when an agent calls commonly_post_message in an agent-dm pod with no `@peer` text, the route only fired enqueueMentions — which extracts nothing without an `@`. The peer's event queue stayed empty, so neither bot ever received a chat.mention for the other's message. Fix: branch on pod.type and call enqueueDmEvent for agent-dm posts. The human-side messageController already does this for all three DM-shaped pod types (agent-admin / agent-room / agent-dm). The agent side only needs it in agent-dm — agent-admin and agent-room are operator-driven 1:1 with one agent and one human, and the human peer has no event queue to deliver to. Non-DM pods continue to gate on explicit @mentions via enqueueMentions. The bot-loop guard inside enqueueDmEvent (8 consecutive bot turns within 30 min) is unchanged and still backstops a runaway ping-pong.
samxu01
added a commit
that referenced
this pull request
May 4, 2026
Stranded the nova↔theo smoke: when an agent calls commonly_post_message in an agent-dm pod with no `@peer` text, the route only fired enqueueMentions — which extracts nothing without an `@`. The peer's event queue stayed empty, so neither bot ever received a chat.mention for the other's message. Fix: branch on pod.type and call enqueueDmEvent for agent-dm posts. The human-side messageController already does this for all three DM-shaped pod types. The agent side only needs it in agent-dm — agent-admin and agent-room are operator-driven 1:1 with one agent and one human, and the human peer has no event queue. Non-DM pods continue to gate on explicit @mentions via enqueueMentions. Bot-loop guard inside enqueueDmEvent (8 consecutive bot turns within 30 min) is unchanged and still backstops runaway ping-pong.
Contributor
Author
samxu01
added a commit
that referenced
this pull request
May 4, 2026
CodeQL js/missing-rate-limiting on POST /memory/sync (the only remaining alert after the SQL-injection coercions). Same pattern as PR #290's earlier fix on /pods/:podId/messages — phase4RateLimit (120 req/60s, keyed per agent) brings these inline with /room, /agent-dm, /pods/:podId/ask. Also pre-empted PUT /memory which I touched substantively in Phase 2 (cycles append-mode wiring) — adding rate-limit before CodeQL flags it on the next scan.
samxu01
added a commit
that referenced
this pull request
May 4, 2026
…ack-gate (#293) Closes the read-and-write loop on the memory layer. Builds on Phase 1 (PR #288) and the §10 amendment. Three additions land in one PR: - New `cycles[]` section (§10.1): heartbeat-cadence agent journal, agent-writable, cap 40 / ≤500 chars / hard-private. Mirrors system_exchanges shape with inverted read/write roles. Whole-array overwrite returns 403 + cycles_append_only. - Broader event payload injection (§10.2): list() now mutates-on-claim (status-gated findOneAndUpdate per candidate), captures memoryRevisionAtDelivery from a single AgentMemory read, and spreads a four-field digest bundle into the returned payload — memoryDigest (system_exchanges delta), cyclesDigest (last 5), longTermDigest (head ≤800 chars), recentDailyDigest (last 2 within 7 days, ≤400 chars each). Each sub-field is independently emit-gated. - Inline HEARTBEAT cue (§10.3): ~80-token narrative directive prepended to scheduler heartbeat payload.content instructing the agent to extract one takeaway per cycle and append to cycles[]. Same lesson as the §9 DM frame — narrative wins over structured metadata. Lifecycle change: AgentEvent.status now `pending → delivered → acked`. `delivered` is intermediate (claimed, awaiting explicit ack). The status-gated acknowledge rewrite + $max-bumped lastSeenRevision make first-ack monotone and dup-ack a noop. memoryRevisionAtDelivery is captured on the doc at claim time so the bump survives the fetch→ack window without trusting the client. Tests: 32 cycles + digest unit (new file), 9 event-service unit (6 new), 6 cycles integration (new). 32+9+52 = 93 green locally; CI clean across Test & Coverage, E2E, Service Tests, Analyze. Rate-limit hardening: phase4RateLimit applied to PUT /memory and POST /memory/sync (matches /pods/:podId/messages from PR #290). CodeQL js/missing-rate-limiting still flags those routes as a false-positive (the middleware IS applied identically to the cleared route), accepted per PR #290 precedent — not a merge blocker.
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
POST /pods/:podId/messagesonly firedenqueueMentions— so a bot posting in anagent-dmwith no@peertext left the other bot's event queue empty (stranded the nova↔theo smoke).pod.typeand callenqueueDmEventforagent-dmposts, mirroring the human-sidemessageControllerpath. Onlyagent-dmqualifies on the agent side:agent-admin/agent-roomare operator-driven 1:1 with one human and one agent, and the human peer has no event queue.@mentionsviaenqueueMentions. Bot-loop guard insideenqueueDmEvent(8 consecutive bot turns / 30 min) is unchanged and still backstops runaway ping-pong.Test plan
tsc:checkcleancommonly_post_messagefrom one agent in anagent-dmpod with no@-tag → confirm the other bot receives achat.mentionevent inAgentEvent69f7f1a4261550171efc7c94) and verify both bots round-trip🤖 Generated with Claude Code