Merge pull request #670: fix(input): keep the line breaks of a multi-line mux prompt, pasted as one block

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Codeman maintainer committed 2026-10-22 19:23:17 +02:00
commit b67018b318
39 files changed
+618 -135

No files matched your search

+3 -2
View File
@@ -420,8 +420,9 @@ callers send no body at all.
**or Enter is never sent**: the text is typed onto the worker's prompt and sits
there unsubmitted. This is [symptom 1](#1-deliveredtrue-then-every-wait-times-out),
the number-one silent failure.
- `input` must be single-line (newlines are stripped). To send a bare Enter (confirm
a dialog), send `{"input":"\r"}`.
- With `useMux`, newlines in `input` are kept: the text goes in as one bracketed paste
and the `\r` submits all lines (without `useMux`, multi-line input is written straight
into the pane). To send a bare Enter (confirm a dialog), send `{"input":"\r"}`.
- `input` is capped at **65536** characters. ⚠️ **Two caps disagree and the smaller one
is the real one**: the Zod schema allows 100000 (`schemas.ts:1035`), so a 65537-to-100000
character body passes validation and *then* 400s at the route against
+1 -1
View File
@@ -21,7 +21,7 @@ by sourcing the preamble file the §0 bootstrap wrote, and checking its version
```bash
. "${XDG_CACHE_HOME:-$HOME/.cache}/codeman-agent-$CODEMAN_SESSION_ID.sh" 2>/dev/null
[ "${CODEMAN_PREAMBLE:-}" = 1.42.0 ] || { echo "preamble missing or stale; re-run the §0 bootstrap"; exit 1; }
[ "${CODEMAN_PREAMBLE:-}" = 1.43.1 ] || { echo "preamble missing or stale; re-run the §0 bootstrap"; exit 1; }
```
Do **not** re-paste the preamble body into each call. Sourcing it is what retires the
+18 -11
View File
@@ -304,10 +304,16 @@ duplicate resend costs nothing.
Codeman types the text and sends Enter **only when the input contains a carriage
return**; without it your command sits unsubmitted on the worker's prompt and
everything downstream times out. No response field catches this: `delivered:true`
means "written to the pane", **not** "submitted". Newlines are stripped, so input is
single-line by construction. Build the body with `jq -n` for any prompt you did not
author as a literal, because the inline `-d '{"input":"'"$P"'\r"}'` pattern breaks on
the first double quote, backslash or `$` in a real prompt:
means "written to the pane", **not** "submitted". With `useMux`, newlines are kept: the
text goes in as one paste, and the `\r` submits all of it. **`sendwait` sends one line,
though:** its Enter loop and the server's submit check cannot reliably recognise a
multi-line paste, so a multi-line prompt to a freshly spawned worker could sit unsent in
Claude Code's Enter-ignore window. `sendwait` therefore joins the lines with a space,
which loses their layout; put long multi-line content in a file
([§5.9](#59-big-input-via-the-workspace)). Build the body with `jq -n`
for any prompt you did not author as a literal, because the inline
`-d '{"input":"'"$P"'\r"}'` pattern breaks on the first double quote, backslash or `$`
in a real prompt:
```bash
BODY=$(jq -n --arg p "$PROMPT" '{input:($p+"\r"),useMux:true,clientId:"agent-1",seq:1,wait:true,waitTimeout:60000}')
@@ -588,9 +594,10 @@ allowlist in §4.
### 5.9 Big input via the workspace
The composer is a single line capped at 65536 characters with newlines stripped, which
makes it a bad channel for a spec, a diff or a file list. The workspace is the good
one, and for a local or docker case you are on the same filesystem as the worker.
The composer is capped at 65536 characters, and a multi-line paste cannot be confirmed
as submitted, which makes it a bad channel for a spec, a diff or a file list. The
workspace is the good one, and for a local or docker case you are on the same
filesystem as the worker.
1. Write `TASK.md` into the worker's workspace with your own file tools. The path is
`.data.casePath` from `quick-start`, or the `workingDir` you passed to
@@ -600,10 +607,10 @@ one, and for a local or docker case you are on the same filesystem as the worker
3. Wait on `DONE_<token>` with `wait-output` ([§5.5](#55-markers-for-hook-less-workers)),
then read `RESULT.json` back with your own tools.
This sidesteps the byte cap, the newline stripping and the quoting hazards in one
move, and it makes the marker **split by construction**: the token lives in the file,
never in the line you type, so the echo of your own keystrokes cannot match it. The
worker also gets to re-read the task instead of holding it in one echoed line.
This sidesteps the byte cap, the unconfirmed multi-line paste and the quoting hazards
in one move, and it makes the marker **split by construction**: the token lives in the
file, never in the line you type, so the echo of your own keystrokes cannot match it.
The worker also gets to re-read the task instead of holding it in one echoed line.
⚠️ Two places it does not work: a **remote-SSH case** runs on another host whose
filesystem you cannot see, and any worker **currently editing** the directory you are