Skip to content

Agentao 0.5.23

Latest

Choose a tag to compare

@jin-bo jin-bo released this 23 Nov 15:11
e322f56

Agentao 0.5.23

Shell permission rules get harder to slip past. A custom allow on a shell
command no longer allows a chained or expanding command, and a deny or
ask now also catches other spellings and other letter case of the same
command. The interactive CLI gains new commands for looking at and managing a
session. agentao run handles signals for the whole run and exits 143 on
SIGTERM, and a cancel now stops a model request that hangs on the network.

Several of these change behaviour. They are listed under "Behaviour
changes" at the end.

Shell permission rules

  • A custom allow applies only to a simple command. A rule such as
    {"tool": "run_shell_command", "args": {"command": "^git "}, "action": "allow"}
    used to match the start of the text, so it also allowed
    git status && curl … | sh. A custom allow with an args.command
    condition now applies only to a command with no chaining, redirection,
    subshell, substitution, leading variable assignment, or variable, glob or
    brace expansion, read in the dialect of the shell that runs it. On any
    other command the rule is skipped and the rules after it decide. Name the
    subcommands you mean and anchor the end:

    {"rules": [{"tool": "run_shell_command", "args": {"command": "^git (status|branch)$"}, "action": "allow"}]}
  • A deny or ask matches in any case. GIT push runs git on macOS's
    and Windows' default filesystems, and PowerShell and cmd ignore case, so it
    used to get past a deny on git push. Write (?-i:-x) to keep part of a
    pattern exact.

  • A deny or ask also sees other spellings. Quotes and escapes
    (g''it push, cmd's g^it push, PowerShell's g`it push), a program
    path (/usr/bin/git push), an .exe suffix and extra spaces no longer get
    a command past it. A wrapper in front of the program (env git push) or
    an option before the subcommand (git -C . push) is still not caught, so
    treat a command deny as best-effort.

  • The workspace-write / plan preset now denies a recursive force rm in
    any flag spelling (rm -fr, rm -Rf, rm --recursive --force). It asked
    before.

An allow still matches case-sensitively and sees only the raw text, so none
of this grants anything that was not granted before.

New in the interactive CLI

/permission          also shows where the mode came from, and the policy sources
/plugins hooks       the plugin hooks this session loaded, and plugins that failed to load
/sessions rename     name the current session
/sessions clone      save a resumable copy of a session
/export <path>       save the conversation as a local Markdown file
/diff                staged, unstaged and untracked changes in the repository
/mcp verbose         each MCP server's command or URL, sign-in, tools, resources and skills
/skills manage       a checkbox picker to enable and disable skills
  • /permission and /plugins hooks report what the session recorded at
    startup and at each mode switch. A config file edited later does not change
    them, and opening them runs no hook. Hook commands, prompts and URLs are
    never shown.
  • /export leaves out system instructions, reasoning, runtime notes and tool
    calls unless you pass --tools. It never overwrites a file without
    --force.
  • /diff sends no model request and does not touch the index or the working
    tree.
  • /mcp verbose hides env and header values, and everything in a URL after
    scheme://host[:port]. It masks credentials it recognises in args; a bare
    token passed as a positional arg is not caught.
  • On a terminal, bare /skills now opens the picker. The list moved to
    /skills list.

agentao run and cancelling

  • Exit 143 on SIGTERM. A run stopped by kill, systemd, a container or
    a CI shutdown exits 143 with interrupted (sigterm). Ctrl+C still exits
    130.
  • Signals are handled for the whole run. A signal during the agent build,
    a session hook or the result write used to kill the process with no result
    document. A second signal, at least 0.5 s after the first, now exits at
    once.
  • A setup error is reported in the result document, as runtime_error
    with exit 1, and no longer as a traceback.
  • A cancel stops a hung model request. A provider that never answered
    held the turn until the request timed out. The request now runs on a
    worker thread, and the turn checks for a cancel every 0.1 s, so an
    agentao run signal, an ACP session/cancel and the interactive CLI end
    the turn.
  • ACP clients see LLM retries. Each retry is sent as an
    agent_thought_chunk such as [retry 1/4: status=503, retrying in 7.5s].

Fixes

  • A "mode": "plan" saved in .agentao/settings.json no longer starts the
    CLI in a broken plan state. It falls back to workspace-write, and
    /permission says why. The CLI never saves plan.
  • Leaving /plan during the temporary full-access grant (answering 2)
    restores the same mode as /sessions resume, not whatever
    settings.json happened to hold.
  • settings.json, mcp.json and goal.json are written atomically, so a
    crash mid-write no longer leaves a truncated file.

For hosts

  • agentao.embedding.sessions: clone_session(), clone_agent_session()
    and clone_saved_session(), which raise SessionLimitReached when 10
    sessions are saved. save_session() and persist_agent_session() take a
    keyword-only name=, and each list_sessions() entry has a name key.
  • CancellationToken.cancel_from_signal(reason) cancels from a signal
    handler without deadlocking.
  • Plan mode entry, plan mode exit and a session reset now emit
    PERMISSION_MODE_CHANGED with their own cause: cli-plan,
    cli-plan-exit and cli-reset.

Behaviour changes

  • A custom shell allow written for one chained command
    (^make build && make test$) now asks.
  • A shell deny or ask pattern can catch a flag it did not mean: a deny on
    curl -x also refuses curl -X POST.
  • On cmd, the read-only preset list no longer runs echo %VAR% without
    asking.
  • A wrapper that read exit 130 as "stopped by any signal" must also accept
    143.
  • A second signal before the result is written now exits at once, without
    the result document or cleanup.
  • Bare /skills on a terminal opens the picker; use /skills list for the
    list.
  • A consumer that matched cause == "cli" no longer sees plan mode exits or
    session resets, and replay files now record plan mode entry.

See CHANGELOG.md for the full entries.