Enable sending messages to running agents (steering)

t-402·WorkTask·
·
·
Created1 month ago·Updated1 month ago

Description

Edit

Allow users to send messages to running agents, injected between iterations.

Design

Agent checks for steering between iterations at a clean boundary. Steering is injected into the conversation context, then the agent continues the same run.

Agent iteration 1 → tool call → result
Agent iteration 2 → tool call → result  
User: agentd steer run-123 "try a different approach"
Agent checks steering queue before iteration 3
Steering injected as user message in context
Agent iteration 3 → now has guidance → continues
...
Agent completes (single run, single trace)

Key Properties

  • Same run, same trace (not a new spawn)
  • Steering injected at clean boundary (no interrupted work)
  • Full replayability preserved (steering is an event in the trace)
  • Agent stays simple - just one check point between iterations

Implementation

Steering file

_/events/<run-id>.steering - messages to inject

agentd command

agentd steer <run-id> "try a different approach"

Writes message to steering file. Agent picks it up on next iteration boundary.

Agent changes (Omni/Agent/Engine.hs)

In the main loop, between iterations: 1. Check for steering file (path from env var or convention) 2. If exists, read and clear it 3. Append as user message to conversation 4. Emit steering event to trace 5. Continue iteration

Event type

{"type": "steering", "message": "try a different approach", "timestamp": "..."}

Op.hs Check operation

The existing Check :: (Maybe Steering -> next) -> OpF s next is exactly this. Interpreter calls it between iterations, reads from steering file.

Changes Needed

1. Add agentd steer <run-id> <message> command 2. Implement steering check in Engine.hs loop (between iterations) 3. Add EventSteering type to Events.hs 4. Pass steering file path to agent (env var AGENT_STEERING_FILE or derive from run-id)

Replay

When replaying, steering events are in the trace - replayer injects them at the same points. Perfect reproducibility.

Timeline (4)

🔄[human]Open → InProgress1 month ago
💬[human]1 month ago

Implemented steering via agentd steer + AGENT_STEERING_FILE, added EventSteering handling in sequential interpreter, and updated docs/specs.

🔄[human]InProgress → Done1 month ago