Skip to content

MatrixClaw 0.2.1

Choose a tag to compare

@github-actions github-actions released this 19 Oct 23:26
· 14 commits to main since this release

The native agent now works on large coding tasks by itself: it knows the
project, edits robustly, checks its own work, can be undone, splits work
across isolated subagents and keeps going on a goal until it is verifiably
done.

Coding agent

  • Coding runs (a working directory and tools) get an operating manual:
    autonomy, verification after changes, reading before editing, matching the
    code's style, git safety, todo discipline, prompt-injection caution. The
    manual names only the tools the run has; subagents get the same manual.
  • Project instructions: ~/.config/matrixclaw/AGENTS.md, then AGENTS.md
    (or CLAUDE.md) and .matrixclaw/instructions.md from the project top down
    to the working directory, 32 KiB at most. Runs also get the date, timezone,
    client, permission mode, OS and a git snapshot (branch, status, recent
    commits) in the context note.
  • read pages within a token budget, cuts very long lines and refuses binary
    files. edit/multiedit/write refuse a file the session has not read or
    that changed since; edits fall back from exact matching to indentation-,
    whitespace- and quote-tolerant matching with guards, report the closest
    lines on a miss, return a numbered snippet and write atomically.
  • apply_patch (Codex patch format, multi-file and all-or-nothing) replaces
    edit/multiedit for GPT and Codex models.
  • glob, grep and ls use one matcher (**/ matches zero directories,
    braces, classes) and follow .gitignore; grep gained case-insensitive,
    context, output modes and paging. A deny rule on a path no longer blocks a
    whole search; matches under it are left out.
  • bash results always state the exit code, keep the head and the tail of
    long output, and kill processes the command left behind. Commands, hooks,
    MCP stdio servers and language servers no longer inherit provider API keys.
  • Diagnostics after edits: gofmt and go vet, tsc, Python compile, cargo check or JSON parsing, and language servers (gopls, typescript-language-
    server, pyright/pylsp, rust-analyzer) when installed, including errors in
    other files a change broke. New lsp tool for definitions, references,
    hover, symbols and implementations; new repo_map tool with an Aider-style
    ranked map of a code base.
  • Verification gate: a run that changed files and did not build or test
    afterwards is asked once to verify before it ends.
  • File checkpoints: a shadow git snapshot before each tool batch that may
    change files (bash included). /undo, /rewind and the checkpoint_diff
    tool.
  • Plan mode (/plan): read-only work, then exit_plan_mode shows the plan
    for approval and switches the session to accept_edits.
  • Hooks compatible with the Claude Code protocol (PreToolUse, PostToolUse,
    Stop, SubagentStop, SessionStart, PreCompact, Notification) from setup.json
    and from a project's .matrixclaw/hooks.json once the owner trusts it.
  • Goals: /goal <objective> [--check cmd] [--max-runs N] [--tokens N] keeps
    starting runs until the model reports the goal complete with evidence, the
    check passes and no todo item is open; the same failure three times blocks
    it.
  • Subagents: agent_type (general, explore, plan, review, verify
    and user agents from .matrixclaw/agents/*.md or
    ~/.config/matrixclaw/agents/*.md), output_schema, agent_steer.
    Worktree children start from the parent's current files, commit to
    mc/<task> and are brought back with worktree_merge or dropped with
    worktree_discard.
  • Session learning: an idle session that did enough work gets one background
    review that files quarantined skill drafts and memory suggestions for the
    owner to approve (modules.skills.review; on when skills are on).

Reliability

  • One retry policy for generations and summaries (6 attempts, server-requested
    waits honoured); a reply cut mid-stream is generated again; malformed tool
    arguments go back to the model as an error. Provider errors are classified
    (rate limit, overloaded, auth, quota, transient), and quota errors are no
    longer retried.
  • The reasoning-text filter no longer cuts replies that mention a tag.
  • The loop guard catches failing repeats, two-call cycles and echoed replies.
  • One compaction path for runs and /compact; summaries keep work state,
    tests and version-control status, and the files edited last are re-attached
    after a summary.
  • Events are delivered in order; a lagging client is disconnected and reloads
    instead of silently missing events. SSE sends a keepalive.
  • A run's end always notifies waiting parents; blocking subagent calls no
    longer fail when the child ends first.
  • Learned model metadata stays with the provider that listed it. Codex token
    refreshes are locked across processes and a 401 refreshes once.
  • Reload re-applies run budgets, model concurrency, background limits, the
    automation timezone and delivery targets.
  • A memory scope other than global, user or project is refused (400 on the
    API) instead of being saved as global. Memory that cannot be read is
    logged, and a run is no longer told every entry was removed.
  • A message sent while a run works (and agent_steer to a subagent) reaches
    the model as a user message before its next step. It used to be appended
    to a tool result, where models took it for tool output and ignored it.
  • The model is told which provider and model it runs on in the context note
    next to the newest messages, so after a model switch it no longer repeats
    the name an earlier model gave itself.
  • On Linux a shell command dies with the daemon, so a killed daemon leaves
    no command running unseen.
  • A Go file a language server checked is also checked for gofmt formatting.

Install and service

  • install.sh piped without a controlling terminal no longer fails when it
    starts setup: it says to run matrixclaw setup later. uninstall.sh --purge without a terminal refuses unless --yes is given, by the same
    check.
  • Without a systemd user session (containers, macOS) matrixclaw service stop
    stops the daemon through its API and waits until it is down, service restart replaces the running daemon instead of starting a second one the
    data lock refused, and a daemon that fails to start is an error with the
    end of its log. uninstall.sh stops such a daemon before removing the
    binaries and reports one it could not stop.
  • A directly launched daemon runs detached and logs to
    ~/.local/state/matrixclaw/matrixclawd.log; service logs reads it when
    the journal has nothing.
  • On macOS install.sh and uninstall.sh --purge use the directory the
    daemon keeps setup.json in (~/Library/Application Support/matrixclaw),
    so --purge removes the API keys there too. Setup written by v0.2.0 stays
    where it is.
  • A leading ~ in daemon.db_path (or MATRIXCLAW_DB_PATH) is the home
    directory, not a directory named ~.
  • matrixclaw doctor before the first start notes the missing api_token and
    database as created on first start instead of reporting errors.
  • matrixclaw setup --help and tui --help print usage; an unknown update
    subcommand is an error.

Security

  • Every API route has one policy (open, owner, session); members and
    guests are refused on all session writes in unattended sessions.
  • Deny rules reach commands run through package runners and wrappers
    (npx, pnpm exec, uv run, docker run, sh -c, ...); in-place editors
    (sed -i, perl -i) count as risky.
  • Skills installs run with a timeout, no prompts, the keyless environment and
    path checks.
  • Shell sandbox (daemon.sandbox, docs/SANDBOX.md): full_auto commands
    may write only the working directory, its .git, temporary directories and
    package caches; plan mode and read-only children run read-only. It uses
    bubblewrap, Landlock or sandbox-exec, whichever works, and /status shows
    which one or that none is available.

Telegram and terminal

  • /provider (and a session's Model row) picks provider and model in one
    go: every configured provider, the current one too, opens its model picker,
    which falls back to the setup model and typing a model id when the provider
    lists no models. A session's choice no longer rewrites the provider's model
    in setup.json. The provider form keeps key, endpoint and options (a model
    only for custom providers) and saving it no longer switches the session; the
    owner picks Default for new sessions (provider, then model) explicitly,
    and the setup wizard has the same row in its provider form. A session
    without a model uses its own provider's default, not the active one's.

Upgrade notes (breaking)

  • Back up first, with the daemon running or stopped (see
    docs/STORAGE.md):

    sqlite3 ~/.local/state/matrixclaw/matrixclaw.db ".backup '$HOME/matrixclaw-backup.db'"
    cp ~/.config/matrixclaw/setup.json ~/setup.json.backup
  • Replace both binaries (matrixclaw update install, or the installer), then
    run matrixclaw service restart so the running daemon is the new one.
    Installs older than v0.2.0 must upgrade through v0.2.0 first.

  • The first start converts the database once to a canonical schema
    (PRAGMA user_version), keeping matrixclaw.db.pre-v1 next to it, drops
    tables and columns nothing reads, then applies migrations 002-007.

  • setup.json is converted to version 4 when the new daemon first starts (or a
    setup change is saved), keeping setup.json.pre-v4. From then on unknown
    keys and alias values are refused with an error naming them.

  • Rollback: stop the daemon, restore matrixclaw.db.pre-v1 over
    matrixclaw.db (delete the -wal/-shm files) and setup.json.pre-v4
    over setup.json, then start the old binary. A backup made before the
    upgrade works the same way.

  • Telegram buttons sent before the upgrade are stale and answer "Unknown
    command"; use the command again to get fresh ones.

  • Sandbox: full_auto sessions are confined by the shell sandbox as soon as
    the host supports it. A session working in ~ can then write only
    temporary directories and caches. Set daemon.sandbox.mode to off to opt
    out.

  • The built-in default assistant system prompt is gone. A system_prompt
    saved in setup.json by an older wizard still applies and may contradict the
    coding manual; clear it unless you wrote it.

  • /provider changed: /provider <id> opens the provider's models instead of
    its settings (/provider edit <id>), /provider use takes
    <session> <provider> <model>, and /provider key is gone (set the key in
    the provider's form or with api_key_env). Other typed commands changed
    too: /modules mcp delete <id>, /tasks bg-output <id>.

  • API: PATCH /v1/sessions/{id}/llm requires model_id (with an optional
    provider_id, else the session's) and no longer saves the owner's choice to
    setup.json; GET /v1/sessions/{id}/models takes ?provider= and reports a
    failed discovery in models_error. Saving a provider through
    PATCH /v1/setup/providers/{id} makes it active only with "active": true
    or when no provider is active. GET /v1/approvals requires session_id
    (it answered an empty list without one). Sessions lost runtime_id (use
    kind); new routes cover checkpoints, hooks, goals and memory approval.

Full history: CHANGELOG.md. Backup and rollback: docs/STORAGE.md.