mini-code-cli 0.2.1.1__tar.gz → 0.3.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/PKG-INFO +210 -20
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/README.md +209 -19
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/mini_code_cli/agent_loop.py +1290 -152
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/mini_code_cli/compaction.py +53 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/mini_code_cli/config.py +21 -1
- mini_code_cli-0.3.0.0/mini_code_cli/media.py +194 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/mini_code_cli/persistence.py +6 -7
- mini_code_cli-0.3.0.0/mini_code_cli/planning.py +90 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/mini_code_cli/prompts.py +172 -10
- mini_code_cli-0.3.0.0/mini_code_cli/recovery.py +157 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/mini_code_cli/runner.py +1 -1
- mini_code_cli-0.3.0.0/mini_code_cli/settings.py +918 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/mini_code_cli/shell_safety_utils.py +0 -4
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/mini_code_cli/skills.py +0 -20
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/mini_code_cli/subagents/base.py +0 -1
- mini_code_cli-0.3.0.0/mini_code_cli/todos.py +202 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/mini_code_cli/tokens.py +6 -1
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/mini_code_cli/tools.py +258 -47
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/mini_code_cli/tui.py +682 -76
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/mini_code_cli/ui.py +148 -44
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/mini_code_cli/utils.py +148 -25
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/mini_code_cli.egg-info/PKG-INFO +210 -20
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/mini_code_cli.egg-info/SOURCES.txt +8 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/pyproject.toml +1 -1
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/tests/test_advanced_features.py +407 -6
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/tests/test_background.py +6 -1
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/tests/test_config.py +22 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/tests/test_e2e_agent_loop.py +66 -2
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/tests/test_interactive.py +146 -24
- mini_code_cli-0.3.0.0/tests/test_media.py +64 -0
- mini_code_cli-0.3.0.0/tests/test_recovery.py +70 -0
- mini_code_cli-0.3.0.0/tests/test_settings.py +990 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/tests/test_subagents.py +1 -2
- mini_code_cli-0.3.0.0/tests/test_todos.py +83 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/tests/test_tokens.py +9 -7
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/tests/test_tools.py +93 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/tests/test_tui.py +534 -5
- mini_code_cli-0.2.1.1/mini_code_cli/planning.py +0 -29
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/LICENSE +0 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/mini_code_cli/__init__.py +0 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/mini_code_cli/__main__.py +0 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/mini_code_cli/agent_files.py +0 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/mini_code_cli/background.py +0 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/mini_code_cli/permissions.py +0 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/mini_code_cli/plan.py +0 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/mini_code_cli/sandbox.py +0 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/mini_code_cli/subagents/__init__.py +0 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/mini_code_cli/subagents/builtin.py +0 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/mini_code_cli.egg-info/dependency_links.txt +0 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/mini_code_cli.egg-info/entry_points.txt +0 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/mini_code_cli.egg-info/requires.txt +0 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/mini_code_cli.egg-info/top_level.txt +0 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/setup.cfg +0 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/tests/test_cli_features.py +0 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/tests/test_permissions.py +0 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/tests/test_release_script.py +0 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/tests/test_runner.py +0 -0
- {mini_code_cli-0.2.1.1 → mini_code_cli-0.3.0.0}/tests/test_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: mini-code-cli
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.0.0
|
|
4
4
|
Summary: Mini Coding Agent. Allows you to easily experiment with a small coding agent.
|
|
5
5
|
Author-email: Nikolai Rozanov <nikolai.rozanov@gmail.com>
|
|
6
6
|
License-Expression: AGPL-3.0-only
|
|
@@ -91,7 +91,7 @@ given a reference implementation.
|
|
|
91
91
|
| `--url URL` | `http://0.0.0.0:30000` | API host |
|
|
92
92
|
| `--model MODEL` | — | model name |
|
|
93
93
|
| `--api-key KEY` | `$MINI_CODE_API_KEY` | API key for authentication |
|
|
94
|
-
| `--max-tokens N` |
|
|
94
|
+
| `--max-tokens N` | 32768, or half the model window | reply budget; also the output headroom used when deriving the compaction limit |
|
|
95
95
|
| `--temperature T` | `1.0` | sampling temperature |
|
|
96
96
|
| `--system-prompt TEXT` | built-in | replace the system prompt (an `--agent-md` file is appended *after* it) |
|
|
97
97
|
| `--prompt TEXT` | — | initial user prompt |
|
|
@@ -106,13 +106,20 @@ given a reference implementation.
|
|
|
106
106
|
| `--tui [auto\|on\|off]` | `auto` | fixed full-screen dashboard. `auto` enables it only on a known interactive TTY; `on` forces it; `off` uses the scrolling console |
|
|
107
107
|
| `--skills` | off | enable the `.mini` skills directory (`skill.md`s, `SKILLS.md`, runnable scripts). **`run_skill` executes those Python scripts — arbitrary code execution, even without `--enable-shell`**; only enable it for a directory you trust |
|
|
108
108
|
| `-p`, `--plan` | off | plan mode (`CURRENT_GOAL.md` / `CURRENT_PLAN.md`, printed plan, `/plan`, `/skip-plan`) |
|
|
109
|
-
| `--
|
|
109
|
+
| `--super` | off | kitchen-sink behaviour preset: plan-verify2 + strict verification, all shell/sub-agent/skill/sudo/background features, auto-mode, prompt-change recovery and dynamic todos. The model, URL and API key are left untouched |
|
|
110
|
+
| `--plan-strategy NAME` | `plan-verify2` | `plan-verify2`, `plan-verify`, `plan-verify-step` or `open-plan` (implies `--plan`) |
|
|
111
|
+
| `--allow-nudge` | off | plan mode only: ask the model to continue (or reply DONE) when it stops without a tool call, before running the plan review |
|
|
112
|
+
| `--nudge-limit N` | 1 | maximum continuation nudges per text-only stop with `--allow-nudge` |
|
|
113
|
+
| `--strict-verify` | off | use the evidence-based verification prompt for every plan review/verify stage; also verifies after `open-plan` work settles. Unproven requirements count as unfinished |
|
|
114
|
+
| `--runtime-strategy NAME` | `normal` | `normal`, `prompt-change` or `prompt-change-plan`: recover after 3 consecutive failures of the same call/tool |
|
|
110
115
|
| `--scratchpad` | off | give the agent a free-form `.mini/SCRATCHPAD.md` (plus further scratch files) for thoughts, plans and learnings |
|
|
116
|
+
| `--dynamic-todo-tracking` | off | give the agent a structured session-local todo list (`todo_write` / `todo_update` / `todo_list`), independent of plan mode and the scratchpad |
|
|
111
117
|
| `--compaction-strategy NAME` | `summarise` | `summarise`, `predict-files` or `predict-messages` |
|
|
112
118
|
| `--llm-timeout S` | `500` | HTTP timeout for LLM requests |
|
|
113
119
|
| `--tool-timeout S` | `120` | timeout for a single tool call |
|
|
114
120
|
| `--max-context-tokens N` | derived | input-token budget before the history is compacted |
|
|
115
121
|
| `--cache-dir DIR` | `~/.cache/mini/sessions/` | where session histories are stored |
|
|
122
|
+
| `--no-settings` | off | do not load, prompt for, or save session settings (useful for CI/benchmark runs) |
|
|
116
123
|
| `--restore-session PATH` | — | continue a specific previous session |
|
|
117
124
|
| `-l`, `--load-last-session` | off | continue the session recorded in the `.mini` pointer |
|
|
118
125
|
| `--all` | off | `--plan --enable-subagents --enable-shell --skills --auto-mode --sudo --background` |
|
|
@@ -132,9 +139,9 @@ parameter a model does not need is defaulted, so omitting it keeps the previous
|
|
|
132
139
|
| `edit` | replace an **exact** string (`old_string` → `new_string`); refuses a missing or ambiguous match unless `replace_all` |
|
|
133
140
|
| `grep` | regex search a file or directory; `recursive`, `include`, `ignore_case`, `line_numbers`, `max_results` (noise dirs skipped). Output is capped at 100k characters |
|
|
134
141
|
| `glob` | list files matching a glob (one per line, `**` supported), optionally against a `root`; capped at 2000 matches / 100k characters |
|
|
135
|
-
| `web_search` |
|
|
142
|
+
| `web_search` | DuckDuckGo Lite HTML search (POST), with DuckDuckGo Instant Answers and Wikipedia as fallbacks. Returns titles, URLs and snippets; never raises |
|
|
136
143
|
| `read_website` | fetch raw text/HTML of a **public http/https** URL (other schemes and private/link-local hosts are rejected; `MINI_CODE_ALLOW_PRIVATE_URLS=1` overrides); `max_chars` caps size |
|
|
137
|
-
| `run_shell_command` | run a shell command (needs `--enable-shell`); `cwd`, `timeout`, and stdout/stderr/exit code are all reported |
|
|
144
|
+
| `run_shell_command` | run a shell command (needs `--enable-shell`); `cwd`, `timeout`, and stdout/stderr/exit code are all reported. Output over 50k characters is capped in the reply and the full text is written to `.mini/tool-output/` so `read_file`/`grep` can page it |
|
|
138
145
|
| `background` | start/list/output/wait/cancel background **shell** tasks (needs `--background --enable-shell`) or **sub-agent** tasks (needs `--background --enable-subagents`); output is captured in a per-task log |
|
|
139
146
|
|
|
140
147
|
## Sub-agents
|
|
@@ -218,8 +225,11 @@ steps; it shows the last/current blocking activity rather than live-during the c
|
|
|
218
225
|
| `/reset [<n>]` | rewind to the end of turn `n` (`last` works too); drops everything after it |
|
|
219
226
|
| `/clear` | clear the screen (keeps the conversation history) |
|
|
220
227
|
| `/plan` | show the current goal + plan (plan mode only) |
|
|
228
|
+
| `/todo` | show the dynamic todo list; `/todo clear` empties it |
|
|
229
|
+
| `/image <path>` | stage a PNG/JPEG/WEBP/GIF for the next message; `/image clear` removes staged images |
|
|
221
230
|
| `/context` | show how the context window is used: tokens and percentages by category (system prompt, user/assistant messages, tool calls/outputs, reasoning, overhead) |
|
|
222
231
|
| `/background [id]` | show foreground activity + background tasks, or one task's output tail |
|
|
232
|
+
| `/settings [name|number] [value]` | show or change session settings; bare `/settings` opens the settings prompt |
|
|
223
233
|
| `/expand [n]` | show the full detail of the nth most recent tool call (default: the last one) |
|
|
224
234
|
| `/skip-plan <prompt>` | send `<prompt>` once without generating or reviewing a plan |
|
|
225
235
|
| `/help` | show this help |
|
|
@@ -270,6 +280,68 @@ scrolling console or `--tui=on` to force it. It is not part of `--all`.
|
|
|
270
280
|
> [docs/ARCHITECTURE.md](docs/ARCHITECTURE.md#rewinding-reset-and-what-it-does-to-the-files)
|
|
271
281
|
> for the files involved.
|
|
272
282
|
|
|
283
|
+
### Session settings
|
|
284
|
+
|
|
285
|
+
Settings are stored per session in the cache, never in the project’s `.mini`:
|
|
286
|
+
|
|
287
|
+
```text
|
|
288
|
+
<cache-dir>/<session-id>/settings.json
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
The file has a single current layout (`version`, `values`, `api_keys`,
|
|
292
|
+
`api_key_envs`, with keys scoped by endpoint/model); older top-level key fields
|
|
293
|
+
are ignored rather than migrated. Startup deliberately does **not** load
|
|
294
|
+
previous-session settings: the resume offer
|
|
295
|
+
uses the CLI/environment/default configuration, so no settings notes or questions
|
|
296
|
+
appear before you choose. Settings are loaded only after that choice. Resuming
|
|
297
|
+
adopts the restored session’s settings; starting a **new** session resets ordinary
|
|
298
|
+
settings to their defaults (the previous per-model API-key archive is the one thing
|
|
299
|
+
kept) and asks the provider/model questions again, pre-selecting the current provider
|
|
300
|
+
so Enter keeps it. An explicit `--model` skips the questions. The saved model and API
|
|
301
|
+
key are checked after the model is known (after the restore, or after the
|
|
302
|
+
provider/model selection).
|
|
303
|
+
|
|
304
|
+
The wizard asks for the model provider (`localhost`, `deepseek`, or a custom URL)
|
|
305
|
+
and, when needed, the API key. For DeepSeek it then asks which model to use, offering
|
|
306
|
+
the ids from the live `/v1/models` response when a key is available (otherwise the
|
|
307
|
+
stable `deepseek-chat` / `deepseek-reasoner` aliases). The DeepSeek key prompt says
|
|
308
|
+
where to create a key and that `MINI_CODE_API_KEY` is used first. When the fixed TUI
|
|
309
|
+
applies, the wizard runs inside it (arrow keys or numbers select, and a typed key is
|
|
310
|
+
masked). If you type a key, mini-code asks clearly whether to write it to the session
|
|
311
|
+
file with mode `0600`; otherwise it stays in memory for this session only. Keys are
|
|
312
|
+
scoped to the endpoint/model: selecting another model loads its stored key, or asks
|
|
313
|
+
for one when none is stored. Once the model is known, a key found for it is checked
|
|
314
|
+
against `/v1/models`; an explicit `401`/`403` rejection reopens the key prompt.
|
|
315
|
+
|
|
316
|
+
Use `/settings` to inspect or change settings. The table marks values that rebuild
|
|
317
|
+
the tool list or generated system prompt — these invalidate the LLM prompt cache.
|
|
318
|
+
Cache-impacting edits from the plain `settings>` prompt are staged until you type
|
|
319
|
+
`apply`, so a batch rebuilds the prompt once.
|
|
320
|
+
|
|
321
|
+
In the fixed TUI the centered, unboxed ASCII mark and tagline (the same mark used by
|
|
322
|
+
`--tui off`) sit above the session view and stay visible in the settings views. The
|
|
323
|
+
settings table is a navigable overlay grouped into Model & connection, Generation,
|
|
324
|
+
Planning, Compaction, Tools & permissions, Runtime limits, Display, Agent behaviour
|
|
325
|
+
and Immutable/session sections (so e.g. `verbose` lives under Display). It starts at
|
|
326
|
+
the first setting and scrolls with the selection. Up/down or numbers select;
|
|
327
|
+
left/right toggle an on/off setting or rotate through a fixed-choice setting
|
|
328
|
+
(such as `plan-strategy`) in place. Values equal to their built-in default are marked
|
|
329
|
+
`(default)`. Enter opens a focused sub-window that shows only that setting's input
|
|
330
|
+
box (or its option list), where `exit` or Esc returns to the settings table. The full
|
|
331
|
+
table (including immutable rows) is always shown. `a` stages the same feature flags
|
|
332
|
+
as the CLI `--all` preset (plan, shell, sub-agents, skills, auto-mode, sudo,
|
|
333
|
+
background); `p` stages the CLI `--super` preset; `d` stages all defaults while
|
|
334
|
+
keeping the model, URL and API key. The
|
|
335
|
+
same presets are
|
|
336
|
+
available as `/settings all`, `/settings super` and `/settings default`. Changes are staged in the
|
|
337
|
+
table until you press `s` to save; `q` quits, and if there are unsaved changes it
|
|
338
|
+
asks whether to save them or cancel the changes. The table header shows a green
|
|
339
|
+
`saved` or yellow `unsaved` badge. Plan
|
|
340
|
+
mode is its own on/off setting;
|
|
341
|
+
the plan strategy keeps a concrete value even while plan mode is off, and changing
|
|
342
|
+
the strategy does not turn plan mode on. Changing the TUI, paths, the custom system
|
|
343
|
+
prompt or the initial prompt is not allowed mid-session.
|
|
344
|
+
|
|
273
345
|
## Development
|
|
274
346
|
|
|
275
347
|
Linting, the test suite, CI and the release process are documented in
|
|
@@ -332,16 +404,71 @@ on for later turns).
|
|
|
332
404
|
|
|
333
405
|
| Strategy | What happens |
|
|
334
406
|
| --- | --- |
|
|
335
|
-
| `plan-
|
|
336
|
-
| `plan-verify` |
|
|
407
|
+
| `plan-verify2` (default) | Author a plan, then verify completion with one machine-readable verdict (`STATUS: DONE` / `STATUS: INCOMPLETE` / `STATUS: IN PROGRESS`). `DONE` ends the turn immediately, without the post-review step; an unfinished verdict re-queues the outstanding work and the agent continues, with another verify after it settles. |
|
|
408
|
+
| `plan-verify` | Author a plan, review it once the work settles, then keep the post-review step only when it calls a tool. A no-tool answer is shown to you and ends the turn without being appended to the transcript. |
|
|
409
|
+
| `plan-verify-step` | The original behaviour: same plan + review, then always run one extra step and keep whatever that step says. |
|
|
337
410
|
| `open-plan` | The agent owns a plan document at `.mini/PLAN.md` inside `--allowed-dir`, reads and updates it with the normal file tools, and the loop neither authors nor reviews a plan. |
|
|
338
411
|
|
|
339
412
|
> [!NOTE]
|
|
340
413
|
> Plan mode also changes **history compaction**: after the transcript is compacted to a summary,
|
|
341
414
|
> `CURRENT_PLAN.md` and `CURRENT_GOAL.md` are re-injected, so the agent keeps working against the
|
|
342
415
|
> same goal. With `open-plan`, the agent's `.mini/PLAN.md` is re-injected instead. When the work
|
|
343
|
-
> looks done the plan is reviewed
|
|
344
|
-
> to you (except with
|
|
416
|
+
> looks done the plan is reviewed (or, with `plan-verify2`, verified with a DONE/INCOMPLETE
|
|
417
|
+
> verdict) and any outstanding task is re-queued before the agent returns to you (except with
|
|
418
|
+
> `open-plan`, unless `--strict-verify` is on).
|
|
419
|
+
|
|
420
|
+
`--strict-verify` makes the completion check evidence-based instead of trust-based. The verifier
|
|
421
|
+
must restate the goal as concrete requirements, cite the tool call/output that proves each one, and
|
|
422
|
+
mark missing or ambiguous evidence as unfinished. It applies to `plan-verify`, `plan-verify2` and
|
|
423
|
+
`plan-verify-step`, and with `open-plan` it adds a verification pass after the work settles without
|
|
424
|
+
taking ownership of the agent's plan document.
|
|
425
|
+
|
|
426
|
+
`--allow-nudge` adds a completion checkpoint to any plan strategy. When the model replies without
|
|
427
|
+
a tool call and the text does not explicitly say `DONE` / complete / finished, the loop appends a
|
|
428
|
+
short “continue with the next tool call, or reply DONE” message instead of immediately paying for a
|
|
429
|
+
plan review. `--nudge-limit N` controls how many nudges are allowed per text-only stop (default 1).
|
|
430
|
+
After the limit, the normal plan strategy takes over. This is useful for thinking models that tend
|
|
431
|
+
to emit an intermediate “let me do X” message and stop.
|
|
432
|
+
|
|
433
|
+
### Runtime recovery — `--runtime-strategy`
|
|
434
|
+
|
|
435
|
+
The runtime strategy decides what happens when tool use keeps failing. It is independent of plan
|
|
436
|
+
mode and applies to every turn:
|
|
437
|
+
|
|
438
|
+
| Strategy | What happens |
|
|
439
|
+
| --- | --- |
|
|
440
|
+
| `normal` (default) | No automatic prompts; the model sees tool errors and decides. |
|
|
441
|
+
| `prompt-change` | After three consecutive failures of the same call (same command/path/query) or of the same tool with different inputs, the loop injects: “You have tried TOOL N times and it failed. Rethink your approach and try something else.” It also shows the last failure. A success resets the streak; at most three prompts are issued per turn. |
|
|
442
|
+
| `prompt-change-plan` | The same prompt, then a fresh planning request for the current goal. In `open-plan` the loop injects the recovery plan but does not overwrite the agent's `.mini/PLAN.md`. |
|
|
443
|
+
|
|
444
|
+
Both recovery strategies are heuristics: they are meant to break repetitive command/tool loops
|
|
445
|
+
without changing the model's overall instruction. When `web_search`/`read_website` are available,
|
|
446
|
+
the prompt also tells the model to search the documentation or the web before retrying.
|
|
447
|
+
`runtime-strategy` and `strict-verify` are also available in `/settings`.
|
|
448
|
+
|
|
449
|
+
### Dynamic todo tracking — `--dynamic-todo-tracking`
|
|
450
|
+
|
|
451
|
+
This is separate from the scratchpad. It registers three structured tools and tells the agent to
|
|
452
|
+
keep a short checklist:
|
|
453
|
+
|
|
454
|
+
- `todo_write` replaces the list with a JSON array of `{"content", "status"}` objects;
|
|
455
|
+
- `todo_update` changes one item by id (`pending`, `in_progress`, `completed`);
|
|
456
|
+
- `todo_list` shows the current list.
|
|
457
|
+
|
|
458
|
+
The store is session-local (`<cache-dir>/<session-id>/todos.json`), not a project file, so it does
|
|
459
|
+
not pollute the worktree or a benchmark's filesystem checks. `/todo` shows it and `/todo clear`
|
|
460
|
+
empties it. A scratchpad remains useful for free-form notes; the todo list is for tracked,
|
|
461
|
+
verifiable steps.
|
|
462
|
+
|
|
463
|
+
### Images — `/image` and image-aware `read_file`
|
|
464
|
+
|
|
465
|
+
`/image PATH` stages a PNG/JPEG/WEBP/GIF for the next user message. The file is copied into the
|
|
466
|
+
session cache and the conversation stores a small reference, not base64; the bytes are resolved
|
|
467
|
+
into a data URI only when the request is built. `/image clear` drops staged images.
|
|
468
|
+
|
|
469
|
+
The agent's `read_file` is also image-aware: reading a supported image attaches it as an image
|
|
470
|
+
content block after the tool result. `read_file` still handles text as before. Images count toward
|
|
471
|
+
the context estimate and are flattened to `[image: name]` in plan/review/compaction prompts.
|
|
345
472
|
|
|
346
473
|
### Scratchpad — `--scratchpad`
|
|
347
474
|
|
|
@@ -416,26 +543,36 @@ Because a rollover leaves no trace in the transcript (the old turns really are g
|
|
|
416
543
|
console says in plain terms what happened — all of it without `--verbose`:
|
|
417
544
|
|
|
418
545
|
```
|
|
419
|
-
[!] Compacting the conversation: 42 messages -> a summary (51000 tokens in,
|
|
546
|
+
[!] Compacting the conversation: 42 messages -> a summary (51000 tokens in, 32768 reserved for the reply > 60000 budget). The current turn (1 message) is kept verbatim.
|
|
420
547
|
[!] Summary preview: The user asked for a token-based compaction trigger, then fixed ...
|
|
421
548
|
[!] Compacted history_0.json (42 messages) into a summary; history_1.json now starts with 3 messages (summary + 1 kept message).
|
|
422
549
|
```
|
|
423
550
|
|
|
424
551
|
So you can see *what* was folded away (a preview of the summary itself), *how much* (the
|
|
425
552
|
message count of the segment that was closed), *where it went* (`history_0.json` closed,
|
|
426
|
-
`history_1.json` started) and that nothing you just typed was lost.
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
553
|
+
`history_1.json` started) and that nothing you just typed was lost. The summary request is
|
|
554
|
+
itself size-bounded, so a single enormous tool output cannot make compaction overflow the
|
|
555
|
+
model's context window. If the summariser answers with an empty summary twice, or the call
|
|
556
|
+
fails, compaction falls back to a deterministic mechanical summary (the goal plus the newest
|
|
557
|
+
turns) and still rolls the segment over — keeping the over-long transcript would make every
|
|
558
|
+
later request fail.
|
|
430
559
|
|
|
431
560
|
### Exiting — the good-bye box
|
|
432
561
|
|
|
433
|
-
Quitting (`/quit`, `exit`, or EOF on stdin) saves the session
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
562
|
+
Quitting (`/quit`, `exit`, or EOF on stdin) saves the session, prints the centered
|
|
563
|
+
yellow Mini Code mark and tagline above the box, and then prints a short content-width
|
|
564
|
+
yellow box: the version, a sign-off, and what the session left behind — session id,
|
|
565
|
+
model, folder, the history segments on disk, how many turns were recorded, run duration,
|
|
566
|
+
token / call totals, background tasks cancelled on exit, and a `--load-last-session`
|
|
567
|
+
resume hint.
|
|
437
568
|
|
|
438
569
|
```
|
|
570
|
+
__ __ ___ _ _ ___ ___ ___ ___ ___
|
|
571
|
+
| \/ |_ _| \| |_ _| / __/ _ \| \| __|
|
|
572
|
+
| |\/| || || .` || | | (_| (_) | |) | _|
|
|
573
|
+
|_| |_|___|_|\_|___| \___\___/|___/|___|
|
|
574
|
+
a minimal coding agent CLI
|
|
575
|
+
|
|
439
576
|
╔══════════ MiniCodeCLI v0.1.1.2 - goodbye ═════════════════════╗
|
|
440
577
|
║ Goodbye, and thanks for using MiniCodeCLI! ║
|
|
441
578
|
║ ║
|
|
@@ -457,9 +594,62 @@ says what went wrong in red, so it does not get a cheerful summary box on top. W
|
|
|
457
594
|
the old per-field `Token usage (this session)` block is printed above it as well.
|
|
458
595
|
|
|
459
596
|
|
|
597
|
+
## Benchmarks (academic evaluation)
|
|
598
|
+
|
|
599
|
+
Everything benchmark-related lives in **[`benchmarks/`](benchmarks/README.md)** — the harness,
|
|
600
|
+
its tests, its dependencies and its scripts:
|
|
601
|
+
|
|
602
|
+
```bash
|
|
603
|
+
python -m pip install -r benchmarks/requirements.txt # harbor (from its branch), swebench, vllm
|
|
604
|
+
# one 3.12 env is enough: harbor needs >=3.12, mini-code supports 3.10+
|
|
605
|
+
benchmarks/scripts/setup_external_repos.sh # the TB 2.1 task set (data: clone, not pip)
|
|
606
|
+
benchmarks/scripts/apply_local_fixes.sh # re-apply the ignored-checkout fixes
|
|
607
|
+
|
|
608
|
+
python benchmarks/run_benchmarks.py --dataset swe-bench --agent mini-code --mode short_eval
|
|
609
|
+
python benchmarks/run_benchmarks.py --dataset swe-bench-lite --agent all --mode short_eval
|
|
610
|
+
python benchmarks/run_benchmarks.py --dataset terminalbench-2.1 --agent all --mode short
|
|
611
|
+
|
|
612
|
+
# On an existing Slurm GPU allocation: start vLLM, wait for /health, then run
|
|
613
|
+
# one agent at a time (variables at the top of the script):
|
|
614
|
+
benchmarks/scripts/run_benchmark_slurm.sh
|
|
615
|
+
# Or generate/submit an sbatch job for the full matrix on 1-4 GPUs:
|
|
616
|
+
benchmarks/scripts/submit_benchmark_slurm.sh
|
|
617
|
+
# Prepare/verify the Terminal-Bench SIFs on a CPU partition:
|
|
618
|
+
benchmarks/scripts/submit_prepare_tb_sifs.sh
|
|
619
|
+
```
|
|
620
|
+
|
|
621
|
+
Both SWE-bench splits work on this cluster and need no extra repository — `swe-bench-lite`
|
|
622
|
+
is the same harness, the same published instance images and the same grading, only the
|
|
623
|
+
HuggingFace dataset changes. Measured on the Docker-less H200 with `--limit 5`,
|
|
624
|
+
`--agent all`: Verified 10/15 (mini-code 2, pi 4, claude-code 4) and Lite 12/15
|
|
625
|
+
(mini-code 3, pi 4, claude-code 5); Terminal-Bench 2.1 scores per task but not yet as a
|
|
626
|
+
campaign (one task: reward 0.0, nine verifier tests, no exception).
|
|
627
|
+
|
|
628
|
+
Each run writes `results/<run-id>/summary_results.csv` — one row per agent, with
|
|
629
|
+
`trials, resolved, pass_rate, mean_reward, mean_seconds`. `--mode short` is a smoke run
|
|
630
|
+
(3 tasks, no grading), `short_eval` grades those 3, `full` runs everything, and `--dry-run`
|
|
631
|
+
prints every command and starts nothing.
|
|
632
|
+
|
|
633
|
+
The harness runs coding agents against **Terminal-Bench 2.x** and **SWE-bench Verified/Lite** and
|
|
634
|
+
compares them — mini-code with several settings, Claude Code, Pi and a deterministic `mock`
|
|
635
|
+
agent — by wrapping each benchmark's own official harness (`harbor`, `tb`,
|
|
636
|
+
`swebench.harness.run_evaluation`). It supports Docker and Apptainer, exports a CSV and ships an
|
|
637
|
+
analyser. Every agent gets the same instructions from one file,
|
|
638
|
+
`benchmarks/agents/agent.md`, so a comparison cannot be explained by three different prompts.
|
|
639
|
+
|
|
640
|
+
See **[benchmarks/README.md](benchmarks/README.md)** for prerequisites, the two harness forks and
|
|
641
|
+
their branches (installed from GitHub, and cloned into `external_repos/` for local development by
|
|
642
|
+
`benchmarks/scripts/setup_external_repos.sh`), the `plan` / `run --csv` / `analyze` commands
|
|
643
|
+
underneath the entry point, the Docker and Apptainer variants, the configs
|
|
644
|
+
(`benchmarks/configs/ornith_30b.json` for TB 2.0 + SWE-bench, `terminal_bench_21.json` for the
|
|
645
|
+
local TB 2.1 checkout), and what a run produces.
|
|
646
|
+
|
|
460
647
|
## Serving a model locally
|
|
461
648
|
|
|
462
|
-
|
|
649
|
+
For a one-GPU quick start, `scripts/run_model.sh` starts the small
|
|
650
|
+
`ornith-ai/Ornith-1.5-35B-A3B` checkpoint on port 30000 and waits for `/health`.
|
|
651
|
+
Edit its model/tensor-parallel line for a larger checkpoint. Tested with vLLM
|
|
652
|
+
v0.30 (tool calling enabled):
|
|
463
653
|
|
|
464
654
|
```bash
|
|
465
655
|
vllm serve ornith-ai/Ornith-1.5-397B-FP8 \
|
|
@@ -481,7 +671,7 @@ If you use `mini-code-cli` in your research or writing, please cite it:
|
|
|
481
671
|
author = {Rozanov, Nikolai},
|
|
482
672
|
title = {mini-code-cli: A minimal, dependency-light coding agent},
|
|
483
673
|
year = {2026},
|
|
484
|
-
version = {0.
|
|
674
|
+
version = {0.3.0.0},
|
|
485
675
|
howpublished = {\url{https://github.com/ai-nikolai/mini-code-cli}},
|
|
486
676
|
note = {A no-bloat, dependency-light agent CLI for experimenting.}
|
|
487
677
|
}
|