Skip to content

fix(chat): refuse a send over text typed in GJC's, Muse's, Qwen's, cline's or dsh-tui's box - #3752

Merged
devswha merged 3 commits into
mainfrom
fix/agent-draft-guard-more
Nov 12, 2026
Merged

devswha merged 3 commits into
mainfrom
fix/agent-draft-guard-more

Conversation

@devswha

@devswha devswha commented Nov 12, 2026 •

Copy link
Copy Markdown
Owner

Follow-up to #3732 (closes the GJC half of #3627, whose draft #3665 was closed for this approach). Same rule as #3732: a chat send is refused with input_draft only on positive evidence, typed-looking text inside a recorded box; anything the bridge cannot make out sends as before.

Cause

#3732 read the box of Codex, pi and OmO only. The agent chat audit and the agent lab's live re-run saw a chat send joined to a draft in GJC's, Muse's, Qwen Code's, cline's and dsh-tui's own box (DRAFT-…xyzchat-send… submitted as one prompt). An OmO that herdr labels claude (its Claude SDK child) got no check either, since the guard was picked by herdr's label.

Change

  • shared/input-row.ts:
    • GJC's peek recognizer now reports its box's cells. Its placeholder and its suggested next prompt are drawn in a colour, and typed text in the terminal's own, so neither counts.
    • Muse, Qwen Code, cline and dsh-tui get boxes read only by the draft check (DRAFT_RECOGNIZERS); the terminal peek does not read them, so its behaviour is unchanged. Each takes its box's first row and the rows a draft wraps onto, down to the box's lower border (at most 8 rows); a box whose borders are not found is not made out. GJC's peek recognizer still reads one row, so a GJC draft longer than one row is not refused.
    • Muse and cline draw typed text in a colour of their own: TYPED_COLOURS lists it as recorded with the default theme, and any other colour is no evidence (a theme not recorded sends as before). screenFromAnsi now keeps each cell's foreground colour for that.
    • drawsColour: a read counts as coloured only when it carries a colour or a text style (SGR 2, 3, 7, a foreground or background), not just any escape.
    • pi, for the draft check: with the looser indentation rule fix(chat): refuse a chat send over text typed in the agent's own input box #3732 gave the draft check, the editor's rows are a dialog's only when a search field (> ) sits over a select cursor (→ ); a draft starting with a Markdown quote or an arrow is still one.
  • server/core/composer.ts: for a pane herdr labels claude, the process roots are read once and serve both Claude Code's checks and, for an OmO there (its Claude SDK child), OmO's box check. The refusal's message (AGENT_INPUT_DRAFT_MESSAGE, now in shared/submit-outcome.ts) makes the composer show the generic note there instead of Claude Code's.
  • Not covered, and listed in the changelog: a GJC draft longer than one row, dsh-tui with its command list open (the list moves the box out of its recorded place), and the moment between the check and herdr's paste. omp, Devin and Grok are not in this PR: their only installs here update themselves through settings this lane may not change; they follow once the agent lab has read-only copies. An OmO that herdr leaves unlabelled is not read either (it would cost a process read on every send to a shell).

