Repository navigation
feat(agent,dashboard): require mlx-agent v0.3.10 and read its stored counts - #460
Conversation
Raise MLX_AGENT_MIN_RELEASE to mlx-agent-v0.3.9; a managed v0.3.8 is now agent-too-old. Move the harness tag, the dev note and the agent-update fixtures that name the current minimum. v0.3.9 writes a schedule before it confirms it: the scheduleOnDisk comment says so and the wait stays. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Work's agent env sets MCP_INIT_STRATEGY=blocking over any inherited value: a turn waits up to the agent's 2 s grace for MCP servers still in their handshake, so the model reads "MCP server connected" rather than "MCP servers currently connecting". Chat's host already waits for its one server (mlx_web) before a prompt, so its fixed env stays as it is. Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Cold count: the newest stored turn_completed's _meta.totalTokens (v0.3.9 stamps the measured count its session/prompt reply gives) is the conversation's measured use while it holds: an end on the model's answer, on the conversation's model, nothing after it, no rewind marker after it (endUsed of the session detail, endCount). It wins over the context record, which stays the count of sessions an older agent wrote and the cold source of the agent's split. A live turn_completed's count moves the count also after the turn's reply (countedEnd). - Compaction: auto_compact_completed's summary_tokens rides on the compaction entry; the Summary part takes the newest finished compaction's size over the folder's, and the "Last compacted" line adds "· summary ~n tokens". - Threshold: autoCompactThresholdPercent of the session's signals.json first; the env/home/system guess stays for sessions without it. - Tests: a tagged session_prefix counts as rules; the fake agent can stamp a turn end's count and a compaction's summary size; the real-agent compaction test checks the stamped end, summary_tokens against the folder's bytes / 4 summary, and signals.json; the rewind test expects the summary size on its mark. Co-Authored-By: Claude Opus 5.5 <[email protected]>
v0.3.9 stamps the raw count on a turn end that did not end on an answer and no count on a compaction's end. Raise MLX_AGENT_MIN_RELEASE to mlx-agent-v0.3.10; a managed v0.3.9 is now agent-too-old. Move the harness tag, the dev note and the agent-update fixtures that name the minimum (the v0.3.9 floor fixture of the candidate walk stays main's). Co-Authored-By: Claude Opus 5.5 <[email protected]>
A stored turn end's count stops holding once an auto_compact_completed line follows it (endUsed is null then, as after a rewind marker): the history changed after it. The cold use is then the last stored count, the compaction's tokens_after that v0.3.10 stamps, as an estimate, until the next answered turn end. The context record and the trace rows already stop holding after a finished compaction. The fake agent stamps a compaction's tokens_after like v0.3.10. Tests pin the compaction case, a stopped turn's stamped estimate (never measured), the cold count after Compact now, and on the real agent the stored compaction end's _meta.totalTokens. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… time The fake agent ended a typed `/workflow` turn with a fixed `elapsed_ms: 28`. The host places a turn's start at agentTimestampMs - elapsed_ms and drops a queued run wake when that start is after the run's end (`runWakeEnds`). When more than 28 ms passed between the run's cancelled update and the turn_completed line (a loaded machine), the `/workflow stop` turn read as one that started after the run's end, the wake was dropped, and "a typed /workflow stop names you, and its wake stays due" failed with wakeDue false. The fake now reports the time since the prompt came, as the agent does. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a89ed0bb12
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
A `!cmd` turn ends with end_turn but stores the agent's estimate, so the cold count takes the stored end as measured only after a model call, the same rule the live commit uses. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…st initializers #458 and #460 each added a struct field; a test written against the other branch kept the old field list, so main stopped compiling the mlx-core lib tests and the qwen35_cuda_prefill_bench integration test. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e with D1 count (#461) Live at https://portato.void.app (deployed from this tree). ## Site | Where | Before | After | |---|---|---| | Landing hero | Python code chat | PDF card-statement chat + mesh backdrop | | Landing chat card | `merge_intervals` code block | letter-photo turn (app's chat thread) | | /portato hero | Python code chat | Qwen3.8-27B reads a photo of a made-up Japanese tax letter | | Photo tile | static picture | the app's `ImageTiles`: hover card, viewer, Copy (small island) | | Work example + Session tab | old mock | real woff-build PR #91 session, speeds scaled per #456 | | Control Panel | screenshot gallery | 7-view tour of the app's components with generated mock data (`/panel-frame`) | | /portato header | mlx-node mark | Portato icon | - Removed: the Python conversation, `CodeBlock`, the code-highlighting build, `@shikijs/*`, the screenshot gallery and its shots. - Default `SITE_URL` is now `https://portato.void.app` (`vite.config.ts`, `void.config.ts`, `check-site.mjs`). - README line 42 and `ChatWork.tsx`: "A file edit is shown as a diff, and each command shows its output." ## `/download` ``` GET /download ─► OS: Sec-CH-UA-Platform, else User-Agent; arch: Sec-CH-UA-Arch / Linux UA ├─ mac → Portato-<v>-arm64.dmg ├─ windows → Portato-<v>-win32-arm64-setup.exe ├─ linux arm64 → Portato-<v>-linux-arm64.deb └─ x86 / phone / bot / failure → releases/latest release list: GitHub API (optional GITHUB_TOKEN secret, cached 10 min) └─ API fails → tag from the releases/latest redirect, names as release-version.ts builds them each GET → one D1 row in `downloads` (at, os, tag, target); no IP, no user agent ``` - Every "Download" button points at `/download`; on Windows/Linux the label reads "Download for Windows/Linux". - The site is now a hybrid Void deploy: every request goes through the Worker (pages are the same prerendered files). - Read the count: `cd website && CI=1 void db execute --remote --yes "select os, tag, count(*) from downloads where target = 'file' group by os, tag"`. ## Also in this PR - **One lockfile:** `website` is a root workspace; `website/yarn.lock` is gone (`installConfig.hoistingLimits: "workspaces"` keeps the site's packages in `website/node_modules`). All 1,014 existing root lock entries resolve the same; 278 packages added. The root install now runs 6 build scripts (esbuild ×3, workerd, better-sqlite3, `void prepare`). - **main build fix:** #458 + #460 left two test initializers without a new field (`turn_history_pin` in `paged_turn.rs`, `prefix_breakpoint_hints` in `qwen35_cuda_prefill_bench.rs`), so Clippy, cargo build/test and e2e fail on `main`. Both now use the value every other test uses. ## Checks `tsc`, `vp run build`, `check-portato-mock`, `check-numbers`, `check-site`, `check-samples`, `vp fmt --check` on changed files: pass. Route tested in `vp preview` and live (API blocked → fallback still gives the file; HEAD not counted). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
Moves Portato to mlx-agent v0.3.10 and uses the counts and context facts the agent now stores.
Agent releases
_meta.totalTokens, noReplay restart seed,summary_tokens,signals.jsonautoCompactThresholdPercent, tagged session prefix), scheduler persist before reply, rewind MCP re-announce, subagent billed tokens,.mlx-agentpublish.auto_compact_completedcarries_meta.totalTokens = tokens_after, so a restart right after "Compact now" no longer seeds the pre-compaction count (which could compact the history a second time).!cmd) store the estimated total, so Stop after a large tool result no longer lowers the count.App changes
MLX_AGENT_MIN_RELEASE=mlx-agent-v0.3.10; a managed v0.3.9 is agent-too-old; harness and fixture tagsMCP_INIT_STRATEGY=blocking(Chat keeps its env; its host already waits formlx_web)readCompactionand the transcript entry carrysummary_tokens; Summary part and "Last compacted" line use itThresholdReaderreads<session>/signals.jsonautoCompactThresholdPercentfirst/workflowturn end reports its real elapsed time (fixes a one-timewakeDueflake under load)docs/dashboard.mdminimum, Work env, Context panel sourcesVerification
yarn typecheck,vp check: pass.vp test --run packages/dashboard packages/agent __test__/cli: 7510 passed; the only failures need the native addon (not built in the worktree).auto_compact_completed_meta.totalTokens=tokens_after,summary_tokens= the summary's bytes/4, andsignals.jsonthreshold = 85.🤖 Generated with Claude Code