Skip to content

fix(workflow): make steering a live kilo session reliable - #4834

Merged
iscekic merged 2 commits into
mainfrom
kilo-steer
Jul 28, 2026
Merged

fix(workflow): make steering a live kilo session reliable#4834
iscekic merged 2 commits into
mainfrom
kilo-steer

Conversation

@iscekic

@iscekic iscekic commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Agents following .kilo_workflow kept reporting interactive kilo sessions as wedged when steering them — messages "stuck in queued". Two of the three causes were real delivery bugs in how the steer was sent; the third was a misread of normal behaviour, which led to killing sessions that were working fine.

What actually happens

All three reproduced against kilo 7.4.16, driving a real kilo run --interactive session in tmux:

Cause Evidence
A trailing Enter in the same tmux send-keys call is swallowed by long messages 240 chars submitted fine; 2636 chars sat unsent in the composer — no echo, no queue indicator. A separate send-keys Enter submitted it.
An unbracketed paste-buffer submits at every newline A three-line message produced three prompts (queue 0 → 3), so fragment one ran as its own turn before the rest arrived. paste-buffer -p delivered the same text as one prompt (queue 0 → 1).
N queued is delivery working, not a wedge Watched 4 queued drain one prompt per turn boundary once a long bash turn ended. Queued prompts do not drain between tool calls, and Escape does not flush them.

A fourth hazard showed up while testing: a mistargeted steer pasted into a shell pane executes as a shell command (verified).

The fix

.kilo_workflow/steer.sh <tmux-target> <message|->:

  • Enter as its own keystroke after the text, retried, so long messages actually submit.
  • load-buffer + paste-buffer -p — the message travels as data (a literal Enter or C-c in the text can't be read as a key name) and multi-line stays one prompt.
  • Refuses any pane not running the kilo CLI.
  • Confirms from the pane, printing queued (waiting behind the active turn) or running (taken immediately); non-zero exit means not delivered, with the pane tail, so nobody sends a second copy.
  • Per-invocation tmux buffer, so parallel sections can't paste each other's message.

WORKFLOW.md gains a Steering a Live Interactive Session section: use the script, N queued is never grounds for a kill or relaunch (a wedge needs a frozen timer, a stream error, or a dead process), delivery is ordered and turn-paced so one consolidated message beats a drip of corrections, and kill-and-relaunch is the move when a change must land before the current turn ends. The Planner Monitor wedge rule now names queued steers as not-a-wedge, and the learning file is rewritten around the fix instead of "steering rarely works".

Verification

Final matrix against live sessions: huge single-line on an idle session → running; multi-line via stdin on a busy session → queued, queue +1; shell pane → refused; missing target → refused; no leftover tmux buffers.

No test file: .kilo_workflow/ has no shell-test harness (dispatch-role.sh, comparable in complexity, has none either) and the behaviour only exists against a live kilo TUI, so the verification is the matrix above, recorded in the learning.

Agents steering an interactive kilo session (planner, orchestrator) kept
reporting wedges that were really delivery failures, and treating kilo's
`N queued` footer as a wedge — killing sessions that were working.

Three causes, reproduced against kilo 7.4.16:

- A trailing `Enter` in the same `tmux send-keys` call submits short
  messages but is swallowed by long ones (2.6k chars sat unsent in the
  composer). Enter has to arrive as its own keystroke.
- An unbracketed `paste-buffer` submits at every newline, so a three-line
  steer arrives as three prompts and the first fragment is acted on alone.
  Bracketed paste keeps it one prompt.
- Queued prompts drain one per turn boundary, not between tool calls, so a
  long turn holds the queue the whole time. That is delivery working.

Adds `.kilo_workflow/steer.sh` — sends Enter separately, pastes bracketed,
refuses panes not running the kilo CLI (a mistargeted steer otherwise
executes as a shell command), and confirms from the pane, printing `queued`
or `running`. Documents the queue semantics in WORKFLOW.md so a queue count
is never grounds for a relaunch, and rewrites the learning around the fix.
@iscekic iscekic self-assigned this Jul 28, 2026
Comment thread .kilo_workflow/steer.sh Outdated
@kilo-code-bot

kilo-code-bot Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Executive Summary

The follow-up commit gates the Enter retry in steer.sh on the message still being visible unsent in the composer, resolving the previous spurious-resend warning; no new issues found in changed code.

Files Reviewed (4 files)
  • .kilo_workflow/README.md
  • .kilo_workflow/WORKFLOW.md
  • .kilo_workflow/learnings/steering-a-running-kilo-session.md
  • .kilo_workflow/steer.sh
Previous Review Summary (commit 3747767)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 3747767)

Status: 1 Issue Found | Recommendation: Address before merge

Executive Summary

The new steer.sh retry loop can send a spurious extra Enter keystroke to the target session if delivery confirmation lags behind an already-successful submission.

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
.kilo_workflow/steer.sh 62 Retry loop can resend Enter after the message already submitted, if confirmation lags the 4s inner window
Files Reviewed (4 files)
  • .kilo_workflow/README.md - 0 issues
  • .kilo_workflow/WORKFLOW.md - 0 issues
  • .kilo_workflow/learnings/steering-a-running-kilo-session.md - 0 issues
  • .kilo_workflow/steer.sh - 1 issue

Fix these issues in Kilo Cloud


Reviewed by claude-sonnet-5 · Input: 22 · Output: 6.6K · Cached: 503.9K

Review guidance: REVIEW.md from base branch main

…oser

An unconfirmed submission is not a lost keystroke: the retry loop re-pressed
Enter after every 4s confirmation window, so a slow-rendering pane could take
a second Enter it did not need. Gate the retry on the message still being
visible unsent in the composer, and report an unconfirmed submission as such
rather than as a definite failure.
@iscekic
iscekic requested a review from jeanduplessis July 28, 2026 15:12
@iscekic
iscekic enabled auto-merge (squash) July 28, 2026 15:12
@iscekic
iscekic merged commit e7b574a into main Jul 28, 2026
16 checks passed
@iscekic
iscekic deleted the kilo-steer branch July 28, 2026 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants