fix(omp): drop omp's inline suggestion from the draft the send guard verifies - #128
Merged
Merged
Conversation
…verifies omp paints an inline completion after the operator's text, inside the composer, in its own foreground colour. It is not in the input buffer, but extractInputDraft returned it, and draftCarriesSend requires the visible draft to be CONTAINED in what was typed — so every send omp suggested for stalled with "Message didn't reach the input box" while the message really was sitting in the box, and each retry re-suggested and re-stalled. composerGhost (omp/markers.ts) claims the trailing run of COLOURED segments that follows unstyled text on the bottom border — the row the caret is on. The rule is relative: no colour literal, nothing measured, and nothing claimed on a row with no unstyled text of its own, because a wrongly-claimed ghost would shorten the draft the guard checks. Evidence: live sandbox omp pane, 2026-08-23. The fixture omp--draft-ghost-suggestion.txt is derived from omp--draft-single.txt, width-preserving. (cherry picked from commit a6dcdcf8fbe7a5d6e82c6e98760c58ae4d3c0d2c)
AltanS
added a commit
that referenced
this pull request
Aug 24, 2026
fix(omp): drop omp's inline suggestion from the draft the send guard verifies
Owner
|
Merged — thank you, this is a model diagnosis. The relative no-colour-literal rule and both fail-closed refusals are exactly right, and the containment failure chain in the description made review trivial. I rebased onto today's codex/grok adapter merges on our side (one comment-paragraph conflict) — your fixture now also runs foreign against those two corpora automatically. Gates after the rebase: root 687, web 3429, typechecks clean. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What breaks today
On an omp pane, a reply can stall with "Message didn't reach the input box" while the message really
is sitting in the box. Every retry types it again and stalls again.
omp paints an inline completion suggestion after the operator's text, inside the composer, in its own
foreground colour. It is not in the input buffer, and no Backspace deletes it. It is on the row the
send guard reads back. Live capture (omp v17.2.12), after typing
leftover draft here:The chain:
harness/omp/chrome.ts→extractInputDraftreturnsleftover draft here's.reply-action.ts→draftCarriesSendrequires the visible draft to be contained in what wastyped.
'sis not, so the claim fails.adapter answered a screen question wrongly.
This fires on ordinary prose, on anything omp offers a completion for. On this host it hit most
sends.
The fix
composerGhost(harness/omp/markers.ts) claims the trailing run of coloured segments that followsunstyled text on the composer's bottom border, the row the caret is on.
extractInputDraftsubtractsthat run before it returns the draft.
The rule is relative, like the rest of this adapter:
unstyled. omp's suggestion is the styled tail after it. Themes and truecolor palettes stay free to
change.
because it could be a themed draft.
shorten the draft the guard checks, which is the unsafe direction.
This also fixes the stranded-draft chip and "Take over". Both used to copy the suggestion into the
phone composer as if the operator had typed it.
Evidence
pane.send_textandpane.readdirectly. Before the patch,
draftCarriesSend → falseon two separate ghost captures. After it,true.omp--draft-ghost-suggestion.txt, derived fromomp--draft-single.txt. The SGR run andsix ghost cells were spliced in and six padding cells taken out. The row still measures 189 display
cells and keeps its 28 rows, its LF endings and every other byte. It is registered in the corpus
lists and the fixture README, and the census sentences that count captures were updated with it.
composerGhostcases inomp/markers.test.ts, the fixture's draft inomp/chrome.test.ts, and an end-to-endsendGuardedReplycase inreply-action.test.tson an omppane whose composer shows a suggestion. Both new behavioural assertions fail without the patch. I
checked that by reverting the strip.
and omp starts working on it.
web: harness and reply suites pass,tscclean. Rootbun run test: 688 pass.Notes for the maintainer
No version bump and no CHANGELOG entry, per CLAUDE.md's fork rule. A line for the release, if you
want one: