Skip to content

0.9.12: perf fold, quieter chrome, compatible hosts, delete staged runtime_contract - #5667

Merged
Hmbown merged 14 commits into
mainfrom
grok/v0912-working-copy-20260827
Aug 28, 2026
Merged

0.9.12: perf fold, quieter chrome, compatible hosts, delete staged runtime_contract#5667
Hmbown merged 14 commits into
mainfrom
grok/v0912-working-copy-20260827

Conversation

@Hmbown

@Hmbown Hmbown commented Aug 27, 2026

Copy link
Copy Markdown
Owner

No-Issue: release-train consolidation for already-linked changes.

Summary

Folds Aditya's startup/token-accounting perf (#5664/#5665) and Isabel's #5587 test-only #[cfg(test)] slice (#5666) onto current main, then:

  • Hosted Chat Completions backends (Baseten, Groq, Cerebras) are Compatible setup templates, not new ProviderKind variants. Same shape as SenseNova / OMP catalog rows.
  • MCP manager copy names the server, the failure, and one command (Codex-shaped).
  • Idle metrics omit zeros. Working chrome says in the current.
  • Deletes nine uncompiled runtime_contract/ staging files. Live contracts remain model.rs and termination.rs.
  • Dead-code budget 448 → 372.
  • Playbook: docs/design/TUI_DECONSTRUCTION.md (consolidate before extract; no micro-crates).

Testing

  • python3 scripts/check-provider-registry.py
  • ./scripts/dev-test.sh config provider_templates:: (8 passed)
  • python3 scripts/check-dead-code-budget.py (372, locked)

Do not merge red required CI. Do not merge #5576 / #5628.

AdityaVG13 and others added 12 commits August 27, 2026 14:32
strace census on the doctor path showed 88.7% of syscall time in futex
with 45 clone3 spawns: build_runtime() built a full multi-thread runtime
(one worker per CPU, 16MiB stacks each) for a read-only diagnostic that
uses none of it. Cap workers at 2 for Commands::Doctor only; interactive
sessions and servers keep default sizing. Verified on spark-1672
(aarch64): clone3 45->27, futex calls 265->99, doctor wall 45.4->42.8ms,
--help output byte-identical, --version floor unchanged.
bundled_models_dev_catalog() re-parsed the ~50KB snapshot at every call
site: the client route path, provider picker, provider lake, and fleet
identity each paid an independent serde parse. Return a &'static catalog
backed by OnceLock — the asset is include_str! constant, so sharing the
parsed form is immutability-safe. Doctor wall is unchanged (the init path
only parses once either way); this removes redundant parses on multi-call
paths.
…'s rustc spawns

RustC::resolve() proved presence by executing 'rustc --version' and
discarding stdout; doctor's rustc_version() then launched a second
rustc process to read the same banner. Each launch loads libLLVM.
probe_executable_capturing() now records the banner during the probe
(OnceLock), and the diagnostics path consumes it after an available()
check. Verified on spark-1672 (aarch64): execve(rustc) 2->1 per run,
doctor wall 42.8->37.6ms (-12%, n=60), 'rust:' line byte-identical to
the toolchain's own 'rustc --version', help output unchanged.
codewhale eval is a sequential offline tool-loop; it needs no async
concurrency, so build its runtime with the same 2-worker cap doctor uses
instead of one worker per CPU. Interleaved A/B on spark-1672 under load
9-11: eval wall -8/-10/-6 percent across three OLD/NEW batch pairs;
thread spawns for the command drop from ~45 to 5. Interactive surfaces
unchanged.

style(tui): rustfmt the runtime builder chain
setup --status, sessions listing, and session diagnostics share the
doctor dispatch shape: read-only, short-lived, no async concurrency
need. Extend diagnostic_worker_count to cover them via a structured
match mirroring telemetry_command_is_read_only. Interleaved A/B on
spark-1672 for 'setup --status' (-17/-21/-16 percent across three batch
pairs, NEW wins all three); interactive and mutating surfaces unchanged.
…ercent

