From 05afde4b7acefe63e4e88231d8ff46a4e4b5243e Mon Sep 17 00:00:00 2001 From: Marcos Paulo Date: Tue, 20 Oct 2026 17:47:30 -0300 Subject: [PATCH] docs: lessons from the agent runs in the MiniMax brief, OpenCode route, file-viewer status Co-Authored-By: Claude Sonnet 5.5 --- specs/agents/README.md | 3 +++ specs/agents/minimax-m3-1-flash.md | 12 +++++++++++- specs/file-viewers/spec.md | 9 +++++++-- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/specs/agents/README.md b/specs/agents/README.md index 3e687ff..83fe41f 100644 --- a/specs/agents/README.md +++ b/specs/agents/README.md @@ -45,3 +45,6 @@ Two Claude Code harness agents at once (collab-ot + server-hardening) hit `429 r ## Lesson 2026-10-20 (3): MiniMax plan quota (error 2067) and the GLM fallback After about 2 hours of heavy use (4 research and coding agents) MiniMax answered every request with `429 rate_limit_error: The Token Plan usage limit has been reached (2067)`; this is the plan's own quota, not a burst limit (a direct curl with 20 tokens fails the same way), so waiting minutes does not help and the owner's "no limit until 25 Oct" did not hold for this key at that moment. Fallback: GLM 5.3 Flash on Ollama Cloud through Pi: `scripts/pi-agent.sh scripts/mm/.md [provider model]` (default `ollama-cloud glm-5.3-flash`). It embeds this brief and the six `notescraft-*` skills in the prompt because Pi does not load `.claude/skills`. GLM allowed 3 concurrent agents earlier (see memory `agent-model-routing`); run tasks with disjoint OWNS side by side. Check MiniMax again with the curl in this section before switching back: `curl -s https://api.minimax.io/anthropic/v1/messages -H "x-api-key: $KEY" -H "anthropic-version: 2023-06-01" -H "content-type: application/json" -d '{"model":"MiniMax-M3.1-Flash","max_tokens":20,"messages":[{"role":"user","content":"say ok"}]}'` (read `$KEY` from `~/.pi/agent/models.json`, never print it). + +## OpenCode with the free MiniMax M3.1 Flash (2026-10-20) +The plan key's quota ran out (2067), but OpenCode Zen lists `opencode/minimax-m3.1-flash-free`. `scripts/oc-agent.sh ` runs it in an isolated `XDG_CONFIG_HOME` (the global OpenCode config makes `opencode run` fail with "default agent plan is a subagent"), attaches rules + skills + brief as one file, closes stdin (an open stdin hangs `opencode run`) and logs to `.mm-agents/`. Free promos are time-limited (OpenRouter/Zen about 22 Oct). Check `summary.log` AND the tail of the `.jsonl`: a "done" line does not mean the agent finished. diff --git a/specs/agents/minimax-m3-1-flash.md b/specs/agents/minimax-m3-1-flash.md index 7383fad..f206a47 100644 --- a/specs/agents/minimax-m3-1-flash.md +++ b/specs/agents/minimax-m3-1-flash.md @@ -37,7 +37,7 @@ This repo ships project skills in `.claude/skills/` and path rules in `.claude/r - Run, in this order, and fix every failure at the root cause (never weaken a test, never add an `allow` to pass): 1. `timeout 300 cargo test -p ` 2. `cargo clippy -p --all-targets -- -D warnings` - 3. `cargo fmt -p ` + 3. format ONLY your own files: `rustfmt --edition 2024 ...` (never `cargo fmt -p` or `--all` when other agents share the crate: it rewrites their unfinished files) 4. the extra commands the task names - Do not claim success unless these passed in your last run. Paste the final test summary line. @@ -49,6 +49,16 @@ This repo ships project skills in `.claude/skills/` and path rules in `.claude/r ## Final report (max 15 lines) What is implemented; public API signatures; test counts and the last `cargo test` summary line; every file you created or changed; anything skipped, any dependency you needed but lacked, any rule you could not satisfy. +## Lessons from the 2026-10-20 runs (checked against what the agents delivered) +- `en.toml`: add a new `[ui.x]` table at the END of the `[ui.*]` tables, never between keys of another table (one insertion split `[ui.settings-view-calendar]` and broke two tests). After editing run `python3 -c "import tomllib;tomllib.load(open('crates/i18n/locales/en.toml','rb'))"`. +- If lib tests print raw keys like `ui.foo.bar` instead of text, the i18n crate was built from an older `en.toml`: `touch crates/i18n/src/i18n.rs` and rerun. Do not "fix" the test. +- Never write a call to an API you did not read: open the function in the repo first. Invented egui or engine method names were the most common compile error (`egui::Vertex`, `semibold_with`, `on_hover_text` on a `Button`). +- Keep each file under 400 lines and each source dir under 13 loose `.rs` (`cargo xtask tree`); put tests of a big file in `/tests.rs`. +- Another session may leave files that do not compile. If `cargo check` fails only in files outside OWNS, say so in the report and verify your part with the narrowest test filter; never edit those files. +- Do not run long commands without a `timeout`; stdin is closed, so never start anything interactive. +- Your final message IS the report. If you run out of room, write the report first and the extras later. A last message like "Now the integration test:" counts as unfinished work. +- The launcher's `done` line only means the process ended. Quota errors (429, 2067) end a run silently: the owner checks the tail of the `.jsonl`. + --- TASK: diff --git a/specs/file-viewers/spec.md b/specs/file-viewers/spec.md index 619979e..b001e94 100644 --- a/specs/file-viewers/spec.md +++ b/specs/file-viewers/spec.md @@ -47,10 +47,15 @@ Every file in the vault shows in the Explorer with the right icon and opens in t 1. [x] Pure crate `crates/annotate` (L1): the annotation model, JSON load and save with validation, hit-testing for the eraser, bounds, undo and redo stack, coordinate transforms, tests and property tests. Done 2026-10-20 by GLM 5.3 Flash via Pi (19 tests, clippy clean, verified). Brief `scripts/mm/annotate-core.md`. 2. [x] Explorer shows all files; `TabKind` kinds, icons, sidecar hiding, a placeholder card for kinds without a viewer, Settings > Files toggles `show_all_types` and `show_annotation_files`. Engine settings by GLM 5.3 Flash via Pi (brief `scripts/mm/explorer-all-files.md`); UI half by Claude 2026-10-20. Open: a Settings row for `hidden_extensions` (list editor). 2b. [x] Engine commands `file.info`, `file.hash`, `file.neighbours`, `image.annotations.load/save` and header-only image sizing (`crates/engine/src/viewers/`). Done 2026-10-20 by MiniMax M3.1 Flash via the harness; verified. Brief `scripts/mm/viewer-commands.md`. -3. Image lightbox view (zoom, pan, fit, rotate, neighbours, info, copy, reveal, phone gestures). +3. [x] Image lightbox view (`views/image_view/`: zoom, pan, fit, rotate, neighbours, info; 5 integration tests). Done 2026-10-20 by MiniMax M3.1 Flash via OpenCode Zen (free route); verified from a clean checkout. Open: copy and reveal buttons, phone pinch gestures check on a device. 4. Annotation tools over the lightbox using the core crate; sidecar read/write through engine commands `image.annotations.load/save`; note-embed overlay. -5. Video/audio tab, code highlighting, PDF pages, info card for other files. +5. [~] Info card for audio/video/pdf/other and `code_view` highlighter done (GLM); Video tab and PDF tab done (MiniMax, `views/media_view/`; no elapsed time, no page total). Open: audio playback (needs a crate decision), wiring `code_view` as a read-only tab, thumbnails. 6. Flattened export (after the `png` decision), annotation sync conflict handling, thumbnails (later). ## Designs PaperCraft project NotesCraft, page "File viewers"; exports (dark and `-light`) in `design/files/`, rated in `design/files/RATING.md` (overall 8.2 of 10, with the fixes to apply during the build): 01 Explorer all files, 02 Image lightbox, 03 Image annotate, 04 Mobile lightbox, 05 Mobile annotate, 06 Video viewer, 07 Code viewer, 08 PDF viewer, 09 Other file card, 10 Settings Files. + +## Build log +- 2026-10-20: briefs written: `image-lightbox` (MiniMax harness), `info-and-code-viewers` and `hidden-extensions-row` (GLM via Pi) launched in parallel; `image-annotate-ui` queued behind the lightbox; media (video/audio) and PDF viewers need a spec pass on decoding first (ffmpeg on desktop, crates/pdf for PDF pages). +- Findings for the media and PDF viewers: note embeds already play video through `ffmpeg` when installed (`crates/ui-egui/src/shell/app/video.rs`, frames to raw RGBA) and render PDF pages (`pdf_page` in `shell/attachment_drop/images.rs`). The tab viewers reuse those paths instead of adding decoders: Video tab = that player at full size with a seek bar; Audio tab = ffmpeg audio decode is out of scope, so show the info card plus "Open with the system" until a playback crate is approved; PDF tab = page raster from the same code with next/previous page and zoom. `ffmpeg` and `ffprobe` exist on this machine (`/opt/homebrew/bin`). +- 2026-10-20 (evening): `image-annotate` (draw tools + sidecar) and `publish-commands` (engine) running on the free MiniMax route; `agy` still out of quota (resets in about 96 h).