v1.4.0
Fixed
-
Daemon no longer throws
TypeError: The database connection is not openon shutdown. An un-awaited runner turn (e.g. the echo runner's async reply stream) could emit astate/messageevent afterclose()had closed the SQLite store, hittingstore.updateSessionon a dead connection.close()now latches aclosedflag that makes the per-session emitter drop late events instead of touching the store or dead sockets (#176). -
mewrite agents: a hosted session that aborted a stalled turn for auto-retry (e.g. "Model stream idle for 120000ms") no longer stays stuck showingerrorafter the retry succeeds. The daemon runner treated the pre-retryagent_end(error)as terminal and latched, so the later successfulagent_end(stop)couldn't clear it. Onauto_retry_startthe runner now undoes the premature terminal state and returns the session torunning, so the final state reflects the retry's outcome (#158). -
Fixed daemon double-spawn race in
mewrite serve: two concurrentmewrite serveprocesses could both pass the pidfile existence check and race to bind the port (TOCTOU). Now the pidfile is acquired atomically with O_EXCL before starting the daemon; if another daemon holds a live pidfile, the second caller exits 0 (not 1) so auto-start workflows treat peer ownership as success. Stale pidfiles (dead process) are reclaimed automatically. Belt-and-suspenders: if two processes somehow pass the pidfile lock but one loses the port bind (EADDRINUSE), it releases its pidfile and exits 0 (#167). -
System prompt: core safety sections (instruction precedence, durable-memory/data boundaries, executing-with-care) are now always-on. Previously the
slimbuild flag and thecustomPromptpath both silently dropped every non-overridable safety section, producing an agent with no durable-memory or destructive-action consent gate while still ingesting untrusted project context. They are now injected in every build path via a sharedCORE_SAFETY_SECTIONSblock. -
System prompt: the
customPromptpath now routes appended text throughbuildAppendOnlySection(the "earlier system sections win" framing) instead of a raw concatenation. -
System prompt: injected project-context files (AGENTS.md/CLAUDE.md) now carry a precedence banner clarifying that project instructions cannot override the safety sections and grant durable-capture consent only when they name a destination and scope.
-
Git status snapshot no longer renders a failed or oversized
git statusas "(clean)"; it now reports the status as unavailable.
Changed
- New brand logo: a pencil (code shaft) with "Me Write Code / me write less, me do more" to its right, replacing the ASCII wordmark. Shown on interactive startup and on the
mewrite agentslaunch screen (shared renderer). Terminal-safe box-drawing, no image component (#185). mewrite agentsis now a single full-screen status-grouped list instead of a sidebar + side-by-side focus pane. On launch the screen is wiped and a pencil logo with "Me Write Code / me write less, me do more" is shown above the list. Agents are grouped underWORKING/ERRORED/COMPLETEDheaders (attention order), and selecting one opens it full-screen (ctrl+w/ enter to focus, back to return) rather than in a split. This is Phase A of the agents view v2 redesign toward a local process-registry model (#185).mewrite agentsfocus pane now supports two steering controls from interactive mode:shift+tab(app.thinking.cycle) cycles the remote session's thinking level via the daemonset_thinkingRPC — the status-line thinking level updates on the echoedusage— andctrl+o(app.tools.expand) toggles tool activity between the compact one-liner and an expanded card showing the tool's args and result/error. Tool start/end are correlated into a single card by tool-call id. Both reuse the existing configurable keybindings (#175).mewrite agentssidebar navigation now wraps: pressing up on the top agent selects the bottom one (and down on the bottom wraps to the top), so you can jump to the far end of the list in one keypress. Page up/down still clamp at the ends (#152).
Removed
- Dropped references to a non-existent
exploresubagent from the system prompt and thetask/agenttool descriptions.
Added
-
mewrite agents: while monitoring a running agent you can now steer it (presssto type a redirect) or interrupt it (pressx), so you can catch an agent working on the wrong thing before it finishes. Steering messages are delivered over a per-agent inbox file; the agent's own process injects them into its steering queue at the next turn boundary (mid-run) or as a fresh prompt (when idle). Interrupt signals the agent process. Configurable viaapp.agents.steer/app.agents.interrupt. Agents view v2 Phase C+ (#185). -
mewrite agents: selecting aWORKINGagent now opens a read-only live monitor that tails its transcript, so you can watch a running agent without interrupting it (another process owns its live turn). Idle/completed/errored interactive agents still resume in place. Agents view v2 Phase C (#185). -
mewrite agentsnow spawns new agents as independent, detachedmewriteprocesses instead of routing through the daemon (agents view v2, Phase B2). Pressn, type a task, and the agent starts working in the current directory and keeps running after you close the view; it shows up in the list via the liveness registry and is resumable. Output is logged under~/.mewrite/agent/agent-logs/. The daemon is no longer required for the local agents workflow (and is never auto-started); it is used only to surface any daemon-hosted[d]sessions that happen to be running. Removed the daemon auto-start/ensureDaemonpath from the agents view (#185). -
mewrite agents: selecting a live interactive[i]session now resumes it as a real full interactivemewritesession in place (replace-and-return) instead of opening a read-only transcript pane. The list is torn down,mewrite --session <path>runs attached to your terminal with the complete interactive UI (editor, footer, meter, tools, thinking), and quitting returns to the agents list. This is Phase B (resume-on-select) of the agents view v2 redesign; detached resumable spawning and retiring the daemon from the local path follow (#185). -
mewrite agentsfocus pane now shows a context-usage meter in its status line: a progress bar███░░░ 20% 40k(percent of context window + tokens used) plus the thinking level next to the model id, matching the interactive context meter. Fed by the daemonusagenotification (see #176), so it live-updates on each turn. Attaching to an idle session that already ran a turn now re-requests a usage snapshot on connect, so its meter is populated immediately instead of blank until the next turn. A session that has never run a turn (usage genuinely unknown) shows just the model id, and post-compaction it renders?for unknown token counts (#173). -
Daemon WS protocol now streams richer per-turn events so a focus-pane client can reach parity with interactive mode. Tool events carry
toolCallId,args(on start), andresult/isError(on end) correlated across start/end; a newusagenotification streams context tokens, context window, percent, and thinking level on turn boundaries;statecarries astopReason(stop|max_tokens|error|aborted) on the terminal state; and a newset_thinkingRPC steers a running session's thinking level (echoed back as ausageevent). All additions are optional fields / new methods, so the bundled web-ui and the attach REPL keep working unchanged. Oversized tool args/results are truncated over the wire (16 KiB cap).HealthCapabilities.richEventsadvertises support for feature detection (truefor the agent runner) (#176). -
Added
mewrite history: a standalone TUI to browse and resume persisted local JSONL sessions. Select a session and press enter to see the exactmewrite --session <path>command to copy and run. This is separate from the live daemon monitor (mewrite agents) and frommewrite sessions(which lists daemon-hosted sessions via the client). Read-only: no delete or rename, just browse and get the resume command (#159). -
Enhanced debug logging (
MEWRITE_AGENTS_DEBUG) with automatic log rotation (50 MiB cap, keeps one.1backup), category filtering (log only specific tags likerunner,daemon), and support for custom log paths viatag=pathsyntax. Prevents disk-fill from flapping sockets while remaining zero-cost when disabled (#168). -
The
mewrite agentsfocus pane is now live and interactive for hosted sessions: it streams the agent's response as markdown and gives you an input box to talk to the agent in place — no more dropping to a separate attach REPL.ctrl+wfocuses the pane, type and press enter to send,escapeinterrupts a running turn or (when the input is empty) returns focus to the sidebar. Interactive[i]terminal sessions remain read-only (#158). -
mewrite agentsis now a two-pane view: a sidebar of agents on the left and a focus pane on the right showing the selected session's transcript (live-tailing).ctrl+wswitches focus between the panes;!jumps the sidebar to the first agent needing attention (errored sessions are flagged with a!). Below 80 columns it falls back to a single pane. Selecting a hosted[d]row still opens the attach REPL for now; a live, in-pane interactive session is the next step. Configurable viaapp.agents.switchPaneandapp.agents.attention(#158). -
mewrite agentscan now spawn new agents from the view: pressn, type a task, and an agent starts working in the current directory with your default model. The daemon is auto-started transparently on first use (loopback, agent runner) so you never runmewrite serveyourself; spawned agents persist and keep running after you close the view. You can change a session's working directory or model from inside it later. Configurable via theapp.agents.newkeybinding (#158). -
mewrite attachnow prints the existing transcript on connect (so attaching to a session isn't a blank screen) and frames the live stream by role:you/agentheaders on turn transitions, dim tool-activity lines, and clear separation from the input prompt. Previously it dumped raw assistant tokens onto the prompt with no history (#158). -
mewrite agentscan now delete a session: select a hosted[d]row and pressdto remove it after a confirmation prompt (defaults to No). Configurable via theapp.agents.deletekeybinding. Live interactive[i]sessions are not deletable from here (they have no daemon record) (#158). -
mewrite agentsnow hides stale idle sessions by default so the list isn't cluttered by old finished agents. Running, errored, and live interactive sessions always show, as do idle sessions active within the last 24h; older idle sessions are hidden with a(+N)hint. Pressato toggle showing all. Configurable via theapp.agents.toggleAllkeybinding (#158). -
Added
mewrite agents: a standalone interactive view that lists running daemon agents (sessions) with live state, without a terminal multiplexer. Select an agent and press enter to attach; detaching returns to the list. Read-only monitor for now (an in-pane transcript/detail view is a planned fast-follow) (#152). -
mewrite agentsnow shows a unified list of both daemon-hosted sessions and live interactivemewritesessions, each tagged by kind ([d]hosted,[i]interactive). Interactive sessions self-publish a tiny liveness file (id, pid, cwd, state) under~/.mewrite/agent/live; the list reaps dead or stale entries and needs no daemon. SetMEWRITE_NO_LIVEto opt an interactive session out of publishing (#152). -
mewrite agentsnow has a read-only transcript view: select an interactive[i]session and press enter to see its conversation, scroll with arrows, andesc/qto return to the list. Messages render as markdown (user turns get the accent left-bar, matching interactive mode) and the pane live-tails — new turns from a running session scroll into view while you stay pinned to the bottom, unless you scroll up. Interactive transcripts are read from the local session JSONL (no daemon); hosted[d]sessions still hand off to the attach REPL (#157, #161). -
Added turn-end reason diagnostics so mid-task stalls are diagnosable. Each turn now records why it ended (
tool_batch_await,end_turn,max_tokens,error,aborted, orpause) to~/.mewrite/agent/diagnostics/current/turns.jsonl(gated by the existing local-logging setting, same redaction and retention as other diagnostics). View the last N withmewrite diagnostics turns [--limit N]; the records are also included inmewrite diagnostics export(#154).
Fixed
- Fixed
mewrite agentsnot returning to the list onqfrom the transcript view, and leaving the transcript in the terminal scrollback after going back.qnow maps to the configurableapp.agents.backbinding (defaultescape/q) in both the list and transcript views, and leaving the transcript wipes the screen so the list redraws clean (#157). - Fixed the agent yielding its turn mid-task during long multi-step work — narrating progress or asking for reassurance instead of continuing an already-approved plan, which read as the agent "pausing" and required repeated "continue" prompts. The system prompt now instructs the agent to keep working through an approved plan across turns and to only end its turn for a genuinely blocking decision, a destructive/irreversible action needing consent, or task completion (#154).