The persisted models.dev cache stores a ~5MB catalog body JSON-escaped
inside a JSON envelope. maybe_load_persisted_cache() runs synchronously
on the interactive boot path and parsed the body twice (envelope, then
re-parse of the escaped body) plus a full-body string copy — a gdb
mid-boot sample caught serde_json::visit_map inside models_dev_live
during the largest silent window of startup, and strace showed a
17.7ms zero-syscall compute burst after config load.

v2 format: one-line JSON metadata header followed by the verbatim
catalog body. Loading does one small header parse, one body parse, zero
body copies; v1 envelopes still load via fallback and every refresh now
writes v2. Measured on spark-1672 (aarch64), identical binary,
interleaved batches over scratch CODEWHALE_HOMEs differing only in
cache format: time-to-first-frame median 44.0/52.7/48.6/51.7ms (v1)
vs 13.9/14.1/13.9/14.4ms (v2).
apply_provider_model_cutlines called ApiProvider::parse per offering;
parse scans every provider and its alias list with case-insensitive
compares, and the live models.dev snapshot carries thousands of rows.
Freeze-and-inspect at t+180ms of boot caught the main thread inside this
loop. Resolve each distinct provider string once through a HashMap.
Interleaved A/B on spark-1672: first-paint median drops ~2-6ms per run
(195.7/196.9/192.9/197.2 -> 185.0/190.9/190.3/193.8, NEW wins 4/4).

perf(tui): adaptive poll cadence for foreground shell completion

Foreground bash runs go through execute_foreground_via_background, whose
wait loop polled child status on a fixed 100ms tick. A command that
finished in 2ms was only noticed at the next tick, so every fast
foreground call (ls, grep, wc, echo — the bulk of agent traffic) carried
a ~100ms floor: a simulated 8-tool turn spent ~400ms of its ~526ms wall
in poll quantization (measured over serve --mcp with the real registry).

Replace the fixed tick in all three wait loops (foreground completion,
wait-many, delta waiter) with an adaptive cadence: first sleep 10ms,
then double to a 100ms cap. Instant commands are now detected within
~10ms; long-running commands reach the old cap after one doubling step,
so their overhead is unchanged.

Revert "perf(tui): adaptive poll cadence for foreground shell completion"

This reverts commit 1a2f42c9f0b53d9b83ed50db4d4d7bd66df7977e.
Foreground bash runs go through execute_foreground_via_background, whose
wait loop polled child status on a fixed 100ms tick. A command that
finished in 2ms was only noticed at the next tick, so every fast
foreground call (ls, grep, wc, echo — the bulk of agent traffic) carried
a ~100ms floor: a simulated 8-tool turn spent ~400ms of its ~526ms wall
in poll quantization (measured over serve --mcp with the real registry).

Replace the fixed tick in all three wait loops (foreground completion,
wait-many, delta waiter) with an adaptive cadence: first sleep 10ms,
then double to a 100ms cap. Instant commands are now detected within
~10ms; long-running commands reach the old cap after one doubling step,
so their overhead is unchanged.

Measured over real serve --mcp (n=150, binaries aside):
  bash `true`:  p50 13.6 both | p95 16.2→13.9 | p99 21.5→18.6 | p100 35.9→21.6
  bash grep:    p99-p100 flat ~13.8-14.1 both
  file_read:    p100 0.2 both (min/p50/p99 all 0.1)
  tools/list:   p100 0.2-0.7 both
Tail-wall win: p95 -14%, p99 -13%, p100 -40% with p50 unchanged. An
earlier A/B that compared only medians missed the win and was reverted;
the tail distribution above is what justified re-landing it.

Interleaved A/B on aarch64 Linux, same host, same window.
The per-turn metadata build and the compaction decision each re-walked
the full transcript more than once per step. Make those walks
single-pass with byte-identical behavior, and fix one cache-invalidation
bug found along the way.

