Repository navigation
feat(dashboard,core,server): keep new conversations listed, Context window, GitHub links, sent pictures - #451
Conversation
|
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: afb256c957
ℹ️ 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".
The engine counts each prompt by kind (system, tools, user, thinking, text, tool calls, tool results, images) at its one render site and returns them as `promptParts` on ChatResult and the stream's final chunk; the parts sum to `promptTokens`. Families whose render is not counted report none. The server keeps the eight kinds on each ok trace row, links rows to the agent's session and turn (`client_session`, `client_call`, `client_turn`), and writes a per-session size file under ~/.mlx-node/metrics/context/ (numbers and ids only, 0600, at most 1,000 files, skipped when metrics are off). Co-Authored-By: Claude Opus 5.5 <[email protected]>
…b links, sent pictures - Chat/Work list: a new conversation stays listed while its first turn waits for the model load, also after leaving and returning to the page and through a failed list reload. - Context window panel: a measured count (answer ends, a per- conversation context record, a trace join), the agent folder's parts, and the engine's exact parts when its size file lines up; `~` only on estimates. - GitHub ref links with hover cards; the token never reaches a log, an answer, the page or the agent, and GitHub text is redacted before any cut; another account resets the page store. - Sent-image thumbnails with a hover card, a viewer and Copy. - Model switch marks, Work "Add folder", web_fetch `offset` to read a long page in parts. - Perf: host state push floor and idle clock labels, a row click selects at once and the thread follows two frames later, no thread kept after a switch. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…of its own An empty message (an empty tool result, an empty assistant turn) gets no anchor in the counted render, so its markup went to a neighbour and the parts still summed. Now the per-message list is dropped when such a message sits between neighbours of its own role (the kinds stay exact), and no parts are returned in any other case. Co-Authored-By: Claude Opus 5.5 <[email protected]>
qwen3_moe landed on main without the counted render, so its turns gave no prompt parts. It renders through the same Jinja template as qwen3. Co-Authored-By: Claude Opus 5.5 <[email protected]>
15b8991 to
ed4f773
Compare
Follow-up to #456. The squash merge missed one line: the test-only `SuppressedOpenPagedBackend::finalize_turn` in `paged_turn.rs` builds a `ChatResult` without the `prompt_parts` field added by #451, so `cargo test --lib -p mlx-core` fails to compile on `main`. One line: `prompt_parts: None`. Checked with `cargo clippy --all-targets -D warnings` (clean).
Summary
Started as a fix: a new Chat/Work conversation vanished from the list after leaving and returning to the Chat page while its first turn waited for the model load. The PR now also carries the Control Panel work built on the same pages.
~/.mlx-node/chat/context/, or a trace join), the agent folder's parts, and the engine's exact parts when its size file lines up.~shows only on estimates.mlx-core): counts each prompt by kind at the native render and returnspromptPartsonChatResultand the final stream chunk. The parts sum topromptTokens. Families that are not counted (gemma4, k2_horizon, qianfan_ocr, hy_v4_flash, qwen4_exp) report none.~/.mlx-node/metrics/context/<session>.jsonwith numbers and ids only, mode 0600, at most 1,000 files, and not when metrics are off. The dashboard schema moves to v16.web_fetchoffset, to read a long page 12,000 characters at a timeReview
A Codex adversarial review ran in two parts. The diff is over 1 MB, so the dashboard tests were left out. It found 11 issues:
web_fetchoffsets on a page that changes between calls: the design relies on the provider cacheTest plan
yarn typecheckvp lint --type-aware --type-checkon the changed packagesvp fmtvp test packages/dashboard __test__/server packages/desktop: 401 files, 10,023 tests pass, after the rebase onmaincargo test -p mlx-core --lib prompt_parts,cargo clippy,cargo fmtpromptPartssums topromptTokens(178 = 178), sync and stream🤖 Generated with Claude Code