Repository navigation
[ENHANCEMENT] Real-time steering: coach the agent mid-task without stopping it #11802
Description
Problem (one or two sentences)
Users currently have only two ways to interact with a running agent: stop it entirely or wait for an approval prompt. There is no way to send guidance or corrections while the agent is actively working — users must abort, rephrase, and restart from scratch even for minor course corrections.
Context (who is affected and when)
This affects all users who give multi-step tasks to Roo Code. Common scenarios:
- The agent starts coding with Jest, but the user wants Vitest — they have to stop and restart
- The agent is analyzing the wrong directory — the user sees it happening but can't redirect
- The user remembers an important detail mid-task (e.g., "use UTF-8 encoding") but has no way to pass it along without interrupting
The more complex the task, the more costly a full restart becomes (lost context, wasted tokens, time).
Desired behavior (conceptual, not technical)
A "Steer" button alongside the existing Stop button. When clicked:
- User types coaching advice (e.g., "Use Vitest instead of Jest")
- The advice is queued — the agent is not interrupted
- At the next API call, the advice is included in the prompt as context
- The agent naturally incorporates the guidance into its next action
- The user sees status feedback: sent → acknowledged → applied
Think of it like a co-pilot giving directions — the car keeps moving, the driver just adjusts course.
Optionally, if the agent shows a plan (Step 1 → Step 2 → Step 3), the user can attach advice to a future step before the agent reaches it (preemptive steering).
Constraints / preferences (optional)
- Must not break the existing Stop functionality
- Should add zero overhead when no advice is pending (no extra tokens sent to LLM)
- Should work regardless of which API provider is configured
- Minimal changes to the core Task loop — ideally 2-3 lines at the injection point
Request checklist
- I've searched existing Issues and Discussions for duplicates
- This describes a specific problem with clear context and impact
Roo Code Task Links (optional)
No response
Acceptance criteria (optional)
Given the agent is executing a multi-step task
When the user clicks "Steer" and types "Use TypeScript strict mode"
Then the advice is queued without interrupting the current step
And the next API request includes the advice as additional context
And the agent acknowledges and incorporates the advice
But the agent is NOT stopped or restarted
Given no steering advice is pending
When the agent makes an API request
Then zero additional tokens are added to the prompt
And there is no performance impact
Proposed approach (optional)
I've built a standalone library @steer-agent/core (published on npm, Apache-2.0) that implements this as a middleware. It provides:
- SteeringQueue — queues reactive advice from the user
- PlanTracker — tracks agent plan + attaches preemptive advice to future steps
- SteeringInjector — formats advice into prompt-injectable text
- LoopHook — 2-3 line integration point for any agent loop
Integration point in Roo Code (src/core/task/Task.ts, line ~2641):
// Existing code — where environmentDetails is added to finalUserContent
let finalUserContent = [...contentWithoutEnvDetails, { type: "text", text: environmentDetails }]
// ★ Proposed addition (2 lines)
const injection = this.steeringHook?.getInjection(currentStepInfo)
if (injection?.hasAdvice) {
finalUserContent.push({ type: "text", text: injection.injectionText })
}The library is fully tested (28 tests passing) and includes an interactive CLI demo for hands-on verification.
Architecture details: ARCHITECTURE.md
Trade-offs / risks (optional)
| Risk | Mitigation |
|---|---|
| Extra tokens per request | Zero when no advice pending; capped at 5 messages (~150 tokens) when active |
| User sends conflicting advice | Injection text instructs the LLM to "use your judgment if it conflicts" |
| Advice arrives too late (step already passed) | TTL-based expiration (5 min default) + status tracking |
| UI complexity | Single "Steer" button with minimal text input — no complex UI needed for MVP |
Activity
shdomi8599 commentedon Feb 28, 2026
Claiming
shdomi8599 commentedon Feb 28, 2026
@roomote Great questions — here are my thoughts:
1. External dependency vs built-in
I'm flexible on this. For an MVP, implementing the core logic natively makes total sense — the key mechanics (queue + inject at
finalUserContent) are indeed straightforward and could be well under 100 lines. My@steer-agent/corepackage was designed as a proof-of-concept to validate the approach and demonstrate the integration point. If a native implementation is preferred, I'm happy to contribute that directly. We can always consider extracting it into a shared package later if other editors want to adopt the same pattern.2. Scope for MVP
Agree — MVP should focus on reactive steering only (user sends advice → queued → injected at next API call). Preemptive plan-step attachment is a natural follow-up but adds significant complexity (plan tracking, intent-based remapping). Let's ship the simple version first and iterate.
3. UI placement
Reusing the existing chat input is cleaner and less invasive. The idea would be: while the agent is actively streaming, the input area switches from "send message" to "send steering advice" (or shows a small toggle/indicator). This avoids adding new UI elements and feels natural — users already know where to type. A small visual cue (different send button color or a 🧭 icon) would distinguish steering from a regular message.
4. Status feedback
The simplified approach works great for MVP. Showing queued advice as a chat message with a "steering" or "coaching" badge, and letting the LLM naturally acknowledge it in its response, is low-friction and avoids building custom status UI. We can add richer status tracking later if users want it.
Summary for MVP scope:
I'm ready to start implementation once we're aligned. Happy to submit a draft PR for early feedback.
shdomi8599 commentedon Feb 28, 2026
@roomote Thanks for the enthusiasm, but I've already claimed this issue and I'd like to implement it myself. I have the codebase analyzed and am ready to start — I'll open the draft PR. Happy to collaborate on review though!
feat: add real-time steering advice for mid-task coaching
shdomi8599 commentedon Feb 28, 2026
@roomote I appreciate the enthusiasm, but you said "I will step back and leave the implementation to you" just minutes before opening this PR. I've already been working on my own implementation and will submit my draft PR shortly.
I'd suggest letting the maintainers decide which approach to move forward with. Happy to compare notes either way.