Land martha#315 (engine chat) #316

Manually merged
terra merged 0 commits from terra/land-315 into main 2026-11-30 18:25:11 +00:00
Member

Land branch built by crew_land_batch on main ef34cd60: #315 neptunus/309-engine-chat 13e6ac9d (PASS r=1, Saturnus). Tip 256f3261. Lands by fast-forward on Mars's LAND.

Land branch built by crew_land_batch on main ef34cd60: #315 neptunus/309-engine-chat 13e6ac9d (PASS r=1, Saturnus). Tip 256f3261. Lands by fast-forward on Mars's LAND.
A line typed at a martha-engine member's tab is a turn of that member's own
session, recorded on A14 as owner_typed; the member's answer streams below it as
it is written, each tool it runs on a line of its own, and the line being typed
stays at the bottom so the next thing can be queued before the answer ends.
/crew and /crew-refresh are still answered by the launcher, and every other
slash command is refused. Ctrl-C stops the running turn; Ctrl-D on an empty line
leaves and stops the member.

The ACP client offers every update to the launch's chat before its own record
reads it, and the turn queue tells the chat when a turn is queued, started and
done. The old "typed turns are not there yet" refusal is gone.

Drops-test: src/start_an_engine_member/the_owners_lines_at_the_tab.node-test.ts :: #927 part 2: a plain line is refused in one line naming /crew and martha#953, and the launcher is asked nothing
Drops-test: src/start_an_engine_member/start_an_engine_member.node-test.ts :: #927 part 2: the owner's lines are told what they get one at a time, in the order typed, and a line whose answer throws does not stop the next
Drops-test: src/start_an_engine_member/start_an_engine_member.node-test.ts :: #927 part 2 DW3, DW4, DW6: at a running engine member's tab, /crew shows the crew and says to a mate, other lines are refused, and the engine is sent no prompt for any of them
The chat hears each ask as it opens and shows the member, the permission, the
key and the exact `martha answer ... allow|reject` line; a listener that throws
does not take the ask with it. `martha start` no longer writes
`<member> started, pid ...` over the chat's own input line: a start whose tab is
a chat already says the member is up and prints no second line.
A call waiting on the owner no longer sends them to another terminal for
`martha answer`: the chat says `permission for <tool> — type /allow or /reject`,
and the answer there writes the same owner_answers.jsonl record `martha answer`
writes before it is applied. One whose record cannot be written is not applied;
one with nothing waiting says so.
A crew that declares a mesh starts the recorded mesh server; its tools are the
crew's own infrastructure, so they now run unasked by their whole engine names,
as the crew's own tools do. The owner's deny and ask rules still hold them,
under the engine's name or `mcp__macula__<tool>`; a launch with no mesh server
hands no such rule, so a tool of a server it never started is still asked.
The chat now prints the command a waiting shell call would run (or the title of
another tool), so the owner decides on what it does, not on a truncated tool
title. While a call waits, `a`/`allow`/`y`/`yes` and `r`/`reject`/`n`/`no`
answer it as the full `/allow`/`/reject` commands do; with nothing waiting they
are ordinary lines for the member.
The ACP client now advertises the engine's status and label notifications, so
the chat prints the engine's notices and progress, the full command of a tool
call, and a check with the first line of its result. `A` (or `/allow-always`)
answers a waiting call and remembers that exact call for the rest of the launch,
with the same owner_answers record as `/allow`; the owner's settings file is
still what outlives it.

Drops-test: src/speak_acp_to_an_agent/the_acp_client.node-test.ts :: the client declares no file or terminal capability, so the agent asks for neither
The chat's opening line now says /help lists the controls instead of naming
three of them, and `/help` prints the whole set in the owner's words: sending a
line, /crew and /crew-refresh, answering a waiting call (a, r, A and their full
commands), Ctrl-C and Ctrl-D, detaching tmux with `martha attach` to come back,
and `martha stop` for the member or the crew. `/quit` (or `/exit`) leaves and
stops the member, as Ctrl-D does.

Two other lines say where that help is: `martha up` ends by pointing at it in a
member's tab, and `martha help` says it in the `attach` line, beside the command
that takes you there.
The chat reads each line of the member's answer as the markdown the engine
writes: bold, italic, inline code and links are drawn with their markers gone,
headings and bullets are set as the text they mark, a fenced block is indented
under a gutter, and a table is laid out to fit the pane. A line too long for
the pane wraps under the one before, two blank lines are shown as one, and a
table is held until its block ends so its columns are sized once. The raw text
is what the session's record keeps; the styling is added after the text has
been made safe, and every styled run closes its own codes.

A tool is now one line when it ends — what ran, the command when there is one,
and the first line of what it returned, with a check or a cross — instead of a
line when it begins and a bare check later; the tool still running is named on
the live line above the owner's own. The engine sends most tool results as
content blocks, which the chat now reads as the result too, so a check has
something to say. Enter on an empty line is no longer sent as a turn.

