Repository navigation
fix(server): preserve newer capacity modes in settings - #774
Conversation
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. |
|
@codex review |
|
Codex Review: Didn't find any major issues. Chef's kiss. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
cf55e5b to
fc3c914
Compare
Read and save newer capacity modes without rejecting the rest of the settings or config. Sample unfamiliar modes as advisory and report their stored values. Settings patches still accept only the modes this server supports. Implemented with GPT-6.2 Sol in the Codex harness. Carry-Group: incubator Carry-Observation: Capacity settings need tolerant reads before enforcement can add a new mode.
f4e5624 to
048810d
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
…#793) Observe-only capacity ([#726](#726), [#774](#774)) left four review nits about how capacity is typed and reported. Capacity step 2 will add a mode, and these should land first. ## What changed - **Strict local type (R19):** making results from other machines tolerant had also loosened the one exported `CapacitySnapshot` type. So this server's own verdict states, reason signals, comparisons and memory pressure were plain strings, and a wrong value was no longer a type error. `CapacitySnapshot` is strict again. A separate `ReportedCapacitySnapshot` keeps the tolerant decoding for MCP tool results, peer forwarding and the CLI. - **Linked machines (R20):** a newer `linkedObservation` value no longer fails the decode. One malformed linked entry, whether its machine id, label or capacity, now drops only that entry, using the existing `ForwardCompatibleArray`. Before, it dropped the peer's whole capacity block. - **No guessed mode (R12, R23):** without a wired sampler, and when the capacity reader can't read settings, the mode is reported as `unknown` instead of `observe`. An unreachable linked machine was already `unknown`; it now uses the same default. - **Tool description (R22):** `t3_environment_read` now names mode `unknown`. I reworded the description so its byte count is unchanged (374 bytes). A corrupt settings file still reports `observe`. The settings service falls back to defaults there, so the server really is observing. ## Validation - **New tests,** both failing on base and passing here: - a forwarded environment read with a newer `linkedObservation`, one good linked entry, one with malformed capacity, and one with no machine id; - the unwired `Capacity` reporting `unknown`. - **Changed-file gate:** `vp run check:changed origin/lastcode/main` passed format, lint, both knip passes, GraphQL, typecheck of 38 packages, and tests. The focused capacity, environment and agent-context-budget tests passed (64). - **Model-backed MCP evals:** not run; this machine has no authorized eval proxy. Command: `pnpm mcp-tool-use --out runs/capacity-unknown-mode` from `evals/`. Local review: 2 rounds with GPT-6.1 Terra (xhigh), approved. Round 1 found the per-entry gap that `ForwardCompatibleArray` now closes. It also flagged two items I declined. One is the corrupt-settings case above. The other is that `t3_environment_read` fails outright when settings can't be read; that is existing upstream handler behavior, left as a follow-up. Implemented with Claude Opus 5.5 through Claude Code. Carry-Source-Ref: refs/lastcode/carry-sources/pr-793/791f5fa9092237216bffe1b25f5f54e14f3d79ec Carry-Source-Base: 232b995 Carry-Source-Head: 791f5fa
Follow-up to #726. Older LastCode versions need to read capacity modes that don't exist yet, such as
enforce. Today they can't. This lets the compatibility fix land ahead of capacity enforcement.🐛 Problem
When an unfamiliar
capacityModeappears in settings:capacity.would-holdadvisory log, because the log only fired when the mode was exactlyobserve.🔧 Change
observe(CapacityModeSettinginpackages/contracts).offmode still skips sampling.offandobserve.t3_environment_readdescription drops the exhaustive list of modes, shrinking the tool budget by 39 bytes. The provider update helper infers its return type from the fields it builds.✅ Proof
Tests were written first and reproduced all three failures above. Each one failed before the fix.
Local review: 3 rounds with Codex Terra (xhigh), approved.
Implemented with GPT-6.2 Sol in the Codex harness.