terraphim / terraphim/terraphim-ai

Evaluate: Steering and follow-up message queues for ADF agent interaction

Open
#687 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Rust
Stars
62
Forks
5
Avg merge
2h 27m
Merged PRs (30d)
1

Description

Parent Epic

#682 -- Evaluate Pi architectural patterns

Pattern

Pi distinguishes two types of messages sent while the agent is working:

Queue Trigger Effect
Steering Enter while agent runs Delivered after current tool completes. Remaining tools skipped. Agent responds to interruption.
Follow-up Alt+Enter while agent runs Delivered only after agent finishes all work. Triggers another turn.

Both queues are configurable: "one-at-a-time" (waits for response before next) or "all" (delivers all queued at once).

Current State

ADF agent interaction model:

  • Agents are subprocesses (claude -p, codex exec) that run to completion
  • No mechanism to steer a running agent mid-task
  • No follow-up queue -- must wait for agent_end then spawn new process
  • The reconciliation loop runs on a 30s tick -- no real-time interaction
  • Claude Code's --resume enables multi-turn but requires process restart

Evaluation Questions

  1. Is real-time steering valuable for ADF? Current agents run autonomously. Would "stop, do this instead" improve outcomes for long-running tasks?
  2. How would this work with subprocess agents? Pi's queues work because the agent loop is in-process. ADF spawns external processes. Options: (a) migrate to Agent SDK (in-process), (b) use stdin pipe to subprocess, (c) signals.
  3. Does the Agent SDK support steering? Check if query() accepts mid-stream prompts or if it requires session resume.
  4. Follow-up vs reconciliation loop: ADF's 30s reconciliation tick is a crude follow-up mechanism. Would explicit follow-up queues improve this?

Acceptance Criteria

  • Map ADF agent interaction points where steering would add value
  • Assess Agent SDK capabilities for mid-stream interaction
  • Design: how would steering/follow-up integrate with the reconciliation loop?
  • Decision: implement (via Agent SDK migration or subprocess protocol), defer to Agent SDK migration, or reject

Dependencies

  • Agent SDK evaluation (if steering requires in-process agent loop)
  • #639 Session persistence for Claude Code agents in ADF

References

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the ADF reconciliation loop in terraphim-ai/crates/terraphim_orchestrator and the Agent SDK details in knowledge/claude-agent-sdk-reference.md. Compare the referenced Pi steering and follow-up design, then assess subprocess and session-resume constraints. Done means documenting the interaction points, SDK capabilities, integration design, and an implement/defer/reject decision.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
ai, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.