The chat is handed the launcher's words for `/crew` and `/crew-refresh`, so its
help names them without the slice importing the host.
A tool's result that the engine sends as JSON is shown as the one thing it says
in a line — a header, a message, or the names it lists — instead of the JSON
itself, and a result too long for the line is cut at a word rather than in the
middle of a token. A command still running is named by its start, so the owner
reads what it is doing rather than the end of its arguments.
A tool that worked is no longer written into the conversation: the live line
names the one running, a failure is shown where it happens with what it was and
why, and /tools lists this launch's tools with the first line each returned. The
engine's progress notices are not the owner's line to read either.

A line typed while a permission waits now says it is held until the answer, so
it cannot vanish into a queue the owner cannot see.
The fake engine appends a request as JSON and the helper reads the file while
the launch is writing it, so a line that is still half-written broke the parse
and the test by timing alone. Only lines that end are read; a partial last line
is not a request yet.
A read that ended partway through ESC[201~ left the marker's first bytes in
the paste and looked for the marker only in the next read, so it was never
seen: the tab took every later key as pasted text, Ctrl-C and Ctrl-D included
(Saturnus's review of owner/953-chat, B1). The marker is now looked for in the
whole paste so far. A test splits it at three places, and across a later read.

Refs #309
F3: a running tool's command or title was kept raw and drawn on the live line
and in /tools and a failure line, so an escape, an OSC or a carriage return in
it reached the owner's pane: a prompt-injected member could clear the screen
or paint a fake ask over the real one. The label is now made safe and one line
(a line end shown as ⏎) where it is first read.

B2: the stream cut and the markdown's wrap width ignored the `member> ` start,
so on 80 columns a `supervisor> ` row was wider than the pane, wrapped, and the
live region was miscounted. The cut now measures the row with its start, and
the markdown is given the pane less what the name takes beyond the
continuation, and one column.

B3: at the pane edge the whole line so far was cut, mid-word, and a bold or
code span it held open showed its markers. The edge now cuts at the last blank
outside a span; a line with none is cut whole as before, and a line Martha's
own text interrupts is still cut whole.

Each has a test that was red first (Saturnus's review of owner/953-chat).

Refs #309
Land martha-ai/martha#315 (PASS r=1)
All checks were successful
dependency advisories / node in . (container) (push) Has been skipped
dependency advisories / node in carry_marthas_own_node/try_a_single_executable (container) (push) Has been skipped
dependency advisories / node in installer (container) (push) Has been skipped
dependency advisories / node in installer (push) Successful in 15s
dependency advisories / node in . (push) Successful in 15s
dependency advisories / node in carry_marthas_own_node/try_a_single_executable (push) Successful in 16s
dependency advisories / advisories (push) Successful in 0s
c4 model / c4-model-1 (push) Successful in 8s
c4 model / c4-model (push) Successful in 0s
CI / links resolve, workflows are valid (push) Successful in 8s
CI / checks (push) Successful in 3m50s
standalone / standalone Martha runs alone (ubuntu-latest) (push) Successful in 58s
suite / the ring reaches the owner on the live run's tmux (push) Successful in 18s
heavy / installer (push) Successful in 3m56s
heavy / the relay loads in the recorded host (push) Successful in 15m42s
suite / gate coverage (push) Successful in 19m2s
heavy / the clean-install proof removes its container (push) Successful in 19m59s
256f326148
Collaborator

CI coordinator: round r=1: dispatched ci.yml on 256f326148, run 5976 (base ef34cd6016).

CI coordinator: round r=1: dispatched ci.yml on 256f326148ab3cf5cbe4cb365152b31cf58bad34, run 5976 (base ef34cd6016f28e0915e3227e57ff5391e8896f94).
Collaborator

CI coordinator: round r=1: dispatched suite.yml on 256f326148, run 5977 (base ef34cd6016).

CI coordinator: round r=1: dispatched suite.yml on 256f326148ab3cf5cbe4cb365152b31cf58bad34, run 5977 (base ef34cd6016f28e0915e3227e57ff5391e8896f94).
Collaborator

CI coordinator: round r=1: dispatched heavy.yml on 256f326148, run 5978 (base ef34cd6016).

CI coordinator: round r=1: dispatched heavy.yml on 256f326148ab3cf5cbe4cb365152b31cf58bad34, run 5978 (base ef34cd6016f28e0915e3227e57ff5391e8896f94).
Collaborator

CI coordinator: round r=1: dispatched c4-model.yml on 256f326148, run 5979 (base ef34cd6016).

CI coordinator: round r=1: dispatched c4-model.yml on 256f326148ab3cf5cbe4cb365152b31cf58bad34, run 5979 (base ef34cd6016f28e0915e3227e57ff5391e8896f94).
Collaborator

CI coordinator: round r=1: dispatched standalone.yml on 256f326148, run 5980 (base ef34cd6016).

CI coordinator: round r=1: dispatched standalone.yml on 256f326148ab3cf5cbe4cb365152b31cf58bad34, run 5980 (base ef34cd6016f28e0915e3227e57ff5391e8896f94).
terra manually merged commit 256f326148 into main 2026-11-30 18:25:11 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
martha-ai/martha!316
No description provided.