AI-Commander changelog
======================

2.1.0
-----

- Ralph loop mode: --loop PROMPT.md (or /loop in the TUI) re-runs a prompt file
  with a fresh context each iteration, re-reading the file, until the model
  signals LOOPCOMPLETE or --max-iterations (default 10) is reached.
- --verify CMD: a completion signal is accepted only when CMD exits 0;
  otherwise its output goes back to the model and the task continues.
- The completion marker only counts on a line of its own or at the end of the
  reply: mentioning it no longer ends the run.
- AGENTS.md (or CLAUDE.md) in the working directory is added to the system
  prompt.
- File tools: read_file, edit_file (exact string replacement) and write_file,
  approved like commands, with edits shown as a diff. write_file also accepts
  a JSON file's data sent as an object (it is written as formatted JSON):
  models often send it that way, and rejecting it cost them retries and a
  fallback to bash.
- Headless: --nogui exits 0 complete / 1 error / 2 limit reached / 130
  stopped; the prompt can be piped on stdin; --api-base, --model and --api-key
  default to AIC_API_BASE / AIC_MODEL / AIC_API_KEY (also OPENAI_BASE_URL and
  OPENAI_API_KEY), and AIC_API_KEY is hidden from the agent's commands; --json
  prints every event as a JSON line.
- Fixed a "NoScreen: node has no screen" traceback on quit: the shell tab
  kept watching its PTY after it was removed.
- Faster context compression: the summarizer no longer writes an <analysis>
  scratchpad that was thrown away (and, when cut off, could end up in the
  history), it gets a one-line context instead of the whole system prompt and
  long outputs trimmed to their head and tail, and the internal calls (summary,
  task title) ask for low reasoning effort with a smaller output cap. If the
  summarizer fails, compression falls back to 'truncate' instead of replacing
  the evicted history with "[summary unavailable]".
- The shell tab no longer moves the agent: a cd in the shell used to change
  the working directory of the whole process, so a running agent's commands
  and file tools suddenly ran somewhere else. The agent now always works in
  the directory AI-Commander was started in.

2.0.0
-----

Main bugs fixed

- Escape and Ctrl+C quit the whole app, even from the approval dialog or the
  shell tab. Ctrl+C in the shell now interrupts the shell.
- Approval dialog: it showed "Approve command? (y/n/suggestion):" as part of
  the command, and a command containing [/] could crash it. You also had no way
  to reject with a suggestion, and suggestions were lowercased.
- Silent failures: if the API went down, the agent thread died and nothing
  showed in the TUI. Errors now appear in the agent pane, and only transient
  errors are retried.
- Stopping: stop and quit froze the UI for up to 5 seconds and couldn't
  interrupt a long model prefill. Stopping also wrote a fake "Agent stopped...
  TASKCOMPLETE" reply into the history. Stop is now immediate and records
  nothing fake.
- Prompt history was never saved while the Linux sandbox was on, which is the
  default.
- Thinking sometimes didn't show: the model's reasoning was stripped from the
  history, so models such as GLM saw their earlier turns with empty thinking
  and progressively stopped thinking. It is now sent back for the rest of the
  current task, cleared on the next request, and dropped automatically if an
  endpoint refuses it.
- Context compression:
  - Truncation could drop the current request in long sessions.
  - Summaries piled up in the system prompt and included the model's scratch
    analysis.
  - Hitting the context limit is now handled by compressing harder and
    retrying.
- What the model sees from commands:
  - Colour codes and every progress-bar redraw are removed.
  - Pagers such as git log no longer hang until the timeout.
  - A timeout no longer throws away the partial output.
- Pasting more than one line into the prompt kept only the first line.
- Agent loop:
  - A model returning empty replies could loop up to the step limit; it now
    stops after three.
  - A rejection suggestion was inserted between tool results, which strict
    APIs reject.
  - When one tool call in a turn had bad JSON, the valid ones were silently
    dropped.
- --nogui: it printed stray blank lines and broke command output at chunk
  boundaries. Piped output now has no colour codes or ^M.

Mouse copy/paste

- Select: drag to select in any pane, including the shell. The text is copied
  when you release, and lines that were only wrapped to fit the pane come back
  as one line. Double-click selects a word, triple-click a line.
- Paste: right-click copies the selection if there is one, otherwise it
  pastes. Middle-click pastes. Ctrl+C / Ctrl+V and F4 / F5 also work.
- Clipboard: copying sets the desktop clipboard directly through libX11 on X11
  and Xwayland desktops such as GNOME (no extra tools needed, and the text
  stays available after AI-Commander exits), and also uses the terminal's
  clipboard support (OSC 52) plus xclip/xsel/wl-copy/pbcopy when they're
  installed. --no-mouse hands the mouse back to your terminal.

Interface

- Layout: a Norton-style function-key bar (F1 to F10, clickable), a compact
  status line, and a multi-line prompt. Ctrl+J or Shift+Enter adds a line,
  history search works, and Tab completes slash commands.
- Agent pane: answers stream live, re-wrap when you resize, and every command
  shows its exit code and duration.
- Shell tab: now has colours and scrollback.
- Approval dialog: offers Yes / No / Always or a typed suggestion. It ignores
  keys for a moment after opening, so typing meant for the prompt can't
  approve a command.
- Also new: a help screen and zoom for the focused pane.