Validation

  • Recorded in the agent lab (its own HOME, pinned installs, update checks off) inside an isolated herdr session at 119×40: gjc 0.18.12, Muse Code 1.4.14, Qwen Code 0.27.2, cline 3.0.74, dsh-tui 0.19.0, each empty, with leftover draft typed, and with /mo typed and the command list open (src/lib/fixtures-input-rows/<agent>/draft-*-119.ansi, README updated).
  • Live, same session, through createSubmitText against the real herdr socket: for all five, a send over leftover draft was refused with input_draft, the draft was still in the box and nothing was appended; with the box cleared, the next send went through.
  • src/lib/inputRow.test.ts: per agent, typed is a draft, empty is not, the command-list screen as stated; Muse's typed colour counts and the same words in another colour do not; cline's grey placeholder does not; a draft wrapped onto a second row of Muse's box counts; a pi draft starting with > or → is still one (both fail at eb1f629, as the merge pass reproduced), while a dialog's search field over its select cursor is none; a read whose escapes carry no colour proves nothing.
  • server/core/agent-input-send.test.ts: an immediate send over each agent's recorded draft is refused with nothing typed (fails without the new boxes), and over each empty box goes through agent.prompt.
  • src/lib/compose.test.ts: a refusal carrying the agent-box message gets the generic note also when the pane is labelled Claude Code.
  • server/core/omo-pane-send.test.ts: a Claude-labelled OmO pane over OmO's recorded draft is refused, typing nothing (fails on main).
  • server/core/pending-birth-guard.test.ts: a queued message to GJC over its recorded draft is held with input_draft, nothing written (the queued path for the new agents). Its OpenCode-skill mode runs on a pane labelled gjc and counts the skill key's own screen reads; GJC's box check now reads the screen first, so that mode stubs freeAgentInput (the check itself is covered above).
  • bun run check fast at this head (through this PC's heavy-run queue): workflow syntax, generated types and themes, typecheck, build ok; unit tests 16430 pass, 0 fail.
  • server/submit.contract.test.ts and server/pending-input.contract.test.ts in full: 236 pass, 0 fail.
  • Not run: the browser regressions (no component changed; the peek's recognizers answer as before, checked by src/lib/inputRow.test.ts).

…ine's or dsh-tui's box

Recorded in the agent lab. GJC's peek recognizer reports its cells; the other
four get boxes read only by the draft check. Muse and cline draw typed text in
a colour of their own, which counts only as recorded.
…rless read is a draft

The box of an OmO labelled claude (its SDK child) is read as OmO's. With the
draft check's looser pi rule, a dialog's select cursor or search field row is
still none. Only an SGR colour or style counts as colour evidence.
@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Explain Change →

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Bug Fixes
    • Sending is now blocked when a draft is already present in the input box for GJC, Muse, Qwen Code, cline, dsh-tui, and OmO panes identified as Claude Code. The draft remains in the composer so it can be reviewed or edited.
    • Draft detection better distinguishes typed text from placeholders and visual styling, reducing incorrect send refusals. Unrecognized input boxes and placeholders continue to send as before.
    • Text entered after the draft check but before pasting may still be combined with the message.

The change extends typed-draft detection to additional agent input boxes and updates send handling to refuse sends when those boxes contain typed text. Screen parsing now retains foreground color data to distinguish typed text from placeholders.

Changes: Agent input draft guard

Layer / File(s) Summary
Screen parsing and draft recognition
shared/input-row.ts, src/lib/inputRow.test.ts
Screen cells now retain foreground SGR parameters. Draft recognition covers additional agent boxes and distinguishes typed rows from dialog rows, placeholders, and other text colors. Tests cover recorded typed, empty, and slash-autocomplete states.
Send guard integration and validation
server/core/composer.ts, server/core/agent-input-send.test.ts, server/core/omo-pane-send.test.ts, server/core/pending-birth-guard.test.ts, changelog.d/agent-input-draft-guard-more.md
The composer uses resolved agent types for draft checks and uses SGR color detection when reading input. Send tests cover new agent fixtures and Claude-labelled OmO panes. The changelog records the guard’s coverage and limitations.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix · Severity of issue fixed: Medium

Possibly related issues

  • devswha/ovis issue 3627 — The issue describes sends overwriting text in GJC’s input box; this change adds GJC draft detection to the send guard.

Possibly related PRs

  • devswha/ovis#3732 — This change extends the input-row recognizers and send-guard functions introduced there.

Suggested reviewers: jpcarranza94, charleoyang

Merge Risk: Minimal · previous review eb1f6

The change refuses chat sends over recorded typed drafts in more agent input boxes and otherwise sends as before. No concrete merge-blocking risk was found in the supplied evidence.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: a send is refused over typed text in the input boxes of GJC, Muse, Qwen Code, cline and dsh-tui. The changeset adds recorded box readers and tests for those agents, an…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The description follows the repository template. It has a Change section that explains the cause, the fix, and the scope limits. It also has a Validation section that lists the checks run, their resul…
Full details: Title check

Explanation

The title names the main change: a send is refused over typed text in the input boxes of GJC, Muse, Qwen Code, cline and dsh-tui. The changeset adds recorded box readers and tests for those agents, and the refusal path matches the title. The title is specific and accurate, though long at 91 characters.

Full details: Description check

Explanation

The description follows the repository template. It has a Change section that explains the cause, the fix, and the scope limits. It also has a Validation section that lists the checks run, their results, and the checks not run (browser regressions). It also states the items not covered. It does not link a maintainer-agreed issue, but it references #3732 and #3627 as context. The template asks for a link to the issue only for features, and this change is a follow-up fix to an existing guard. The description is mostly complete.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

Commits

Reviewing files that changed from the base of the PR and between ab5a573 and eb1f629.

Files ignored due to path filters: 16

  • src/lib/fixtures-input-rows/README.md is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/cline/draft-empty-119.ansi is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/cline/draft-slash-119.ansi is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/cline/draft-typed-119.ansi is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/dsh-tui/draft-empty-119.ansi is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/dsh-tui/draft-slash-119.ansi is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/dsh-tui/draft-typed-119.ansi is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/gjc/draft-empty-119.ansi is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/gjc/draft-slash-119.ansi is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/gjc/draft-typed-119.ansi is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/muse/draft-empty-119.ansi is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/muse/draft-slash-119.ansi is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/muse/draft-typed-119.ansi is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/qwen/draft-empty-119.ansi is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/qwen/draft-slash-119.ansi is excluded by !src/lib/fixtures-input-rows/**
  • src/lib/fixtures-input-rows/qwen/draft-typed-119.ansi is excluded by !src/lib/fixtures-input-rows/**
Files selected for processing: 7

  • changelog.d/agent-input-draft-guard-more.md
  • server/core/agent-input-send.test.ts
  • server/core/composer.ts
  • server/core/omo-pane-send.test.ts
  • server/core/pending-birth-guard.test.ts
  • shared/input-row.ts
  • src/lib/inputRow.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 3 remain after this review.

…read wrapped draft rows

A pi row is a dialog's only when a search field sits over a select cursor.
The draft-check boxes read the rows a draft wraps onto. A Claude-labelled
pane's process roots are read once; the agent-box refusal names its note by
its message. A queued GJC send over a draft is held.
@devswha
devswha merged commit 1a50f65 into main Nov 12, 2026
19 of 21 checks passed
@devswha

devswha commented Nov 12, 2026

Copy link
Copy Markdown
Owner Author

Merge pass

Merged head 9ee9edda57e1 as 1a50f65771af on GitHub's checks, with no unresolved review threads.

Reviewer Verdict Note
claude CLEAR
codex CLEAR (reported BLOCK) Second round. The regression the merge pass reproduced last round is fixed: a pi draft starting with '> ' or with '→ ' is refused again (run by the merge pass at this head). What remains needs a pi draft of two rows, one starting '> ' and another '→ ', which the dialog rule takes for pi's select dialog (shared/input-row.ts:210); the Opus reviewer rates it LOW. An exotic input on a heuristic matcher: documented in the merge note and a follow-up issue

Merged with these checks red, none of them required: Native macOS session identity;

Two reviewers at this head: Claude (Opus) CLEAR; Codex Terra BLOCK, cleared by the merge pass as a documented limit (below). Two heads were reviewed. Queued input and the chat send path, so a real review.

The guard #3732 added for Codex, pi and OmO now also covers GJC, Muse, Qwen, cline and dsh-tui: a chat send is refused as input_draft when the agent's own input box holds typed text, for immediate and queued sends. An OmO pane that herdr labels claude is checked as OmO. Empty boxes, placeholders, command lists and dialogs in the recorded screens read as no draft.

Closed in review: the first head no longer saw a pi draft that starts with > (a Markdown quote) or → as typed, so a send went over it, which #3732 had closed. The merge pass ran typedDraft on pi's recorded typed screen with those drafts on main and at both heads: refused on main, not at the first head, refused again at this one.

Documented limit (Codex's HIGH at this head, reproduced by the merge pass): a pi draft of two rows, one starting > and another → , is taken for pi's select dialog and is not refused (shared/input-row.ts:210); main refuses it. Requiring something only a dialog has (pi draws its cursor row in colour) would close it.

Left, none HIGH:

  • MEDIUM (Codex, reproduced with a unit test): a Qwen draft with > quoted line as its second row hides the box from its recognizer. For the five new agents only a one-row draft is refused, which is the PR's stated rule.
  • LOW (Claude, read): omo-pane-send.test.ts no longer asserts that a claude-labelled OmO pane skips Claude Code's own box check; the queued skill test stubs the box check, so GJC's check with skill typing on the queued path has no test.

Reports: ~/.cache/ovis-tmp/reports/pr-3752-*.report.md.

Merged with one check not green: Native macOS session identity, which is not a required check, was cancelled after 15 minutes waiting for its runner. It runs six test files (server/claude-store, process-start, darwin-process, grok, omp-images, scripts/install-herdr-core); this PR touches none of them or the code they cover. Its CI run started after #3744 merged on the same send path, so the required checks ran on that main.

@devswha
devswha deleted the fix/agent-draft-guard-more branch November 12, 2026 14:07
devswha added a commit that referenced this pull request Nov 12, 2026
Closes #3769. Also the review notes left on #3737 (#3563's Send anyway
half).

## Cause

Leftovers from the reviews of #3752 and #3737, each reproduced on a
recorded or synthetic screen:

- pi: a draft with one row starting `> ` and another starting `→ ` was
taken for pi's select dialog and not refused.
- Qwen Code: a draft whose second row starts with `> ` (a quoted line)
hid the box, since the recognizer stopped at the bottom-most `> ` row.
- GJC: a draft wrapped onto more than one row was not read.
- Claude Code: a placeholder wrapped inside a word (`[Pasted te` / `xt
#1 +12 lines]`, a box narrower than the word) still offered Send anyway;
a typed `[Image #1` took the button away; the refusal over a folded
paste said nothing about why no Send anyway was offered.
- Tests: the Claude-labelled OmO case had lost its assertion that Claude
Code's own box check does not run there, and the queued OpenCode-skill
tests stubbed GJC's box check, so that path was untested.

## Change

- `shared/input-row.ts`:
- pi, for the draft check: rows are a dialog's only where a search field
(`> `) sits over a select cursor (`→ `) drawn in colour, as pi draws it;
typed text takes the terminal's own colour.
- The draft-check boxes (Muse, Qwen, cline, dsh-tui) go on looking
upward past a row that starts with the box's mark but has no border
above it, so a draft row starting with `> ` is read as part of Qwen's
box.
- GJC, for the draft check only: the `│ … │` rows a draft wraps onto,
down to the bottom border (at most 8), and empty only when all of them
are (a draft may start with a blank line). The peek reads GJC's box as
before.
- `server/claude-input.ts` `foldedPlaceholder`: the box text is read
with every space and row break taken out, against patterns with none, so
a placeholder wrapped any number of times, inside words or between them,
is found. The draft checks still take a placeholder's start as content;
Send anyway is withheld only over a whole placeholder (`[Pasted text #N
+K lines]`, `[Pasted text #N]`, `[Image #N]`), so typed `[Image #1`
keeps it.
- A refusal over Claude Code's box holding a folded paste carries its
own message (`CLAUDE_FOLDED_DRAFT_MESSAGE`, `shared/submit-outcome.ts`),
kept when the immediate and the queued sends rethrow it, and the
composer shows its own note: "Not sent: Claude Code's input box in the
terminal holds a paste or image it folded, whose lines are not shown
here, so it cannot be sent over. Send or clear it there, then send this
message." (ko, ja, zh added). No new control; no other refusal changes.

## Validation

- `src/lib/inputRow.test.ts`: a pi draft of a quoted row and an arrow
row in the terminal's colour is a draft, while a dialog's search field
over its coloured cursor is not; a Qwen draft with `> quoted line` as
its second row is a draft; a GJC draft wrapped onto a second row is a
draft, also one whose first row is blank. These fail on `main` (the
blank-first-row one on 640c4b9 too).
- `server/submit.contract.test.ts`: a folded paste wrapped inside a
word, and one wrapped over three rows (inside a word and between two),
offers no box, and a send anyway is refused (both fail on `main`, the
three-row one on 640c4b9 too); `! echo [Image #1` offers its box and
sends anyway (fails on `main`); the folded refusals carry
`CLAUDE_FOLDED_DRAFT_MESSAGE`; a scrolled send whose history end keeps
moving over a folded paste is refused with no box and that message, and
its send anyway is refused.
- `server/pending-input.contract.test.ts`: a queued message over a
folded paste in Claude's box is refused with that message and no box,
nothing typed.
- `server/core/omo-pane-send.test.ts`: the Claude-labelled OmO send
reads only OmO's box (the viewport, then the live screen), not Claude
Code's.
- `server/core/pending-birth-guard.test.ts`: a queued message with an
OpenCode skill to GJC over its recorded draft is held with
`input_draft`, nothing written (GJC's check no longer stubbed for it).
- `src/lib/compose.test.ts`: the folded refusal's note differs from
Claude Code's general one.
- `bun run check fast` at this head (through this PC's heavy-run queue):
workflow syntax, generated types and themes, typecheck, build ok; unit
tests 16481 pass, 0 fail.
- `server/submit.contract.test.ts` and
`server/pending-input.contract.test.ts` in full: 241 pass, 0 fail.
- Not run: the browser regressions (no component changed) and a live
Claude run (the refusal paths are the ones #3737 ran live; the new cases
are a narrower box and typed text).
devswha added a commit that referenced this pull request Nov 12, 2026
…e's, Gemini's or Kilo's box (#3775)

Follow-up to #3732, #3752 and #3773: the same draft check for five more
agents the agent lab runs. A chat send is refused with `input_draft`
only when typed-looking text is seen inside the agent's recorded box;
anything the bridge cannot make out sends as before.

## Cause

The agent lab's live re-run saw a chat send joined to a draft in Letta
Code's, Gemini CLI's and Kilo's own box, and the audit found the same in
code for maki and Kimi Code: none of them had a recorded box, so nothing
was read before the paste.

## Change

- `shared/input-row.ts`, draft-check boxes (the terminal peek does not
read them):
- Letta Code (`› ` between full-width rules), maki (`❯ ` between
full-width rules), Kimi Code (herdr's `kimi`, `│ > ` in a rounded box),
Gemini CLI (`> ` between a `▄` row and a `▀` row), Kilo (the `┃` rows
over its `╹▀` row, home screen and session alike, the last of them its
agent and model line).
- `TYPED_COLOURS`: maki, Gemini and Kilo draw typed text in a colour of
their own, listed as recorded with the default theme; Letta and Kimi
Code use the terminal's.
- A character that draws nothing is no typed text: Letta pads its empty
box with zero-width characters after its cursor, which read as typed
before.
- `server/core/composer.ts` `freeAgentInput`: the viewport's colours
count when its rows are the live screen's last ones. Gemini's live read
holds a row more at its top than its viewport, so the two never matched
and the box was never judged. At most two extra rows above are accepted,
never different rows at the bottom.
- `server/claude-input.ts`: Claude Code's `[...Truncated text #N +M
lines...]` placeholder (a paste it cut short) also withholds Send
anyway, as `[Pasted text …]` does (from #3773's review).
- `src/lib/compose.ts`: a comment moved back above the branch it
describes (from #3773's review).
- Not covered, and in the changelog: a slash command Kimi Code or Gemini
CLI draws in its command colour, and typed text in a theme colour that
was not recorded. omp, Devin and Grok are not here: they need the
owner's own sign-ins.

## Validation

- Recorded in the agent lab (its own HOME, pinned installs, update
checks off) inside an isolated herdr session at 119×40: Letta Code
0.34.23, maki 0.7.1, Kimi Code 2.5.3 and Kilo 7.8.27 on the lab's QA
backend (`run --qa`), Gemini CLI 0.68.0 on the team proxy (it speaks
only the Gemini API); empty, `leftover draft` typed, `/mo` typed; Kilo
also under its first answer
(`src/lib/fixtures-input-rows/<agent>/draft-*-119.ansi`, README
updated). Kilo's saved model was restored after its QA run, as the lab's
README asks.
- Live, same session, through `createSubmitText` against the real herdr
socket: for all five, a send over `leftover draft` was refused with
`input_draft`, the draft stayed in the box and nothing was appended;
with the box cleared, the next send went through. Before the zero-width
and row-offset fixes, Letta's empty box was refused and Gemini's draft
was sent over: both seen live, both fixed and re-run.
- `src/lib/inputRow.test.ts`: per agent, typed is a draft, empty is not,
the `/mo` screen as stated; Kilo's session box reads as its home
screen's; zero-width padding after Letta's cursor is no typed text. All
fail on `main`.
- `server/core/agent-input-send.test.ts`: an immediate send over each
new agent's recorded draft is refused with nothing typed, and over its
empty box goes through (the refusals fail on `main`); a live read
holding a row more above the viewport is still judged and refused (fails
on `main`); an agent with no recorded box gets no viewport read.
- `server/submit.contract.test.ts`: a box holding `[...Truncated text #1
+40 lines...]` offers no Send anyway, and a send anyway is refused
(fails on `main`).
- `bun run check fast` (through this PC's heavy-run queue): workflow
syntax, generated types and themes, typecheck, build ok; unit tests
16609 pass, 0 fail.
- `server/submit.contract.test.ts` and
`server/pending-input.contract.test.ts` in full: 242 pass, 0 fail.
- Not run: the browser regressions (no component changed; the peek's
recognizers are untouched).
devswha added a commit that referenced this pull request Nov 15, 2026
Fixes #3627. Thanks to @najy97 for the report and the careful evidence
(the 76 + 544 character join in GJC's history).

> Waits for the release freeze: this touches `shared/` and `server/`
tests, so it merges only after the 0.5.4 Release run.

## Cause

This is the same fault as #609 / #629 and #3775. A chat send pastes into
the agent's own input box and presses Enter, and nothing reads the box
first, so text left there is joined to the message.

- **GJC itself** is already guarded on `main`: #3732 added the draft
check (`freeAgentInput`, `typedDraft`) and #3752 added GJC's recorded
box to it. Neither PR closed this issue.
- **Same fault, still open: omp.** omp has a recognizer (`ompInputRow`),
but it was recorded on omp 18.8.7 and reports no typed cells, so
`readsTypedDraft("omp")` was false. omp 18.14 also draws its editor
differently: the status line has lost its `╭── … ╮` frame and the editor
has no closing `─╯`. That recognizer does not find the box at all. A
send to omp went straight to `agent.prompt` over whatever was typed
there.
- Other agents in the same class are left as they are and named here.
Devin, agy and Grok have recognizers that report no typed cells.
Recording a typed box for them needs the owner's sign-ins (as #3775
noted). OpenCode, Droid, Cursor, Amp and the others have no recorded
box.

## Change

- `shared/input-row.ts`: a draft-only recognizer for omp 18.14. It finds
the `π > … ▶` status line, then the editor right under it: `╰─ ` and the
rows a draft runs onto, indented three columns. It reports the editor's
cells. The empty editor's `⇧⇥ to change thinking effort` hint is drawn
in colours typed text never takes, so it is no draft. omp joins
`REPORTS_TYPED`, with its typed colour `5;254` (default theme) in
`TYPED_COLOURS`. A screen in 18.8.7's framed layout still goes to
`ompInputRow`, which reports no cells, so such a send goes out as
before.
- The terminal peek is unchanged: it still reads omp with `ompInputRow`.
The new recordings show it reading 18.14 screens as `gone`; that peek
gap is a separate follow-up.
-
`src/lib/fixtures-input-rows/omp/draft-{empty,typed,lines,slash}-119.ansi`:
recorded omp 18.14.0 screens, with a README section.
- Tests whose herdr mocks did not expect the box read before an omp send
now get an empty screen (`omp-submit`, `outcome-delivery`), as #3732 did
for Codex and pi.

Like every other agent's check, this refuses only on positive evidence.
Typed text in a theme colour that was not recorded is still sent over,
as on `main` (stated in the changelog). The race between the read and
herdr's paste stays, as for Claude Code.

## Validation

- Reproduced on `origin/main` (79420d0):
`server/core/agent-input-send.test.ts` with omp's recorded typed,
two-line and `/mo` drafts, before the fix: all three sends went through
`agent.prompt`.
- Live, against a real omp 18.14.0 in an isolated herdr session (`herdr
--session ocb-rec`, scratch HOME, no sign-in), through
`createSubmitText` on the real herdr socket. On `main`, a send over
`leftover draft` was sent, and the box was empty afterwards (joined and
submitted). On this branch it was refused with `input_draft`, the box
still read `╰─ leftover draft`, and with the box cleared the next send
went through.
- `bun test server/core/agent-input-send.test.ts
src/lib/inputRow.test.ts server/core/omo-pane-send.test.ts
server/core/codex-own-screen-send.test.ts server/core/omp-submit.test.ts
server/core/outcome-delivery.test.ts`: all pass.
- `bun run check run bun test --timeout 15000
./server/submit.contract.test.ts ./server/pending-input.contract.test.ts
./server/omp.contract.test.ts`: 249 pass, 0 fail.
- `bun run check fast`: workflow syntax, types, themes, typecheck and
build ok. Unit: 17249 pass, 1 fail. The failure is
`server/machine-core-choice.test.ts`, which fails on its own run after
run (17, 2 and 17 failures in three runs) and also fails on a checkout
without this change (2 fail). It does not import anything changed here.
- Skipped: browser regressions (no component changed), and a live omp
run with a signed-in model and a custom theme.



## Follow-up (merge pass review of 360bce0)

- A draft whose first editor row is empty and whose next row is indented
past omp's three columns, or with an empty row between two of its rows,
was missed and the send joined it. The editor's rows are now read while
they are indented three columns or blank, up to the last indented one.
- A draft that is exactly the hint's words (`⇧⇥ to change thinking
effort`) read as empty. The hint is no longer stripped by its text: its
cells are reported, and `typedDraft`'s colour test tells it from typed
words, as for every other agent.
- `src/lib/inputRow.test.ts`: all three cases, built from the recorded
screens; the first fails at 360bce0. The recorded empty box still reads
as no draft, and `/mo` still as one.
- `bun run check fast`: all ok (unit 17251 pass / 0 fail / 54 skip).
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.

1 participant