summaryrefslogtreecommitdiffstats
path: root/CHANGELOG.md
blob: b08a4defc0c8840574a2951c41b0f4c9f457b5ed (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
# Changelog

All notable changes to this project are documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html):
**MAJOR** for API-breaking changes, **MINOR** for features that do not break the
interface, **PATCH** for bug fixes.

"Interface" means: CLI flags and their meaning, the session file format, the config
file, and the tool schemas the model sees. Anything a script or a resumed session
could depend on counts as API.

## [Unreleased]

## [0.12.1] - 2026-11-22

### Fixed
- `bash` accepts `command` as an alias for `cmd`. A field report showed ~40% of
  its calls were rejected because the model kept writing `command` instead of
  `cmd`; the error was precise but named the *absence* of `cmd` rather than the
  offending key, so the slip persisted for ~50 turns. The alias removes the whole
  failure class. The schema still names the parameter `cmd`.

## [0.12.0] - 2026-11-19

### Changed
- **Breaking:** `--provider` now takes a *type* instead of a preset name:
  `opencode` (the default, sends the required `x-opencode-session` header) or
  `openai-compatible` (any OpenAI-style endpoint, no session header). The base
  URL comes from `--base-url`, `AGENT686_BASE_URL`, or the config file; an
  openai-compatible provider with no URL is rejected.

### Added
- Config file at `~/.config/agent686/config.toml` (or `AGENT686_CONFIG`):
  `provider`, `url`, `model`, `lenient`, `system_ca`, `yolo`, `allow_home`,
  `allow_nogit`. Precedence is CLI flag > environment variable > config file >
  default.

### Fixed
- `--provider --help` printed a doubled-dash suggestion (`----provider=`).

## [0.11.0] - 2026-11-18

### Added
- `/undo` restores the working tree to the state before the last turn, via a git
  checkpoint commit taken at each turn start (dirty trees only).
- `/compact` summarises the conversation and rewrites the session to
  `header + system + summary`, in the same session id. This is the single
  sanctioned transcript rewrite, documented in ADR 0003; it breaks the prompt
  cache and has no rollback.
- Provider presets: `--provider opencode-go|openai|openrouter|ollama|llamacpp|vllm`
  (or `AGENT686_PROVIDER`). Local gateways default to lenient streaming.
- `--lenient` tolerates providers that end a stream with text but no
  `[DONE]`/`finish_reason`.
- `--system-ca` verifies TLS against the OS trust store (via
  `rustls-platform-verifier`) instead of bundled roots.

### Changed
- HTTP proxies (`HTTPS_PROXY`/`HTTP_PROXY`/`ALL_PROXY`/`NO_PROXY`) are honoured —
  documented, not implemented: ureq already read them.

## [0.10.0] - 2026-11-18

### Added
- `--json` for `--list`, `--show` and `--doctor`, so scripts can consume them.
- `/models` lists what the provider offers (the current model marked), and
  `/model <id>` switches mid-session, recording the switch.
- `/forget <id>` deletes a session; `/forget --all` prunes every session except
  the current one.

### Changed
- `--yolo` is now refused outside a git repository as well as in `$HOME` and `/`,
  because git is the documented undo and there is no undo without a `.git`.
  `AGENT686_ALLOW_NOGIT=1` opts out.

## [0.9.2] - 2026-11-18

### Fixed
- A missing API key now exits 1 (an operational error), matching `--doctor`,
  rather than 2 (usage).
- `--doctor` reports a one-line message for a non-JSON (HTML) error body instead
  of dumping it.
- A non-terminal no longer prints a diff nobody can approve before denying an
  edit.
- The weak `GLIBC_2.39` warning fix now covers x86_64 gnu too, not just i686, so
  the README's primary build is clean on Debian 12.

### Changed
- Corrected approval scope in PLAN (process, not session).
- README: test count, i686 note, glibc-floor wording, built-path note, and the
  now-documented `AGENT686_DEBUG_STREAM`, `TERM=dumb` and `--resume`.
- PLAN dependency list and layout tree updated; 120 s timeout marked adjustable.
- CHANGELOG notes the skipped 0.8.1; the package description no longer says
  "32-bit".

## [0.9.1] - 2026-11-18

### Fixed
- The 64 MiB output limit went unreported when a pipeline or redirect overflowed
  via a grandchild of `sh` (which exits 128+25 instead of being signalled).
  Detection now checks the output file's size, not just the child's signal.
- `bash` temp files leaked on spawn/clone/read error paths; a scope guard removes
  them on every path.
- `validate` did not require `content`/`new` that the tool schemas declare
  required; a `write` without `content` or an `edit` without `new` fell through to
  a generic message. Both are now required (present, but may be empty).
- Resuming a session ignored `model` switch records, so the "session used A,
  continuing with B" warning was suppressed and `--list` disagreed with resume.
- A combining mark after a character that filled the last terminal column was
  counted as wrapping to a new row; it now stays on the prior cell.
- `--session --list` swallowed `--list` as the id. Flag-shaped values are
  rejected, and every value flag now accepts `--flag=value` (so `--session=-abc`
  works).
- Removed dead code (`is_placeholder`, `signal::reset`, `DrawState.rows`) and
  folded the standalone `last_reply` into `Session::open`, so resume no longer
  reads the transcript twice.

## [0.9.0] - 2026-11-18

Driven by a field report from a real task (porting a Neovim config to Helix).
The report's most expensive problem was not a missing feature: it was one error
message covering four different failures.

### Added
- `bash` takes `timeout_seconds` (1-600, default 120) and `max_bytes` (per-stream
  output budget, 1 KiB-16 MiB, default 80 KiB), so the limits are discoverable and
  adjustable instead of only discoverable by exceeding them.

### Changed
- `bash` keeps stdout and stderr apart. When both produce output they arrive in
  labelled `[stdout]` / `[stderr]` sections; stderr alone is labelled; stdout
  alone is unchanged. A real error printed to stderr can no longer hide inside
  ordinary output.
- A truncated result says so on its final line, next to the exit status.
- Tool lines and results carry a per-call label (`[2.1]`, `[2.2]`) when several
  calls run in one step, so a result is attributable without counting order.

### Fixed
- The `cmd` validation error covered four distinct causes with one message, and
  was false about two of them. It now distinguishes: the value is empty; the key
  is missing and here is what you sent instead; or the call arrived with no
  arguments at all, which points at argument loss in transit and suggests a
  retry.
- A named call with no arguments is no longer dropped silently. The model is told
  what arrived and can retry; only nameless calls are dropped, because they
  cannot be replayed to the provider.
- Invalid JSON arguments report a preview of what arrived.

## [0.8.2] - 2026-11-15

> 0.8.1 was not released (its change was folded straight into 0.8.2).

### Changed
- `comp.sh` now targets the CPU it runs on by default (`-C target-cpu=native`),
  which is what "build for this machine" should mean. `--portable` builds the
  architecture floor instead, and the plan prints both commands with the
  consequence spelled out: a native build does not start on an older CPU.

### Fixed
- The x86-64 level detection required `osxsave`, which `/proc/cpuinfo` never
  lists, so a v3 CPU (Coffee Lake) was reported as v2. It now accepts `abm` for
  LZCNT and `xsave` for OSXSAVE, and reports v3 correctly.

## [0.8.0] - 2026-11-15

### Added
- `comp.sh`: detects distro, architecture, libc and glibc version, CPU baseline
  and toolchain, then prints the exact build command for this machine, the
  `cfg` values the code will compile against, and the portable alternatives:
  static musl, an older-glibc container, and `cargo-zigbuild` with a pinned
  glibc. `--run` executes the native build and its checks; `--musl` and
  `--old-glibc` select the other plans.

Verified on this machine: the native x86_64 build requires `GLIBC_2.34`, the
static musl build is 4.1 MiB, runs on Debian 10 (glibc 2.28), and reaches the
live API through musl's resolver.

### Fixed
- The session-lock test was flaky under parallel test execution: a test that
  spawns a child process briefly inherits the session's file description between
  fork and exec, keeping the lock alive while another test dropped its handle.
  The spawning test now serialises with the others. Test-only — the harness never
  drops a session while a child is starting.
- Removed a stray `File::open` left behind in the session loader.

## [0.7.1] - 2026-11-15

### Fixed
- A tool call with a name but no arguments — a placeholder some backends emit
  alongside a real call — became a blank approval prompt and then an error. It is
  now dropped before the assistant message is recorded, with a one-line note, so
  the turn continues as if only the real call had been made.
- The bash command was printed twice: once on the tool line and again in the
  approval prompt. When the prompt is going to show it, the tool line now shows
  only the tool name. The edit prompt no longer repeats the path either.

## [0.7.0] - 2026-11-15

### Added
- Resuming a session (`--continue` or `--session`) prints the last assistant
  block before the prompt, or the last reasoning block when the model produced no
  content. Twenty lines at most, with a pointer to `--show`.
- `AGENT686_DEBUG_STREAM=1` prints every SSE frame to stderr (truncated), for
  diagnosing provider quirks without a proxy.

### Fixed
- A `bash`, `write` or `edit` call with missing or unparsable arguments used to
  reach the approval prompt, so you were asked to approve an empty command.
  Arguments are validated before any prompt: invalid JSON and empty required
  fields are returned to the model as errors instead.
- Empty placeholder tool calls sent by a provider are dropped and reported,
  rather than becoming a blank approval.
- A session containing a line with invalid UTF-8 — the shape a torn write leaves
  after `kill -9` — could not be opened at all. Reading is now byte-based and
  lossy per line, so a torn line costs that line, not the session.

## [0.6.2] - 2026-11-15

### Fixed
- Resizing the terminal duplicated the prompt: the terminal had already reflowed
  the block, and the editor then drew a second copy below it. The editor now
  emits nothing on resize and only recomputes where the caret sits, so the next
  redraw lands on the reflowed block.
- `scripts/ux-check.sh` now also covers narrowing a pane while typing.

## [0.6.1] - 2026-11-15

### Fixed
- The redraw moved up by the number of rows the prompt block occupied, but the
  caret can be on any of those rows. With a two-line prompt and the caret moved
  up (Home, Left, Up-history), the next redraw overshot by a row and cleared the
  line above the prompt — usually the model's previous output. The editor now
  tracks which row the caret is on and moves up by that.
- Added `scripts/ux-check.sh`: drives the editor inside tmux and asserts on the
  rendered screen. Byte-level tests could not see this class of bug.

## [0.6.0] - 2026-11-15

### Added
- `--show [ID]`: renders a transcript — user turn, reasoning, assistant text,
  every tool call with its arguments, and each result — instead of requiring
  `cat` on the JSONL. Reads without locking, so it works while a session is open.
- The status line now summarises the turn: writes, commands and denials.
- Sessions record the harness version that wrote them and the model in use; a
  model switch appends a record so `--list` shows the current model rather than
  the one the session started with. Resuming with a different binary warns that
  the prompt and tool schemas may differ.

### Changed
- `--yolo` is refused in `$HOME` and `/` unless `AGENT686_ALLOW_HOME=1` is set.
  The documented undo is git, and neither of those is a checkout.

## [0.5.3] - 2026-11-15

### Fixed
- Two processes could append to the same session and interleave messages, which
  corrupts a transcript permanently. A session now takes an exclusive `flock` and
  the second process is told the session is already open.
- `edit` on a file that is not valid UTF-8 failed with a raw codec error after
  reading it; it now says so up front and points at `bash`. Files over 64 MiB are
  refused the same way, instead of failing mid-rewrite on the 32-bit target.
- The line editor counted every character as one column, so CJK text, combining
  marks and pasted tabs put the caret in the wrong place. Widths now come from
  `unicode-width`, with tabs expanded to the next multiple of eight.
- A terminal resize during editing left the redraw's row count stale and could
  erase output above the prompt; the editor now starts a fresh prompt line.

## [0.5.2] - 2026-11-15

### Fixed
- A prompt that exactly filled a terminal row made the next redraw move up one
  row too many and erase the line above it, which is usually the model's previous
  output. Terminals wrap lazily: filling the last column leaves the cursor in that
  column until the next character. The layout now models that, and is unit-tested
  at the boundary.
- Reasoning and the answer could be written on the same line, because a reasoning
  stream does not always end with a newline. The renderer now closes the reasoning
  block on its own line, and does not add a blank line when the reasoning already
  ended with one. The renderer is generic over its writer, so this is tested.

## [0.5.1] - 2026-11-15

### Fixed
- Every start on the target printed
  `weak version 'GLIBC_2.39' not found`. Rust's std references glibc 2.39's
  `pidfd_spawnp`/`pidfd_getpid` weakly; the dynamic linker still warns. They are
  now defined as absolute zero for the i686 target, which removes the version
  need and leaves the fallback path unchanged.

## [0.5.0] - 2026-11-15

### Added
- The step number is printed on every tool line (`● [3] bash …`), so the progress
  of a long turn is visible while it runs rather than only at the end.
- `docs/KNOWN-ISSUES.md` records the defects found in review that are understood
  and deliberately deferred.

### Changed
- One HTTP client per turn instead of one per step, avoiding a TLS handshake on
  every request.
- Documentation corrected where it had drifted: binary size, test count, `grep`
  semantics, input handling, instruction scope, and the settled API questions.

## [0.4.5] - 2026-11-15

### Fixed
- `--session ../escape` wrote outside the sessions directory; ids are now
  validated as 1-64 characters of `A-Za-z0-9._-`.
- A flag with no value was silently ignored, and `--session` with an empty value
  quietly created a new session. Both are usage errors (exit 2) now.
- `--` ends option parsing, so a prompt can start with `-`.
- `--continue` with `--session`, and `--list` with `--doctor`, are rejected
  instead of one silently winning.
- Unknown-flag output went to stdout; usage now goes to stderr.
- `--doctor` sent an empty `x-opencode-session`, which the gateway rejects, so a
  healthy key could look broken. It now sends a throwaway id.
- Resuming a session from a different directory gave the model the old `cwd` and
  branch without saying so; the session records its starting directory and now
  warns when it does not match.
- `AGENTS.md` was read all the way to `/`, so a stray file in a shared parent
  would be injected into every project. Reading now stops at the git root, and
  outside a repository only the working directory itself is read.
- Typeahead typed during streaming could answer the following approval prompt.
- Colour is now disabled by `NO_COLOR` and `TERM=dumb`.
- Ctrl-C during an approval prompt now denies instead of appearing to hang.

## [0.4.4] - 2026-11-15

### Fixed
- `read` refused only directories; a FIFO or device would block the single-threaded
  harness forever. It now requires a regular file.
- `read`'s `offset` was cast from `u64` to `usize`, which wrapped on 32-bit builds
  and produced wrong line numbers. Out-of-range values are now an error.
- `write` truncates in place, so a crash or full disk could destroy the original.
  It now writes a temporary file and renames, and preserves the file mode.
- `edit` applied the snapshot taken before the approval prompt, silently
  discarding anything written in between. It now re-reads and re-checks at apply
  time and refuses if the text is no longer unique.
- `edit` reported "not found" for CRLF files, because the carriage returns are
  invisible in `read` output. Matching now retries with normalised line endings
  and writes back in the file's own style.
- `grep` on a nonexistent path said "no matches", implying the symbol was absent;
  it now errors. It also reports how many files it skipped as too large or binary.
- `glob` now includes symlinked files (symlinked directories are still skipped, to
  avoid loops).

## [0.4.3] - 2026-11-15

### Fixed
- `bash` timeouts killed only the direct `sh`, leaving `make`, `cargo` or `sleep`
  running on the 2-core box. The command now runs in its own process group and
  the whole group is killed on timeout or on Ctrl-C.
- `bash` output was unbounded on disk while being truncated on read; the child now
  has a 64 MiB file-size limit and reports when it hit it.
- A long-running command can now be stopped with Ctrl-C instead of waiting out
  the 120 s timeout.
- `OPENCODE_API_KEY` was inherited by every command, so a failing build that
  dumped the environment would put the key in the transcript and send it back to
  the provider. It is removed from the child environment.
- Session files are created `0600` and their directories `0700`; older `0644`
  files are tightened on open. History is `0600` and its file is trimmed.
- `--doctor` warns when the key file is readable by other users.

## [0.4.2] - 2026-11-15

### Fixed
- A stream that ends without `[DONE]` or a `finish_reason` is now an error, not an
  empty or truncated answer. A provider returning ordinary JSON to a streaming
  request used to be recorded as an empty assistant message; a dropped connection
  mid-answer used to be recorded as a finished one.
- A tool-call delta without `index` no longer loses the whole call, and
  non-contiguous indexes no longer invent an empty call.
- A final `data:` frame with no trailing newline is processed instead of dropped.
- Malformed frames are counted and reported instead of silently swallowed.

## [0.4.1] - 2026-11-15

### Fixed
- Aborting a step that announced several tool calls used to leave the remaining
  calls unanswered, which the provider rejects and which made the session
  permanently unresumable. Remaining calls now get an "aborted" result, and
  sessions opened in that state are repaired by appending the missing results.
- A Ctrl-C pressed after a turn finished could abort the next prompt; the flag is
  cleared when a turn starts.
- `run_turn` cleared the global cancel flag rather than the one it was given.
- One-shot mode now exits 130 when aborted and 3 when a tool call was denied,
  instead of 0 for both.
- `bash` approval offered `[y/N/a]` but treated `a` as "no"; it now offers
  `[y/N]`, matching its documented every-call behaviour.
- A non-terminal stdin now says up front that writes and commands will be denied.

## [0.4.0] - 2026-11-15

### Changed
- `grep` takes a regular expression instead of a literal string, matching what
  coding agents expect from a search tool. An invalid pattern explains itself and
  points at `fixed`.
- `grep` accepts `fixed: true` to match literal text, e.g. when searching for
  `a+b` or `foo(`.

## [0.3.0] - 2026-11-15

### Added
- `--version`.
- `--doctor`: reports the version and target, where the key came from, whether
  the sessions directory is writable, the provider and model, and then checks the
  key against `GET /models` and confirms the model id is actually listed. Exits
  non-zero if any check fails, so it can gate a deployment. It tolerates a
  missing key so the report is the thing that tells you the key is missing.

## [0.2.0] - 2026-11-15

### Added
- `read` streams instead of loading the whole file. It seeks to `offset` with a
  buffered reader and consumes long lines without keeping them, so memory stays
  flat: 16 MB RSS reading a 200 MB file at any offset, 0.8 s to reach line
  999,000.
- Single lines longer than 4 KiB are clipped and marked `…(line truncated)`.

### Changed
- The truncation marker is now `… more lines; continue with offset=N`.

## [0.1.0] - 2026-11-15

Baseline: the harness as first built, before versioning was defined here.

- Streaming provider client for OpenCode Go (`chat/completions`), stable
  `x-opencode-session` header, retry with backoff.
- Append-only JSONL sessions, `--continue`, `--session`, `--list`.
- Six tools: read, write, edit, bash, grep, glob.
- Approval: first edit of a session with a diff, every bash call.
- Line editor with history and bracketed paste.
- i686 release gate: `GLIBC_2.34` required, verified on `linux/386 debian:12`.