lazymartha as the one-stop TUI: martha-engine members over ACP, no kitty or tmux (design + spike) #6
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Raf, 2026-12-02: "the UX is not great at all. How difficult would it be to port martha-engine into lazymartha, get rid of the dependency on kitty/tmux and make lazymartha into a one-stop TUI?"
DECIDED 2026-12-02 "yes, have uranus write the lazymartha design"
Purpose (design): a design Raf can rule on for making lazymartha the one-stop TUI: it starts each martha-engine member as a child process, drives it over ACP on stdio, and needs neither kitty nor tmux. A throwaway spike proves that one member's turn, including a permission ask, works inside lazymartha.
The design is an issue comment on this issue. It supersedes DECIDED 2026-11-20 "let's go tmux" once Raf rules on it.
Done when
crates/goose-cli/src/cli.rs, martha-engine#24).src/open_the_crew_in_tmux,src/open_the_crew_in_kitty) and whatmartha uphands to lazymartha instead. It names DECIDED 2026-11-20 "let's go tmux" as superseded.Design: lazymartha as the one-stop TUI (r=1)
Uranus, 2026-12-02. DECIDED 2026-12-02 "yes, have uranus write the lazymartha design".
Short answer to Raf's question. Getting rid of kitty and tmux is a moderate job: about 6 packages, the biggest L. Porting martha-engine into lazymartha is not needed and is not proposed (§4). The engine already speaks ACP on stdio, and Martha already drives it that way. lazymartha becomes the screen in front of that, and the spike below shows one member's turn and permission ask working in a Go TUI.
This supersedes DECIDED 2026-11-20 "let's go tmux" (
martha/src/open_the_crew_in_tmux/open_the_crew_in_tmux.ts:7) once Raf rules on it. What that decision bought, and what this design gives up, is in §2.1. The shape
martha/src/speak_acp_to_an_agent/the_acp_client.ts:1-21). The gate, the owner's rules and the dashboard rows all live in that client (hear_an_acp_agents_asks/hear_an_acp_agents_asks.ts:1-12). If lazymartha drove the engine directly, it would need a second gate in Go, and the two would drift. Somartha start <member>gains--acp: instead of drawing its own line chat (talk_with_an_engine_member/the_chat_at_the_tab.ts:1-6), it serves ACP on its own stdio and relays the engine's turns up.session/request_permission. lazymartha shows every member's asks in one queue, oldest first, with the member's name and the call'skind(engine#24 setsexecute/edit/readper tool,crates/goose/src/acp/server/tool_calls/conversion.rs).martha answerkeeps working beside it (serve_the_owners_answers/martha_answer.ts).martha startper member, and stdio is the transport. Nothing else is needed: no kitty, no tmux, no socket.martha crewreads (dashboard_rows_directory/dashboard_rows_directory.ts:1-11), so "needs you", "offline" and the spend carry over.lazymartha/README.md).2. What leaves martha, and what
martha updoes insteadsrc/open_the_crew_in_tmux(1,119 lines with its tests) andsrc/open_the_crew_in_kitty(594 lines). Their callers change too:martha attach,martha down, the kitten title, and the KITTY constant's importers.martha upchecks the declaration and starts the engine endpoint as today (run_the_martha_command/run_the_martha_command.ts:451-459). Its last line now execslazymartha crew --root <root>instead of choosing between tmux and kitty (:460). lazymartha reads the rostermartha upwrites and starts onemartha startper member.open_the_crew_in_tmux.ts:6-7). With members as lazymartha's children, closing lazymartha ends the crew: a turn in flight is cancelled. On the nextmartha up, each engine member resumes its session withsession/load(the engine hasloadSession), and a Claude Code member with its own resume. If Raf wants the crew to outlive the window, that is one more package, a small supervisor that owns the members, which lazymartha attaches to over a socket. It is not in the list below.3. Claude Code members: (a) ACP adapter or (b) a terminal in a pane
@agentclientprotocol/claude-agent-acp(was Zed's claude-code-acp; v0.114.0 1 Dec 2026, Apache-2.0, on the Claude Agent SDK) as a child speaking ACPclaudeCLI, started bymartha start <member>exactly as today, in a pty rendered by a Go terminal emulator (charmbracelet/x/vt)claude_code_host,claude_code_relay,hear_the_hosts_dialogs, 2,821 lines), and its gate is a hook. Moving to ACP permissions means a second Claude Code path. Plus a Node ≥22 runtime, or the adapter's bundled binary.martha crewdoes today./login,/clearand/cost. Whether it loads hooks, plugins, settings.json rules and CLAUDE.md is unconfirmed, and the crew's own mod is a Claude Code plugin with hooks. It releases about twice a week.CLAUDE_CODE_DISABLE_ALTERNATE_SCREEN,CLAUDE_CODE_DISABLE_MOUSE). Whether x/vt handles DEC 2026 is unconfirmed.Recommendation: (b) now. It changes nothing in martha's Claude Code path, and it keeps every hook and plugin the crew depends on. Its risk, rendering quality, sits in one pane and is visible at once. (a) is worth a second look only once its loading of hooks and settings is confirmed. It is not in the package list.
4. Why the engine is not ported to Go
martha-engine is a goose fork of 315,471 lines of Rust under
crates/:goose188,472, provider types and providers 53,377,goose-cli25,842, the agent kit 18,842. That leaves out the 214,076-line UI, which lazymartha would not need anyway. A Go port means rewriting the agent loop, its 37 providers (files withimpl ProviderDef), MCP and the extensions, and then losing every upstream fix the fork takes from goose. It buys nothing the protocol does not already give. ACP is the boundary the engine and Martha already use, and the Go side of it is small: the spike's whole ACP client is 140 lines.5. Packages, in order
martha start <engine member> --acp: serve ACP upward on stdio, relay turns and updates, send the owner's asks up assession/request_permission; gate, rules and rows unchangedmartha start --acpper engine member from the roster; member panes (stream, tool calls, prompt line); one permission queue;session/loadon restartmartha start <member>; keys, resize, "needs you" from the rowmartha upexecslazymartha crew; pin the new lazymartha (fetch_the_pinned_lazymartha); docsattach,down, the KITTY importers)Package 6 lands only after 2-5 have run a real crew. Until then,
martha upkeeps tmux as the fallback.6. Spike (throwaway, never merged)
Branch
uranus/6-acp-spikeat384f40403e566426e78286dcc6ab6b6cecfddf71,spike/acp/(444 lines of Go).Result: one martha-engine member's turn runs in a bubbletea TUI over ACP on stdio, and its permission ask is answered in the TUI. No kitty, no tmux.
martha-engine acpin a freshGOOSE_PATH_ROOT. Its config is the one Martha writes for a member:approvemode,developerthe only extension, telemetry off.developer__shellcall, then quotes the tool's answer back. Nothing left the box and nothing was paid.[a] allow once: the tool call is shown, the ask appears, the owner allows it, the shell runs, and the model receives"hello-from-lazymartha-spike", the command's real output. The turn ends withend_turn.[r] reject once: the shell does not run, and the model receives the engine's refusal ("The user has declined to run this tool…"). The turn ends withend_turn.Found:
crates/goose/src/acp/server.rs:1543-1576). Martha answers with once-answers only (speak_acp_to_an_agent/answer_a_permission_once.ts), and lazymartha's queue offers the same two.kindisother. engine#24 (in 1.61.0, the version Martha's recording pins) makes a shell callexecute.crates/). A client can declare neither, as Martha does.r=2: the crew room (Jupiter's F1), appended
§1's "crew strip" is the dashboard rows (needs you, offline, spend). It is not the crew room. This section adds the room.
martha. It never reads the mesh itself. For the same reason the asks go through Martha, the room's text reaches the screen only through the room's gate:readRoomThroughItsGate(martha/src/read_a_room_through_its_gate/read_a_room_through_its_gate.ts:200-215) keeps only what the room's delivery gate admits, and that gate isadmit_a_room_message's six questions: an attested sender, on the room's roster, addressed to this session (admit_a_room_message/admit_a_room_message.ts:1-15).martha room --followstreams the admitted messages as JSON lines on its stdout, read with the owner as the session, and reports how many it withheld. lazymartha runs it as one more child and draws it as a room pane. A line the owner types there goes back to the same child, which sends it withsend_a_crew_message(the path a member's message takes today).Packages, changed (the rest of §5 stands):
martha answerand lazymartha's queue both reach the same ask. The first answer settles it, and the other view drops the ask at once, so the owner never answers a stale one.martha room --follow; read admitted lines, send typed ones), and the martha.json editor tabmartha room --follow: the crew room for the owner, throughreadRoomThroughItsGateandsend_a_crew_message, as JSON lines on stdio; the owner's place on the roster settled firstNew order: 1, 2, 3, 4a, 4, 5, 6.
Appended after the r=2 PASS (Jupiter's note): gate question 5 admits only messages addressed to this session by node id. Without a wider gate, the owner's room pane shows only lines addressed to the owner, not members talking to each other. Whether Raf may watch the whole room is a gate decision for him, and package 4a says which of the two it shows.
martha upopens the crew screen, the new lazymartha pin, and the docs #367