compaction_decision_with_billed: the same pure estimator ran twice per
step once pressure existed, once in the pressure gate and once in the
prune projection. Compute it at most once and thread it to both
consumers. Guard order (gate, prune projection, too-few-messages,
retained-floor) is untouched and decisions are identical for all
inputs. When provider-billed input alone proves pressure, the estimate
walk is skipped entirely without bypassing the guards that keep a
compaction loop from re-firing on every step.

active_input_tokens_with_current_text: the per-turn metadata builder
deep-cloned the entire message history just to append the composer text
before estimating. Estimate the history in place and add the
one-message delta arithmetically instead. The estimator inflates the
summed byte count by a factor of 1.5 rounded up as a whole, so the
delta is floor(own * 3 / 2) plus one exactly when the running byte sum
is even and the composer text contributes an odd count. Proven against
a clone-and-estimate reference over 80,000 parity combinations and
pinned per case by a test that also covers replayed reasoning, the arm
where a naive helper undercounts.

Op::SyncSession: session restore assigned the restored message list
directly to the session field, bypassing the messages_revision bump the
token-estimate cache keys on, so a restored conversation could be
priced from a stale estimate. Bump the revision and pin the behavior
with a test.

Verification: cargo fmt clean; compaction:: and engine preview,
pressure, and restore tests 19 passed via remote rch lane; cargo check
--all-targets clean with no warnings.
The streaming render ran the math transform over the full accumulated
content on every chunk, before the incremental markdown cache that
itself only renders deltas, so streamed turns paid an O(n) copy and
scan per chunk with O(n^2) cumulative cost.

