Skip to content
This repository was archived by the owner on Feb 21, 2026. It is now read-only.

Reactions leak into background task lane via shared IPC input directoryΒ #84

@Peyton-Spencer

Description

@Peyton-Spencer

Bug

When a reaction arrives while a background task is running, the reaction message gets piped into the background task's active agent query instead of only reaching the message lane.

Observed behavior

Logs from a session where the task lane was running an accessibility audit and a πŸ’š reaction came in:

[agent-runner] [msg #98] tool=Bash grep -n "sr-only" ...    ← task lane working
[agent-runner] [msg #99] type=user
Reaction on bot message in Discord                          ← reaction arrives
[agent-runner] Piping IPC message into active query (164 chars)  ← LEAKED into task
[agent-runner] [msg #10] type=system/init                   ← message lane also spins up
[agent-runner] Session initialized: 47c712a1-...

The reaction was handled by both:

  1. A new message-lane session (correct) β€” responded with <internal> no-response
  2. The running task-lane agent (incorrect) β€” piped in via IPC, agent happened to ignore it

Expected behavior

Reactions (and all message-lane IPC) should only reach the message-lane container, never the task-lane container.

Root cause

queue.sendMessage() writes to the input/ IPC directory. Task containers are supposed to be isolated via an overlaid mount (input-task/ β†’ /workspace/ipc/input/), but the reaction message still reached the task container's active query.

Relevant code:

  • Host write: group-queue.ts:231 β€” sendMessage() writes to data/ipc/{folder}/input/
  • Mount setup: local-backend.ts:147-162 β€” task containers mount input-task/ over input/
  • Container read: agent-runner/src/index.ts:512-516 β€” drainIpcInput() polls /workspace/ipc/input/

The mount overlay (input-task/ β†’ /workspace/ipc/input/) may not fully isolate the directories, possibly due to Apple Container mount ordering or timing.

Impact

  • Low severity now: Reactions generate short messages the agent tends to ignore
  • High severity potential: If a user sends a real message while a task is running, the message content could be injected into the task agent's context, causing it to act on unrelated instructions mid-task

Possible fixes

  1. Verify mount isolation: Debug whether the Apple Container overlaid mount actually shadows input/ for task containers β€” may need container exec to confirm
  2. Separate directory trees entirely: Instead of mount overlays, use completely separate IPC root dirs per lane (e.g., ipc-message/ and ipc-task/) and pass the path via env var to the agent-runner
  3. Lane-aware IPC polling: Add a NANOCLAW_IPC_LANE env var so the agent-runner knows which subdirectory to poll, rather than hardcoding /workspace/ipc/input

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions