bots-garden/mini-mepublic Fork
⑂ main
Commits
⬇ Clone ▾
git clone https://git.rickub.com/bots-garden/mini-me.git
git clone ssh://git@rickub.com/bots-garden/mini-me.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

Download ZIP
🛟 Updated. c5a4014 · on main · k33g · 2d ago
v2.0.0.en.md · 91 lines · 9.4 KBmarkdown
Blame HistoryOpen raw

mini-me v2.0.0

Version française

Built-in guardrails against the silent failures of small models: wrong paths and malformed tool calls repaired, loops, cut answers and failed edits caught and reported, diagnostics without asking, background processes tracked, and mm -p exits 1 when a run fails.

This release comes from measuring small coding models — LiquidAI LFM2.5-24B-A2B (demos/lfm-coder), Olala-v1.0-mini (demos/olala-mini) and Mellum2 12B (demos/mellum2). Their typical failures were silent: a file written in the wrong directory, a turn ended by a malformed call, an answer saying "Done." after a refused edit. demos/lfm-coder first fixed them with four Python hooks; their generic parts are now mm settings, and that demo uses no hook any more.

New

workspace: keep the file tools in the project, repair wrong paths (#229, #234, #248)

workspace:
  confine: true      # read_file, write_file, edit_file and lsp stay inside the project
  repairPaths: true  # a wrong path becomes the one the model meant
  • repairPaths turns an absolute path with a directory missing (<parent>/main.go), an invented root (/workspace/stats/stats.go) or a relative path that starts with the project folder's own name (olala-mini/script.js) into the right relative path, and tells the model: [path … is outside the project: used stats/stats.go — use relative paths].
  • In bash, a leading cd <absolute path> && to a directory that does not exist, to the project root or to the project's tree outside the project is dropped: [cd … dropped: every bash command already starts in the project root — never cd to an absolute path].
  • confine refuses what is still outside, suggesting a relative path — never the absolute project path. A hook that only refused such paths, quoting the project path, made LFM2.5 retry absolute paths for 80 turns.

Both are off by default. See workspace keys.

turnReminder: a rule next to every question (#230)

A text appended to every question the model reads, under a [reminder] line, in every front end. In demos/lfm-coder, a rule asking the model to call ask_user when a decision is missing was followed 0 times out of 5 from the system prompt, and 3 out of 3 next to the question with the exact call shape. Until now this took a preGeneration hook script.

lsp.diagnosticsAfterEdit and lsp.diagnosticsAfterRead (#227, #245)

The language server's diagnostics are appended to the output of write_file / edit_file (after a successful change) and of read_file (once per version of the file), without the model asking: demos/gemma-coder asked for them 0 times in 54 runs. Off by default; 8 s per request.

bashBackground: processes a command leaves running (#228)

Each bash command runs in its own process group. With report (the default), what is still running when the command returns is listed in the output — [still running in the background after this command: 4242 (server). …] — with the advice to stop it in the same command. stop also stops it at the end of the turn; allow is the old behaviour. A timeout now stops the whole group. In demos/lfm-coder, servers started with & stayed up after the turn, and a later curl answered by the old server was reported as proof that the new code worked.

Linux and macOS only. Not done: the listening port in the report, a warning when mm exits, the stop in mm --ask.

edit_file picks an occurrence by its line (#241)

Each edit takes an optional line: when old occurs several times, the line where the occurrence to change starts. The "appears N times" refusal now offers it. Mellum2 and Olala both knew they wanted "line 8" but could not make old unique.

Tool calls repaired instead of ending the turn (#225, #237)

  • A call whose arguments fail the tool's schema no longer ends the turn: the model reads the error with the expected arguments and an example, and can fix its call (3 identical invalid calls still end it).
  • Before validation, "true", "8" or "0.5" sent for a boolean, integer or number are converted, and the names models reach for in write_file / edit_file (file_path, old_text, edits as a JSON string…) are repaired.

See tools.

Silent ends of turn, handed back once (#232, #235, #236, #238, #242)

What happened What mm does now
A reply cut at the token limit while the model was still reasoning (Olala: exactly 4,096 tokens) Handed back once, asking it to act now; if it happens again, empty answer — the model reasoned until the limit (…): raise sampling.…
One sentence repeated 20 times in a row in the reasoning or the answer (Olala: 40,000 characters of "So the assistant can output the content.") That model call is cut and handed back once; looping again ends the turn with the model looped: …
A final answer with 20 or more identical lines (Olala: one line 473 times) Collapsed to one line plus [… the same line repeated N more times — removed by mm], in the answer and the history, and reported
An answer cut mid-sentence at the token limit Reported: answer cut at the limit (…)
A final answer given while the turn's last write_file / edit_file had failed Handed back once (the file was not changed: fix the call or say so); still so, the last edit_file failed (…) — that change was not made, whatever the answer says

See struggle signals.

Fixed

  • mm -p exits 1 when the generation fails — watchdog stall, max turns, provider or tool error. It exited 0, so a script could not tell a failed run from a good one. (#224)
  • edit_file: a line break where the file has a space. A fourth, last matching pass treats any run of whitespace, line breaks included, as equal. Mellum2 sent 28 edit_file calls, 26 of them the same, because it remembered one line as two. (#239)
  • edit_file: identical old and new for a text the file holds is reported as already done instead of failing the whole call. (#154)
  • The loop detector stops the same failing call repeated between other calls. The same refused edit, a read_file between each, used to run until maxTurns. (#240)
  • llama.cpp in router mode (the Llama app): mm asks /props?model=<model>, so the banner shows the model's window, the false "no chat template" warning is gone and mm init reads the model's facts. (#226)
  • contextWindow larger than the served window: a start-up warning, and a request refused as too long is explained with its size and the server's window instead of "the connection broke" — and not retried. (#233)
  • Skills of an agent file named from another project (mm -config /elsewhere/.mm/agent.yaml): in terminal mode, when the current project has no skill at the relative skillsDir, the one next to the agent file is used; the banner says skills: N (from <dir>). (#231)
  • lsp with TypeScript: mm now declares the diagnostics capabilities, so typescript-language-server sends its diagnostics (it sent none), and TypeScript 7's own server, tsc --lsp --stdio, which only answers when asked (LSP 3.17 pull diagnostics), works too. (#246, #247)

Demos

  • demos/lfm-coder (new): a Go coder on LFM2.5-24B-A2B. Its four hooks were replaced by the settings above. Measured with this release: 16 of 20 runs (nine Go cases twice, plus a two-run comment case). Without any hook, a short smoke test gave commit 2/2, new app 1/2, web API 0/2 — the web API case has stayed around one run in two since the first series. A full re-measure is still to do.
  • demos/olala-mini (new, Olala-v1.0-mini on Blade) and demos/mellum2 (new, Mellum2 12B on the Llama app): where most of the failures above were seen; their settings pages (EN + FR) describe each guardrail they use.

Documentation

  • Configuration reference: workspace, turnReminder, bashBackground, lsp.diagnosticsAfterEdit / diagnosticsAfterRead, the contextWindow warning, the skillsDir fallback.
  • Tools reference: bash background processes, edit_file line and fourth matching pass, repaired and handed-back arguments, the loop detector's failed-call rule.
  • CLI reference: the exit codes of -p, the new struggle signals.
  • Guides: TypeScript 5/6 or 7 and the diagnostics settings in the lsp guide; router mode in the llama.cpp guide. The struggling models explanation says why mm hands back once and repairs rather than refuses.

Upgrading

  • Replace the binary: see the install guides for macOS, Linux and Windows.
  • bashBackground is on by default (report). A command that leaves a process running now gets a note at the end of its output, and a bash timeout stops the whole process group, not only the shell. Set bashBackground: allow for the old behaviour.
  • mm -p exits 1 on a failed generation. A script that treated every run as a success now sees the failures.
  • The other new settings are off by default. An agent that used hooks for these jobs (path repair, argument repair, go vet after edits, a reminder) can switch to the settings; demos/lfm-coder shows how.
  • Older mm versions ignore the new keys without a word.
 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
# mini-me v2.0.0

*[Version française](v2.0.0.fr.md)*

Built-in guardrails against the silent failures of small models: wrong paths and malformed tool calls repaired, loops, cut answers and failed edits caught and reported, diagnostics without asking, background processes tracked, and `mm -p` exits 1 when a run fails.

This release comes from measuring small coding models — LiquidAI LFM2.5-24B-A2B (`demos/lfm-coder`), Olala-v1.0-mini (`demos/olala-mini`) and Mellum2 12B (`demos/mellum2`). Their typical failures were silent: a file written in the wrong directory, a turn ended by a malformed call, an answer saying "Done." after a refused edit. `demos/lfm-coder` first fixed them with four Python hooks; their generic parts are now mm settings, and that demo uses no hook any more.

## New

### `workspace`: keep the file tools in the project, repair wrong paths (#229, #234, #248)

```yaml
workspace:
  confine: true      # read_file, write_file, edit_file and lsp stay inside the project
  repairPaths: true  # a wrong path becomes the one the model meant
```

- `repairPaths` turns an absolute path with a directory missing (`<parent>/main.go`), an invented root (`/workspace/stats/stats.go`) or a relative path that starts with the project folder's own name (`olala-mini/script.js`) into the right relative path, and tells the model: `[path … is outside the project: used stats/stats.go — use relative paths]`.
- In `bash`, a leading `cd <absolute path> &&` to a directory that does not exist, to the project root or to the project's tree outside the project is dropped: `[cd … dropped: every bash command already starts in the project root — never cd to an absolute path]`.
- `confine` refuses what is still outside, suggesting a relative path — never the absolute project path. A hook that only refused such paths, quoting the project path, made LFM2.5 retry absolute paths for 80 turns.

Both are off by default. See [`workspace` keys](../docs/en/reference/configuration.md#workspace-keys).

### `turnReminder`: a rule next to every question (#230)

A text appended to every question the model reads, under a `[reminder]` line, in every front end. In `demos/lfm-coder`, a rule asking the model to call `ask_user` when a decision is missing was followed 0 times out of 5 from the system prompt, and 3 out of 3 next to the question with the exact call shape. Until now this took a `preGeneration` hook script.

### `lsp.diagnosticsAfterEdit` and `lsp.diagnosticsAfterRead` (#227, #245)

The language server's diagnostics are appended to the output of `write_file` / `edit_file` (after a successful change) and of `read_file` (once per version of the file), without the model asking: `demos/gemma-coder` asked for them 0 times in 54 runs. Off by default; 8 s per request.

### `bashBackground`: processes a command leaves running (#228)

Each `bash` command runs in its own process group. With `report` (the default), what is still running when the command returns is listed in the output — `[still running in the background after this command: 4242 (server). …]` — with the advice to stop it in the same command. `stop` also stops it at the end of the turn; `allow` is the old behaviour. A timeout now stops the whole group. In `demos/lfm-coder`, servers started with `&` stayed up after the turn, and a later `curl` answered by the old server was reported as proof that the new code worked.

Linux and macOS only. Not done: the listening port in the report, a warning when mm exits, the stop in `mm --ask`.

### `edit_file` picks an occurrence by its line (#241)

Each edit takes an optional `line`: when `old` occurs several times, the line where the occurrence to change starts. The "appears N times" refusal now offers it. Mellum2 and Olala both knew they wanted "line 8" but could not make `old` unique.

### Tool calls repaired instead of ending the turn (#225, #237)

- A call whose arguments fail the tool's schema no longer ends the turn: the model reads the error with the expected arguments and an example, and can fix its call (3 identical invalid calls still end it).
- Before validation, `"true"`, `"8"` or `"0.5"` sent for a boolean, integer or number are converted, and the names models reach for in `write_file` / `edit_file` (`file_path`, `old_text`, `edits` as a JSON string…) are repaired.

See [tools](../docs/en/reference/tools.md#arguments-that-do-not-match-a-tools-schema).

### Silent ends of turn, handed back once (#232, #235, #236, #238, #242)

| What happened | What mm does now |
|---|---|
| A reply cut at the token limit while the model was still reasoning (Olala: exactly 4,096 tokens) | Handed back once, asking it to act now; if it happens again, `empty answer — the model reasoned until the limit (…): raise sampling.…` |
| One sentence repeated 20 times in a row in the reasoning or the answer (Olala: 40,000 characters of "So the assistant can output the content.") | That model call is cut and handed back once; looping again ends the turn with `the model looped: …` |
| A final answer with 20 or more identical lines (Olala: one line 473 times) | Collapsed to one line plus `[… the same line repeated N more times — removed by mm]`, in the answer and the history, and reported |
| An answer cut mid-sentence at the token limit | Reported: `answer cut at the limit (…)` |
| A final answer given while the turn's last `write_file` / `edit_file` had failed | Handed back once (the file was not changed: fix the call or say so); still so, `the last edit_file failed (…) — that change was not made, whatever the answer says` |

See [struggle signals](../docs/en/reference/cli.md#struggle-signals).

## Fixed

- **`mm -p` exits 1 when the generation fails** — watchdog stall, max turns, provider or tool error. It exited 0, so a script could not tell a failed run from a good one. (#224)
- **`edit_file`: a line break where the file has a space.** A fourth, last matching pass treats any run of whitespace, line breaks included, as equal. Mellum2 sent 28 `edit_file` calls, 26 of them the same, because it remembered one line as two. (#239)
- **`edit_file`: identical `old` and `new`** for a text the file holds is reported as already done instead of failing the whole call. (#154)
- **The loop detector stops the same failing call repeated between other calls.** The same refused edit, a `read_file` between each, used to run until `maxTurns`. (#240)
- **llama.cpp in router mode** (the Llama app): mm asks `/props?model=<model>`, so the banner shows the model's window, the false "no chat template" warning is gone and `mm init` reads the model's facts. (#226)
- **`contextWindow` larger than the served window**: a start-up warning, and a request refused as too long is explained with its size and the server's window instead of "the connection broke" — and not retried. (#233)
- **Skills of an agent file named from another project** (`mm -config /elsewhere/.mm/agent.yaml`): in terminal mode, when the current project has no skill at the relative `skillsDir`, the one next to the agent file is used; the banner says `skills: N (from <dir>)`. (#231)
- **`lsp` with TypeScript**: mm now declares the diagnostics capabilities, so typescript-language-server sends its diagnostics (it sent none), and TypeScript 7's own server, `tsc --lsp --stdio`, which only answers when asked (LSP 3.17 pull diagnostics), works too. (#246, #247)

## Demos

- **`demos/lfm-coder`** (new): a Go coder on LFM2.5-24B-A2B. Its four hooks were replaced by the settings above. Measured with this release: 16 of 20 runs (nine Go cases twice, plus a two-run comment case). Without any hook, a short smoke test gave commit 2/2, new app 1/2, web API 0/2 — the web API case has stayed around one run in two since the first series. A full re-measure is still to do.
- **`demos/olala-mini`** (new, Olala-v1.0-mini on Blade) and **`demos/mellum2`** (new, Mellum2 12B on the Llama app): where most of the failures above were seen; their settings pages (EN + FR) describe each guardrail they use.

## Documentation

- Configuration reference: `workspace`, `turnReminder`, `bashBackground`, `lsp.diagnosticsAfterEdit` / `diagnosticsAfterRead`, the `contextWindow` warning, the `skillsDir` fallback.
- Tools reference: `bash` background processes, `edit_file` `line` and fourth matching pass, repaired and handed-back arguments, the loop detector's failed-call rule.
- CLI reference: the exit codes of `-p`, the new struggle signals.
- Guides: TypeScript 5/6 or 7 and the diagnostics settings in [the lsp guide](../docs/en/how-to/navigate-code-with-lsp.md); router mode in [the llama.cpp guide](../docs/en/how-to/run-with-llama-cpp.md). The [struggling models](../docs/en/explanation/struggling-models.md) explanation says why mm hands back once and repairs rather than refuses.

## Upgrading

- **Replace the binary**: see the install guides for [macOS](../INSTALL.MACOS.md), [Linux](../INSTALL.LINUX.md) and [Windows](../INSTALL.WINDOWS.md).
- **`bashBackground` is on by default (`report`).** A command that leaves a process running now gets a note at the end of its output, and a `bash` timeout stops the whole process group, not only the shell. Set `bashBackground: allow` for the old behaviour.
- **`mm -p` exits 1 on a failed generation.** A script that treated every run as a success now sees the failures.
- The other new settings are off by default. An agent that used hooks for these jobs (path repair, argument repair, `go vet` after edits, a reminder) can switch to the settings; `demos/lfm-coder` shows how.
- Older mm versions ignore the new keys without a word.