render_latex_in_text now returns Cow<str>. One byte scan for the three
opening delimiters ($, \(, \[) decides between borrowing the input
untouched, the overwhelming case for streamed prose, and running the
transform. Output is byte-identical either way: the full transform
still re-verifies delimiters precisely, so the fast scan cannot create
false negatives.

Tests: no_math_is_borrowed_without_copy pins the borrowed path and that
the \( form is not missed by the fast scan; test_inline_dollar pins the
owned path on math input.

Verification: cargo fmt clean; latex_render:: 18 passed via remote rch
lane; cargo check --all-targets clean with no warnings.
Convert the first audited test-only dead-code slice to cfg(test), covering rendering/text fixtures and helper surfaces while preserving runtime behavior. Add direct tests for scroll and exploration wrappers for #5587.
…e_contract

Hosted Chat Completions backends (Baseten, Groq, Cerebras) land as
Compatible setup templates, not ProviderKind variants. MCP manager copy
names the server, the failure, and one recovery command. Idle metrics omit
zeros. Working chrome says "in the current". Nine uncompiled
runtime_contract files are gone. Dead-code budget 448 -> 372.
@claude

claude Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Claude finished @Hmbown's task in 4m 45s —— View job


Reviewing PR #5667

  • Gather context (PR description, CLAUDE.md/AGENTS.md, changed files)
  • Review diff for correctness bugs
  • Review provider/model/route safety invariant
  • Review reuse/simplification opportunities
  • Review test coverage
  • Review security concerns
  • Post final review

Summary

Reviewed the diff against origin/main (48 files, +960/-1661). Note: cargo check/cargo test could not be run in this sandbox (Bash tool denied cargo invocations), so this is a source-level review — no build was verified. If you want compile/test confirmation, add cargo/build commands to --allowedTools and I can re-run.

🐛 Correctness: MCP manager now shows a false "needs attention" warning for healthy, connected servers

crates/tui/src/tui/mcp_routing.rs:89-92 calls mcp_startup_warning unconditionally for every server in format_mcp_manager, including ones that are enabled && connected with no error:

lines.push(format!(
    "  {}",
    crate::mcp::mcp_startup_warning(&server.name, recovery, server.error.is_some())
));

recovery comes from mcp_recovery_kind(enabled, true, connected, error, false) (crates/tui/src/mcp.rs:3640), which returns McpRecoveryKind::Diagnose whenever connected == true (pre-existing behavior, unchanged by this PR — it was already used for the informational "next: Diagnose /mcp validate" line).

The new mcp_startup_warning (crates/tui/src/mcp.rs:3672-3691) has no arm for "everything is fine": for a connected server, kind = Diagnose, failed = false, so it falls through Reauth/Enable/_ if failed/Connect into the final catch-all:

_ => format!("The {name} MCP server needs attention. Run `{command}`."),

So a fully healthy, connected MCP server now unconditionally prints "The <name> MCP server requires attention. Run /mcp validate." in the manager view — a false alarm on every session with working MCP servers. This directly contradicts the PR's own stated goal ("MCP manager copy names the server, the failure, and one command"), since here there is no failure. format_mcp_manager/push_server have no test coverage, so this wasn't caught (the new tests in crates/tui/src/mcp/tests.rs only exercise mcp_startup_warning in isolation with an explicit failing kind).

Suggested fix: only push the warning line when the server actually needs attention (e.g. !server.connected || server.error.is_some() or a dedicated "healthy" branch in mcp_startup_warning/its call site) rather than for every server unconditionally.

Fix this →

🧹 Reuse/simplification: duplicate full-transcript pass undercuts the "single-pass" perf goal

crates/tui/src/core/engine.rs:3140-3176 (active_input_tokens_with_current_text) computes base via estimate_input_tokens_conservative(&self.session.messages, ...), which internally folds over every message (estimate_tokens). It then re-folds over the same messages a second time to get sum (needed only to know the parity of the pre-inflation total for the delta-arithmetic trick):

let base = estimate_input_tokens_conservative(&self.session.messages, system_prompt); // pass 1
...
let sum: usize = self.session.messages.iter().map(|m| estimate_tokens_for_message(...)).sum(); // pass 2, same values

This isn't a correctness bug (verified the parity-based delta formula — ceil((S+own)*3/2) - ceil(S*3/2), split on parity of S and own — is correct in all four cases), but it's two O(n) folds where one would do, which cuts against the PR's stated "single-pass token accounting" framing. Minor: the code comment also claims the formula was "pinned exhaustively (80k pairs)," but no such exhaustive test exists in the repo (only the four hand-picked cases in context_pressure_delta_matches_clone_and_push_reference) — worth correcting the comment or actually adding that test if it was run offline.

Provider/model/route safety (EPIC #2608)

crates/config/src/provider_templates.rs adds Baseten/Groq/Cerebras as ProviderSetupApply::Compatible template rows, not new ProviderKind variants — correct per the invariant. The new test explicitly asserts ProviderKind::parse(id).is_none() for all three. No code infers provider selection from the deepseek-ai/-style wire IDs in BASETEN_MODELS; they're inert catalog data. Good.

Other notes (no issues found)

  • crates/config/src/catalog.rs: OnceLock-backed bundled_models_dev_catalog() parse-once cache is correct; callers deref cleanly (&&ModelsDevCatalog coerces fine).
  • crates/tui/src/models_dev_live.rs: v1→v2 cache format migration is backward-compatible (falls back to v1 parsing when the v2 header check fails) and doesn't risk misparsing v1 bodies as v2 headers.
  • crates/tui/src/tui/history/latex_render.rs: Cow<str> fast path is correct — the byte-scan for $/\(/\[ can't produce false negatives, and all call sites already deref Cow<str> cleanly.
  • crates/tui/src/tools/shell.rs: adaptive poll backoff (10ms → 100ms cap) is a clean, low-risk change.
  • Deleted crates/tui/src/core/runtime_contract/* staging files: no remaining references found anywhere in crates/.
  • crates/tui/src/tui/session_metrics.rs: idle-metrics-omit-zeros logic and its new test (idle_snapshot_paints_nothing) look correct.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b051ee7a37

ℹ️ 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".

Comment thread crates/tui/src/mcp.rs
/// / `MCP startup incomplete (failed: X)`).
#[must_use]
pub fn mcp_startup_warning(name: &str, kind: McpRecoveryKind, failed: bool) -> String {
let command = kind.slash_command(name);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Use the safe fallback in MCP recovery warnings

When a configured MCP server name contains whitespace, this helper still interpolates it into /mcp enable or /mcp login. The surrounding push_server code deliberately falls back to /mcp validate when mcp_name_is_command_safe rejects the name, but the new warning bypasses that result; for example, /mcp login github mcp is parsed as a login for github, so the suggested recovery targets the wrong server. Pass the already-sanitized command into this helper or apply the same safety check here.

Useful? React with 👍 / 👎.

Comment thread crates/tui/src/mcp.rs
let command = kind.slash_command(name);
match kind {
McpRecoveryKind::Reauth => {
format!("The {name} MCP server requires OAuth reauthentication. Run `{command}`.")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Route MCP warnings through localization

When the MCP manager is rendered under any non-English locale, this newly added warning remains English because the helper accepts no locale and formats literal prose; push_server only applies its locale to surrounding metadata. Add typed MessageId entries and render the warning through tr so localized users do not receive mixed-language recovery instructions.

AGENTS.md reference: crates/tui/AGENTS.md:L22-L23

Useful? React with 👍 / 👎.

Comment on lines +1208 to +1212
"PhaseWorking": "in the current",
"PhaseReasoning": "reasoning",
"PhaseReading": "reading",
"PhaseUsingTool": "using tool",
"PhaseSubagents": "working on subagents",
"PhaseSubagents": "pod underway",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Update complete locale packs with the changed phase copy

When any complete non-English locale is selected, these phase keys still resolve to their old translations because only en.json was changed; every sibling pack retains the previous working/subagent labels. Update the complete packs alongside these English changes so the new in the current and pod underway terminology is consistently represented.

AGENTS.md reference: crates/tui/locales/AGENTS.md:L7-L11

Useful? React with 👍 / 👎.

pub fn bundled_models_dev_catalog() -> ModelsDevCatalog {
ModelsDevCatalog::parse_json(BUNDLED_MODELS_DEV_JSON)
.expect("committed bundled Models.dev asset must be valid JSON")
pub fn bundled_models_dev_catalog() -> &'static ModelsDevCatalog {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve the catalog helper's public return type

External users of the published codewhale-config crate that consume bundled_models_dev_catalog() as an owned ModelsDevCatalog will stop compiling because this performance change alters the public signature to &'static ModelsDevCatalog. Keep the existing owned-returning API and add an internal or additive borrowed cached accessor instead, so parse memoization does not introduce a source-breaking change in a patch release.

AGENTS.md reference: AGENTS.md:L15-L17

Useful? React with 👍 / 👎.

Add GLM-5.3-Flash as a first-class picker row (wire id GLM-5.3-Flash,
OpenRouter z-ai/glm-5.3-flash) so /model can select it. Flash is the
faster/explore sibling of GLM-5.3; the Z.ai default stays GLM-5.3.
Ship the published $0.15/$0.50 list, not the 50% promo.
@claude

claude Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Claude finished @Hmbown's task in 2m 13s —— View job


Reviewing PR #5667 (update)

  • Gather context (diff since last review, prior findings from Claude + Codex)
  • Check if previously flagged MCP warning bug was fixed
  • Review new commit (aa60285, GLM-5.3-Flash) for correctness bugs
  • Review provider/model/route safety invariant
  • Review reuse/simplification opportunities
  • Review test coverage
  • Review security concerns
  • Post final review

Summary

This synchronize event added one new commit since my last review: aa60285 "feat(config): register GLM-5.3-Flash on Z.ai and OpenRouter." I reviewed that commit in full and re-checked whether the correctness bug and Codex findings from the prior review pass were addressed — they were not, since this commit doesn't touch mcp.rs/mcp_routing.rs/locales/catalog.rs.

✅ New commit (aa60285) — clean, no issues found

GLM-5.3-Flash is wired consistently and safely across every layer:

  • crates/config/src/provider_defaults.rs / crates/tui/src/config/models.rs: new ZAI_GLM_5_3_FLASH_MODEL / OPENROUTER_GLM_5_3_FLASH_MODEL constants (note: these are two independently-defined constant sets — one pub(crate) in the codewhale-config crate, one pub in crates/tui/src/config/models.rs — both were updated together, so nothing is left inconsistent).
  • crates/tui/src/config.rs: canonicalization aliases (glm-5.3-flash, glm-5-3-flash, zai-glm-5.3-flash, …) added for both Z.ai and OpenRouter, mirroring the existing GLM-5.x pattern.
  • crates/tui/src/model_routing.rs: GLM-5.3's fast-tier child now correctly routes to GLM-5.3-Flash instead of GLM-5-Turbo; GLM-5.2 unchanged. Test coverage updated and looks correct (provider_router_candidates cases for Zai, OpenRouter, and the new Flash-has-no-cheaper-tier case).
  • crates/tui/src/models.rs, crates/tui/src/pricing.rs: context window (1M), max output (131,072), reasoning support, and a published USD price row ($0.15/$0.50, explicitly the durable list price, not the 50% promo) are all added with sourced comments and matching tests.
  • crates/config/src/provider_templates.rs: zai-org/GLM-5.3-Flash added to BASETEN_MODELS as inert catalog data only — no code infers provider selection from it. Consistent with the EPIC v0.8.65 EPIC: Separate provider facts, model facts, offerings, and route resolution #2608 invariant.
  • Bundled catalog JSON (models_dev.bundled.json, model_catalog.bundled.json) updated with sourced provenance metadata and matching cost/limit numbers.

No correctness, provider-safety, or test-coverage issues in this commit.

⚠️ Still open from the prior review pass (unchanged by this commit)

These were flagged against b051ee7 and remain present in current HEAD — flagging again since this is a fresh review pass, not because the new commit reintroduced them:

  1. MCP manager false "needs attention" warning (crates/tui/src/tui/mcp_routing.rs:90-93, crates/tui/src/mcp.rs:3672-3686): mcp_startup_warning is still called unconditionally for every server. For a healthy enabled && connected server with no error, mcp_recovery_kind returns Diagnose with failed = false, which falls through to the catch-all "The {name} MCP server needs attention. Run /mcp validate." — a false alarm on every session with working MCP servers. Fix this →
  2. Unsanitized name in mcp_startup_warning's embedded command (Codex, crates/tui/src/mcp.rs:3673): push_server falls back to /mcp validate when mcp_name_is_command_safe rejects the server name, but mcp_startup_warning builds its own command via kind.slash_command(name) without that check, so a whitespace-containing name can still produce a wrong/unsafe suggested command in the warning line even though the next: line below it is sanitized. Same call site as Fix cargo fmt formatting issues #1, so fixing both together is natural.
  3. Locale drift (Codex): only en.json picked up the new PhaseWorking/PhaseSubagents copy, and the new mcp_startup_warning strings bypass tr() entirely — non-English sessions will see mixed-language MCP warnings. Lower priority than Fix cargo fmt formatting issues #1/Simplify UI and improve footer display (v0.3.14) #2.
  4. bundled_models_dev_catalog() signature change (Codex, crates/config/src/catalog.rs:209): now returns &'static ModelsDevCatalog instead of an owned ModelsDevCatalog. All in-repo callers already coerce/deref cleanly (confirmed in the prior pass), and codewhale-config doesn't appear to be published/consumed outside this workspace, so this is a minor/theoretical concern rather than a live regression — noting for awareness, not blocking.

None of these are regressions from aa60285; they're pre-existing from earlier commits in this PR and still unresolved as of HEAD (aa60285).

Update the stale Z.ai fast-tier expectations to the newly registered
GLM-5.3-Flash route, including its high-effort capability receipt. Remove
three Clippy failures in the catalog and live-model paths, add the durable

Signed-off-by: CodeWhale Bot <bot@codewhale.net>
#5643/#5655 changelog receipt, and regenerate the packaged TUI changelog.
@claude

claude Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Claude finished @Hmbown's task in 1m 15s —— View job


Reviewing PR #5667 (update)

  • Gather context (diff since last review, prior findings)
  • Check if previously flagged issues were fixed (MCP warning bug, unsanitized name, locale drift, catalog.rs return type)
  • Review new commit(s) since last review for correctness bugs
  • Review provider/model/route safety invariant
  • Review reuse/simplification opportunities
  • Review test coverage
  • Review security concerns
  • Post final review

Summary

This synchronize event added one new commit since my last review: 3c9523b "fix(ci): align GLM flash routing and release receipts." It's a small, mechanical clean-up commit (clippy fixes + stale test expectations) — no new issues found.

✅ New commit (3c9523b) — clean

  • crates/config/src/catalog.rs:223: &bundled_models_dev_catalog()bundled_models_dev_catalog(). Since the function now returns &'static ModelsDevCatalog, the old code double-referenced; this is a needless-borrow clippy fix, no behavior change.
  • crates/tui/src/provider_lake.rs:138-142: .or_insert_with(...).clone()*resolved.entry(...).or_insert_with(...). ApiProvider derives Copy (crates/tui/src/config.rs:57), so dereferencing instead of cloning is sound and equivalent, just avoids a method call on a Copy type.
  • crates/tui/src/models_dev_live.rs:430-443: nested if let ... { if ... { collapsed into a single if let ... && ... && ... let-chain. Edition is 2024 with rust-version = "1.88" (let-chains stabilized in 1.88), and the codebase already uses && let chains elsewhere (e.g. fleet/manager.rs, runtime_threads.rs), so this isn't a new MSRV risk. Logic is unchanged — same v2-header-then-fallback-to-v1 behavior confirmed in my prior pass.
  • crates/tui/src/model_routing.rs + crates/tui/src/tui/ui/tests.rs: updates stale test expectations (ZAI_GLM_5_TURBO_MODELZAI_GLM_5_3_FLASH_MODEL, reasoning-effort label "low→thinking enabled; granularity unavailable""low→high"). Verified against non-test code, not just edited to force green:
    • model_routing.rs:144-148 already routes GLM-5.3's fast tier to GLM-5.3-Flash (added in aa60285), so the old test assertions referencing GLM_5_TURBO were stale from before that commit landed.
    • models.rs:404-405 groups glm-5.3-flash with the reasoning-effort-tier-capable models (unlike glm-5-turbo), which is why the fast-tier route now reports EffectiveReasoningEffort::Tier(High) instead of the old turbo-model's granularity-unavailable case. Test change matches actual capability data.
  • CHANGELOG entries: additive documentation only.

⚠️ Still open from prior review passes (unchanged by this commit — none of these files were touched)

  1. MCP manager false "needs attention" warning (crates/tui/src/tui/mcp_routing.rs:90-93, crates/tui/src/mcp.rs:3672-3686): mcp_startup_warning is called unconditionally for every server, including healthy enabled && connected ones with no error. mcp_recovery_kind returns Diagnose/failed = false for connected servers, which falls through every named arm into the catch-all "The {name} MCP server needs attention. Run /mcp validate." — a false alarm on every session with working MCP servers. Fix this →
  2. Unsanitized name in mcp_startup_warning's embedded command (Codex, crates/tui/src/mcp.rs:3673): builds command via kind.slash_command(name) without the mcp_name_is_command_safe check that push_server otherwise applies, so a whitespace-containing server name can produce a wrong/unsafe suggested command in the warning line. Same call site as Fix cargo fmt formatting issues #1.
  3. Locale drift (Codex): only en.json picked up the PhaseWorking/PhaseSubagents copy, and mcp_startup_warning's strings bypass tr() entirely — non-English sessions see mixed-language copy.
  4. bundled_models_dev_catalog() signature change (Codex, crates/config/src/catalog.rs:220): now returns &'static ModelsDevCatalog instead of an owned value — a source-breaking change for any external consumer of codewhale-config's public API. In-repo callers all coerce/deref cleanly (confirmed again against 3c9523b's own cleanup at line 223). Noting for awareness; low severity if this crate isn't published/consumed outside the workspace.

None of these are regressions from 3c9523b; they're carried over from earlier commits in this PR and remain unresolved as of current HEAD.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants