Skip to content

feat(web): Settings page "Fork" with the fork's agent and review settings, and usage pacing rows - #543

Merged
scuttletoby merged 5 commits into
mainfrom
fork-settings-page
Nov 19, 2026
Merged

scuttletoby merged 5 commits into
mainfrom
fork-settings-page

Conversation

@scuttletoby

Copy link
Copy Markdown
Owner

Stacked on #542 (the seam gate). Merge #542 first. Until then this PR's "Fork lines in upstream files" check is red: CI judges it by main's seam list, which does not yet announce these lines.

Problem

Fork settings were spread across Settings > Threads (Waits, Wait checks, Agent slots, Review rules), and usage pacing had no screen at all. Changing usage pacing meant editing settings.json by hand. The owner's rule is that every fork setting can be changed in the Settings UI, and all of them live on one page.

Fix

A new Settings page, Fork (/settings/fork). It has one nav entry in the Agents group, right after Scheduled tasks, with a fork icon. It is routed like Threads: its own route file and one panel component.

  • Overview (top): one line per fork feature saying On or Off: Waits, Agent slots, Usage pacing (advise/enforce), Review rules, Automatic updates, Handoff ("On for N threads" when only a thread's entry is on), Playtest. It uses the fork report's rules (apps/server/src/golive/forkReport.ts) on the selected scope's settings. A hand-edited value the server reads as off shows Off.
  • Agents:
    • Waits, Wait checks and Agent slots, moved from Settings > Threads. Their mount lines and imports are gone from SettingsPanels.tsx, which is now line for line upstream's, and its "pending" entry is dropped.
    • New Usage pacing section:
      • Usage pacing gate: a select with Off / Advise / Enforce, each explained in one sentence.
      • Lower effort when ahead of pace: a text field of pairs like high=medium (comma or newline separated). Text it cannot read gets an inline error and is never saved; empty clears the map.
      • Reserve per account: one row per provider instance, by its display name, across every selected environment (as Agent slots lists them). Each row has a reserve % field (0–100) and two switches, "Spend first" and "No usage limits". A stored entry has a reset button. An entry for an account that is no longer on the server is still listed, by its id, with Remove.
  • Reviews: Review rules, moved unchanged.

A project screen shows only what a project may override: Wait checks and Review rules, each with its existing project-override control. Usage pacing, waits and slots are server-wide and hidden there. With no server connected, the page says so instead of showing empty sections.

Search. Every row on the page is in the settings search:

  • the overview;
  • each wait and agent-slot number row;
  • the gate, lower effort and reserve rows;
  • review rules.

Search items for the moved rows now point at /settings/fork.

Docs. docs/fork/README.md now names Settings → Fork for every row that moved or is new. FORK_CHANGES.md's settings-page line covers the page.

Upstream fit

Upstream files changed, all through the seam lines #542 announces:

Everything else is in fork files: components/settings/fork/, forkSettingsSearchItems.ts, and the route file _chat.settings.fork.tsx. Upstream's Threads page loses no upstream rows. Labels are English only, as the fork's other panels (upstream's translation catalogs hold no fork keys).

General vs project

Setting Server Project override
waitFor, agentSlots, usagePacing, usagePacingGate, usagePacingLowerEffort yes no (hidden on a project screen)
waitChecks yes yes (whole list, existing control)
reviewRules yes yes (whole value, existing control and "use the environment's" reset)

Screenshot

The browser tests could not run on the machine that wrote this PR: the headless Chromium is missing system libraries there and no root is available. CI runs them. What the page shows:

  • Sidebar: a "Fork" entry with a fork icon, under Agents, below Scheduled tasks.
  • Overview: a two-column list of seven features, "Waits … Off", "Usage pacing … On: advise", and so on. Features that are on are in the foreground colour.
  • Agents (small uppercase label), then these sections:
    • Waits, Wait checks, Agent slots: unchanged from the Threads page.
    • Usage pacing:
      • a "Usage pacing gate" row with a select on the right;
      • a "Lower effort when ahead of pace" row with a text field;
      • a "Usage reserve per account" header row;
      • then one row per account, "Reserve on Claude A", with a 0 % number field, its summary ("No reserve" / "20% kept free, spent first" / "No usage limits") and two small switches beneath.
  • Reviews label, then the Review rules section.

Tests

  • fork/forkStatus.logic.test.ts:
    • an empty settings file reads every feature Off;
    • each switch reads as the server does;
    • unreadable hand edits read Off.
  • fork/usagePacingSettings.logic.test.ts:
    • accounts by name from an empty file;
    • a stored entry, plus one for a removed account;
    • summaries;
    • the lower-effort field round-trips and refuses bad text.
  • fork/UsagePacingSettings.browser.test.tsx (CI only, see Screenshot). Settings are decoded from a settings file as the server loads it, and each test checks the exact patch:
    • writes a reserve and a switch from an empty file;
    • reads a stored entry, resets it and removes a gone account;
    • writes the gate and the effort map;
    • shows an error and saves nothing for unreadable effort text.
  • vp run check:changed: format, lint, knip and typecheck pass. All unit tests pass (52). The only failure is the browser launch on this machine.
  • The seam check passes against fork seams: judge the route tree as generated output; announce the Fork settings page lines #542's list, and against upstream (--from-upstream) with this branch's list. Against main's list it fails, as expected until fork seams: judge the route tree as generated output; announce the Fork settings page lines #542 merges.

State question

  • Runs again:
    • Each control sends one ordinary settings patch. A per-account write is a mergeEntries patch for that account only, so saving twice gives the same file, and two people editing different accounts keep both.
    • The gate and the effort map replace their whole value.
  • Stops half-way:
    • A refused save puts the number field back to the stored value (onFailed).
    • The effort field keeps the stored value until a valid save; bad text never leaves the field.
  • Old or empty state:
    • A settings file with none of these keys loads the defaults: gate Off, no lowering, every account at 0% with both switches off, every overview line Off.
    • An account removed from the server keeps its stored entry, listed by id with Remove, so it can be cleared or kept for when the account comes back.
    • A hand-edited value the server reads as off shows Off in the overview.

🤖 Generated with Claude Code

@scuttletoby

Copy link
Copy Markdown
Owner Author

Review (independent, Opus)

Covers #543 (head 460e13c) and #544 (head 51dd533). Read-only: code read against main and upstream main, CI logs read. No local test run (the clone has no dependencies installed).

BLOCKING

  1. feat(web): Fork settings page rows for automatic updates, handoff and playtest #544: on a project screen, removing a playtest step or the handoff command does not save, but the screen says it did. apps/web/src/components/settings/scopedSettings.ts:347 replaces only waitChecks and reviewRules whole. Every other project-scoped object goes through line 365–366, next[key] = { ...base, ...value }, where base is the project's current effective value. handoff and playtest are not on that list.
    • Playtest example: project P has its own playtest with all four steps, switched off. The person opens Edit steps, deletes "release" and saves. withPlaytestSteps (playtestSettings.logic.ts:57-59) builds a value without release, and the merge puts base.release back. The server stores it, onSaved closes the dialog (PlaytestSettings.tsx:94), and reopening shows release again. The same happens to claim and renew.
    • Handoff example: on project P, empty the command box while the source is "The old session". HandoffSettings.tsx:311-312 sends the value without command, and the merge puts the old command back.
    • Effect: a program the person removed stays in that project's adapter, and the next "on" runs it.
    • Fix: add "handoff" and "playtest" to the whole-replace line at scopedSettings.ts:347. It is already a fork seam line, and both keys are "replaces the environment's whole" in FORK_PROJECT_SCOPED_KEYS.
    • Also add a project-scope test. Every test in ForkPanels.browser.test.tsx uses isProjectScope={false} and mocks useUpdateScopedSettings, so none reaches this path. A unit test on planScopedSettingsPatch with a project override that has release, patched without it, catches it.
  2. feat(web): Fork settings page rows for automatic updates, handoff and playtest #544: CI is red. Test Web 2 fails at ForkPanels.browser.test.tsx:145.
    • Error: Cannot find element with locator: locator('div').getByText('Fix the login page').
    • The ARIA tree shows the text is there, as text: Fix the login page thread-1. The title and the id share one span, with the id in a nested span (HandoffSettings.tsx:166-169), so the text locator does not find the title alone.
    • Fix: put the title in its own element (it also reads better), or match the row with { exact: false } on the combined text.
    • Run: https://github.com/scuttletoby/t3code/actions/runs/44567621099/job/135714268347

SHOULD-FIX

  1. feat(web): Settings page "Fork" with the fork's agent and review settings, and usage pacing rows #543 and feat(web): Fork settings page rows for automatic updates, handoff and playtest #544: a managed-policy lock or missing write permission greys out only a row's control, not controls in its children. In settingsLayout.tsx, inertControl wraps control only. These controls stay live:

    • "Spend first" and "No usage limits" (UsagePacingSettings.tsx:262-285);
    • every handoff thread row's mode select, Remove and Add thread (HandoffSettings.tsx:163-214);
    • the handoff command and instructions boxes (HandoffSettings.tsx:301-339).

    The server still refuses the write (serverSettings.ts:1239, write-managed-setting), so a lock is not bypassed. Still, with handoff locked, the person can click Add thread and gets an error toast. The typed id is also lost, because addThread clears the draft before the save's outcome (HandoffSettings.tsx:113). Clear it in onSaved, and make the children inert when the row is managed or unavailable (or move them into control).

  2. feat(web): Fork settings page rows for automatic updates, handoff and playtest #544: on a project screen, each Handoff and Playtest sub-row shows "Reset to inherited value", and clicking it wipes the project's whole override.

    • Affected rows: handoff-threads, handoff-size, handoff-idle, handoff-source, handoff-instructions, playtest-steps and the three limit rows (HandoffSettings.tsx:154,219,245,274,323, PlaytestSettings.tsx:208,235).
    • Why: each passes settingKeys={["handoff"|"playtest"]} with no onResetOverride, so SettingsRow renders the reset button, and it calls clearOverrides(["handoff"]).
    • Scenario: on project P (own handoff, mode Handoff, 3 thread entries, a command), reset on "Idle handoff size" removes the mode, the threads and the command too.
    • Fix: give the sub-rows managedPaths={["handoff"]} instead of settingKeys. The lock still applies (lockablePaths), and scopedKeys is empty, so no reset appears. Keep the one reset on the section's first row.
  3. feat(web): Settings page "Fork" with the fork's agent and review settings, and usage pacing rows #543: the Overview is not the fork report's rules, as the PR says it is.

    • forkStatus.logic.ts:27-30 reads only the selected target's own value. forkReport.ts turns handoff on when any server, project or thread mode is handoff (project overrides of playtest and reviewRules count the same way).
    • Scenario 1: the server's handoff is off and project P's override is mode: handoff. On the environment screen the Overview says "Handoff: Off", while t3 __fork-report says on (project:P).
    • Scenario 2: with All selected and two servers that differ, it shows only the first target's values (SettingsScopeContext.tsx:90-92) and never "Mixed".
    • Fix: either count project overrides ("On for 1 project") or reword the description. A test that the Overview lists every feature the fork report lists would keep the two from drifting (see the modelPolicy note below).

NIT

  1. feat(web): Settings page "Fork" with the fork's agent and review settings, and usage pacing rows #543 and feat(web): Fork settings page rows for automatic updates, handoff and playtest #544: a clamped value can stay wrong on screen. Reserve is clamped by Math.min(100, value) (UsagePacingSettings.tsx:242) and the playtest limits by Math.min(limit.max, …) (PlaytestSettings.tsx:253), after IntervalSecondsField has already set its draft to the unclamped number. Scenario: the stored reserve is 100 and the person types 150. The save sends 100, the stored value does not change, so the field never resyncs and keeps showing 150. IntervalSecondsField taking a max would fix it.
  2. feat(web): Settings page "Fork" with the fork's agent and review settings, and usage pacing rows #543: parseLowerEffort accepts any level name (usagePacingSettings.logic.ts:105). A typo like hgih=medium saves, and with Enforce on, high tasks are then held instead of lowered. A warning for a level no provider offers would help.
  3. feat(web): Fork settings page rows for automatic updates, handoff and playtest #544: two small mismatches.
    • The test "switches a complete adapter on and off" (ForkPanels.browser.test.tsx:180) only switches it on.
    • The server row's "Reset playtest to default" (PlaytestSettings.tsx:192-196) only sets enabled: false and keeps the steps. Either the label or the action should change.
  4. CI, not this code:

modelPolicy (#268, now on main, no row yet): where it goes

Both PRs branched before #268, so the rebase brings modelPolicy in with no row and no Overview line.

  • Where: a "Model policy" section in the Agents group, right after Usage pacing. It acts on the same delegate_task picks.
  • Server only: it is not in FORK_PROJECT_SCOPED_KEYS, so hide it on a project screen, as Usage pacing is.
  • Rows:
    • a mode select (Off / Advise / Enforce);
    • the allow rows edited as JSON in a dialog like Playtest's, checked with ModelPolicyPatch strictly;
    • a warning when unreadable is set: the file's value reads as enforce with nothing allowed, and saving replaces the kept text.
  • Overview: add a "Model policy" line (an unreadable value shows "On: enforce (unreadable)").
  • Search: add a search item.

Checked and fine

  • SettingsPanels.tsx is identical to upstream main, and nothing else links to the moved rows on /settings/threads.
  • Same save path: every write goes through useUpdateScopedSettings and useClearScopedSettings, so the permission check, the pending-write overlay and the partial-failure toast are the same as the existing panels'.
  • Two quick saves: whole-value saves build on the pending (optimistic) value, SettingsScopeContext.tsx:79-87.
  • Usage pacing patches are per entry and merge fields (FORK_PATCH_RULES.usagePacing), so a switch never drops a stored reserve. Remove and reset send null.
  • handoff.modelSelection is kept on every server-scope save, because each save spreads the shown value.
  • Unread state: an empty settings file and an entry for a removed account are covered by tests. Invalid playtest JSON and the strict schema are refused before any save.
  • Person-only: no new write path. The page uses the same updateSettings call with settings:write, and FORK_AGENT_WRITABLE_KEYS stays empty.
  • Search: every searchableSetting(...) id on the page has a search item. The waitFor-* and agentSlots-* ids match WaitsAndSlotsSettings.tsx:104. The playtest and handoff Advanced rows unfold through targetIds.
  • Usage pacing browser test:

Blocking findings: 2 (1 and 2, both in #544).

@scuttletoby

Copy link
Copy Markdown
Owner Author

Fix round for the review above. #543 is now 531a93aa, on #542's current head (fa722942). #544 is now 42220e84, on #543.

  1. Blocking 1 (feat(web): Fork settings page rows for automatic updates, handoff and playtest #544): fixed. scopedSettings.ts now replaces handoff and playtest whole on a project, like waitChecks and reviewRules. The same fork line changed and no line was added, so the pending ceiling holds. New test fork/forkProjectOverrides.test.ts saves through the real createScopedSettingsWriter and applyServerSettingsPatch. It was red before the fix: the removed release step and the emptied command both came back.
  2. Blocking 2 (feat(web): Fork settings page rows for automatic updates, handoff and playtest #544): fixed. The thread title and the thread id are now in separate spans.
  3. Lock (feat(web): Settings page "Fork" with the fork's agent and review settings, and usage pacing rows #543 and feat(web): Fork settings page rows for automatic updates, handoff and playtest #544): fixed. A new fork wrapper, ForkRow, puts a managed lock or a missing write permission on the row's control and also makes its children inert. That covers Spend first and No limits, the thread list, Add thread, and the command and instructions boxes. A refused Add thread keeps the typed id, which is cleared only in onSaved.
  4. Sub-row reset (feat(web): Fork settings page rows for automatic updates, handoff and playtest #544): fixed. The sub-rows now use managedPaths, so upstream's whole-override reset is gone from them. On a project's own value, each sub-row has its own reset that puts back only its own fields from the environment's value (withFieldsFrom, unit-tested). The first row still clears the whole override.
  5. Overview (feat(web): Settings page "Fork" with the fork's agent and review settings, and usage pacing rows #543): fixed. The fork report's rules moved to packages/contracts/src/forkFeatures.ts, and both forkReport.ts and the Overview read them. Project overrides and threads count ("On for 1 project, 1 thread"). A project screen reads its own effective value. Selected servers that differ show "Mixed: on for N of M". The labels are a Record<ForkFeature, …> and a test checks that every FORK_FEATURES key is listed, so the two cannot drift.
  6. Clamp: fixed. BoundedNumberField wraps upstream's field, which stays untouched, and starts the field again whenever the bound changes the typed number. It is used for the reserve, the playtest limits and both handoff sizes.
  7. Lower effort (feat(web): Settings page "Fork" with the fork's agent and review settings, and usage pacing rows #543): fixed. A level is accepted only if a model on the selected servers offers it, plus the usual levels. hgih=medium is refused.
  8. feat(web): Fork settings page rows for automatic updates, handoff and playtest #544 nits: fixed. "Reset playtest to default" now saves the real default, steps included. The on/off test now switches the adapter off as well.
  9. CI notes: no change. "Fork lines in upstream files" on feat(web): Settings page "Fork" with the fork's agent and review settings, and usage pacing rows #543 still waits for fork seams: judge the route tree as generated output; announce the Fork settings page lines #542. Against fork seams: judge the route tree as generated output; announce the Fork settings page lines #542's list it passes locally.
  10. modelPolicy (feat(web): Settings page "Fork" with the fork's agent and review settings, and usage pacing rows #543): added. A Model policy section in Agents, right after Usage pacing, on server screens only. It has a mode select, an Edit allowed models dialog (JSON, checked with ModelPolicyPatch, strict), and a warning with the kept text when the stored value is unreadable. It also adds an Overview line ("On: enforce (unreadable)"), two search items, docs, and unit and browser tests.

Checks run locally: check:changed (format, lint, knip, typecheck, unit tests), the seam checks, and forkReport/forkDocs/forkSettings tests all pass. Not run: the browser tests, because this machine cannot reach a local port, so CI's Test Web is their first run.

@scuttletoby

Copy link
Copy Markdown
Owner Author

Re-check (round 2)

Covers #543 at 531a93aa and #544 at 42220e84 (base #542 at fa722942). This was a read-only review: I read the code, the CI logs and the vitest matcher source. I also ran the seam check against #542's list. I did not run tests locally; CI ran them.

Round-1 findings

# Finding Status Where
1 Project save puts removed playtest steps and handoff command back Fixed scopedSettings.ts:347 now replaces handoff/playtest whole. fork/forkProjectOverrides.test.ts saves through the real writer and applyServerSettingsPatch.
2 ForkPanels browser test could not find the thread title Fixed HandoffSettings.tsx:181-184 puts the title and the id in separate spans. #544's Test Web 1 and 3 pass, and Test Web 2 fails only on finding A below.
3 Lock and permission greyed out only control Fixed ForkRow.tsx:36-48 makes the children inert too, and managed also hides upstream's reset. Add thread clears its draft only in onSaved (HandoffSettings.tsx:121). Browser tests cover the lock for usage pacing and handoff.
4 Sub-row reset wiped the whole project override Fixed Sub-rows use managedPaths (HandoffSettings.tsx:168,238,263,288,343, PlaytestSettings.tsx:220+). useSubRowReset + withFieldsFrom put back only the row's own fields, and only when the project's value is its own.
5 Overview did not follow the fork report's rules Fixed Both now read packages/contracts/src/forkFeatures.ts. A project target drops other projects' overrides (forkStatus.logic.ts:76-79). Targets that differ show "Mixed: on for N of M". forkStatus.logic.test.ts:13 holds the list to FORK_FEATURES.
6 A clamped value could stay wrong on screen Partly BoundedNumberField fixes reserve and playtest limits. Handoff sizes are bounded only from below (HandoffSettings.tsx:253,278), see nit N1.
7 parseLowerEffort accepted any level name Fixed usagePacingSettings.logic.ts:139-157 refuses a level no model here offers.
8 Two small mismatches in #544 Fixed Reset saves DEFAULT_SERVER_SETTINGS.playtest (PlaytestSettings.tsx:207), and the on/off test now switches it off.
9 CI not caused by this code See CI below

Blocking

A. Test Web 2 is red on both heads, and the cause is this PR's own new test.

  • Failing test: UsagePacingSettings.browser.test.tsx:232, "ModelPolicySettings > warns when the stored value cannot be read".
  • Error: expect(element).toHaveTextContent(). Expected cannot be read, received the full warning text, which does contain those words.
  • Cause: in this repo's @vitest/browser (5.x), toHaveTextContent(string) is an exact match (pass: text === expected, in expect-element.js). Partial matching is toMatchTextContent, or a regex.
  • It fails the same way on both runs, so it is not flaky: 1 failed of 1680 tests.
  • Fix: toMatchTextContent("cannot be read"), or toHaveTextContent(/cannot be read/). The next assertion at :234 (toHaveTextContent("Enforce") on the combobox) never ran. It needs the combobox text to be exactly "Enforce", so check it in the same push.
  • Runs: #543, #544.

Should-fix

B. Model policy: the "Edit allowed models" dialog throws away the unreadable text without saying so. ModelPolicySettings.tsx:53 starts the dialog from shown.allow. For an unreadable value that is [] (fail-closed), and the dialog shows no warning.

  • Example: the file holds {"mode":"advise","allow":[{"driver":"codex","model":"gpt-mini","effort":"low"}]}, with one typo key.
  • The person opens the dialog to fix the typo. They see [], retype one row and save.
  • The save is {mode:"enforce", allow:[...]} (:58 takes value.mode, which is the fail-closed enforce). It replaces the kept text, and it also changes the person's mode from advise to enforce.
  • The warning on the row says "a save replaces it", but the modal dialog covers the row. The save itself is checked exactly like the server's save (same ModelPolicyPatch, strict), so this is only about what the person sees.
  • Fix: when unreadable is set, repeat the warning inside the dialog. Prefill the textarea from unreadable.allow when it is an array, so the person fixes the typo instead of retyping.
  • The mode select (:170) and Reset also replace the kept text in one click. They sit next to the visible warning, so they are acceptable. One line in the warning naming them ("changing the mode or resetting replaces it") would help.

Nits

  • N1. Handoff size and idle size have no upper bound in bound: 150 000 and 75 000 in handoff.ts:58-60 (HandoffSettings.tsx:253,278).
    • Example: typing 200000 gets a refused save and an error toast, and the field reverts through onFailed. It does not get stuck, but a Math.min would match the other fields.
  • N2. Model policy rows are not checked against the providers on the server. A typo driver such as claudAgent saves, and with Enforce every Claude pick is refused. This is the same kind of problem as round-1 [measurement only, do not merge] fork-tests.yml on v0.1.9 #7. A warning is enough, because nothing reads the policy yet.
  • N3. On a project whose own playtest is on, "Reset playtest steps to the environment's" (PlaytestSettings.tsx:226) can build a value the server refuses: on, but missing a step the environment lacks.
    • The result is an error toast and no damage. Hide the reset when enabled and the result would miss a step.
  • N4. The null-case test of withFieldsFrom (forkRowReset.logic.test.ts:31) covers only a number field. Add a case for threads or push, so the structural Equal.equals on objects and arrays is pinned.

New code checked and fine

  • forkReport behaviour is unchanged.
    • The rules moved word for word to forkFeatures.ts, and whereEachFeature now calls forkFeaturesWhere.
    • The keys come out in the same order (agentSlots, waitFor, usagePacingGate, automaticUpdates, reviewRules, handoff, playtest, modelPolicy), so the t3 __fork-report JSON is byte-identical.
    • FORK_REPORT_PROJECT_FEATURES is re-exported, so its test still holds it to FORK_PROJECT_SCOPED_KEYS. The forkReport tests are unchanged, and Test Server 1–8 pass on both heads.
  • The model policy dialog checks exactly like the server's save.
    • withModelPolicyAllow decodes {mode, allow} with the same ModelPolicyPatch, which applies onExcessProperty: "error" itself. The client and the server therefore refuse the same values.
    • The patch rule is replace, so a valid patch is also a valid stored value and never turns unreadable after a save.
    • A double click is guarded by saving, and a refused save keeps the text.
  • An unreadable value is never overwritten by another setting's save. The panel sends modelPolicy only from its own controls, and the server writes the kept raw value back on other saves (ModelPolicyFromSettingsFile encode).
    • targetsDiffer sees unreadable, so an unreadable server and a clean server show Mixed.
    • The Overview shows "On: enforce (unreadable)".
  • Per-row reset on a project. A sub-row reset appears only when the project has its own value and the environment is connected. It returns null when the fields already match.
    • The first row still clears the whole override.
    • Removing a field (command when the environment has none) deletes the key instead of setting it to undefined.
  • Lock and permission. useForkRowLock reads the same managed policies as upstream's row and the same write scope as the save. Locked rows hide every reset.
  • The state question.
    • Runs again: whole-value saves build on the pending value, and Add thread twice is refused by threadModeProblem.
    • Stops half-way: onFailed reverts number fields and text fields, and the dialogs keep their text.
    • Empty or old settings file: modelPolicy decodes to off/[] (withDecodingDefault).
    • Removed account: usage pacing offers Remove for it.
    • Removed thread: it shows as "Unknown thread" with Remove.
    • Removed driver: its model-policy rows are still listed and editable.
  • Seams. fork-seam-check with --config-ref set to fork seams: judge the route tree as generated output; announce the Fork settings page lines #542's head passes for feat(web): Settings page "Fork" with the fork's agent and review settings, and usage pacing rows #543. feat(web): Fork settings page rows for automatic updates, handoff and playtest #544 changes one line in place in scopedSettings.ts, under its ceiling.

CI

Check #543 531a93aa #544 42220e84 This code?
Test Web 2 ❌ ❌ Yes: finding A
Lint ❌ ❌ No. fork-owned-reads.test.py flags apps/web/src/forkRouteTree.test.ts reading fork-seam-check.cjs. That file comes from #542, and #542's own Lint fails the same way.
No database schema changes (seam step) ❌ ✅ No. It is judged by main's list until #542 lands, and it passes against #542's list.
Fork checks ran / fork-ci-result ❌ ❌ Rolls up the failures above.
Test Web 1/3, Test 1/2, Test Server 1–8, Build and Typecheck, Fork kit tests ✅ ✅

Blocking findings: 1 (A).

scuttletoby added a commit that referenced this pull request Nov 19, 2026
…k report, and a model policy row

Fix round for the review of #543:

- A managed-policy lock or a missing write permission now makes every
  control of a Fork row inert (the switches and lists below the title
  too), through a fork row wrapper; upstream's row only greys its main
  control.
- The Overview reads where each feature is on with the fork report's
  own rules, now shared from the contracts (forkFeatures.ts): a
  project's override or one thread's handoff entry counts on a server
  screen, a project screen reads its effective value, and selected
  servers that differ show "Mixed". The fork report uses the same
  function, and the Overview's labels are typed by every feature, so
  the two cannot drift.
- A reserve typed above 100 is saved as 100 and the field shows 100
  again (the field restarts when the bound changes the number).
- The lower-effort map refuses a level no model on the server offers
  (a typo such as hgih=medium).
- Model policy (#268): a section in the Agents group after Usage pacing,
  server only: the mode, the allowed rows edited as JSON and checked as
  the server's save checks them, a warning with the kept text when the
  stored value cannot be read, an Overview line and search items.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@scuttletoby

Copy link
Copy Markdown
Owner Author

Fix round 2

Both PRs are rebased onto #542's 73796c28. #543 is now at 0bf753ba and #544 at dbc67327.

  • A (blocking): the unreadable-value test now uses toMatchTextContent for the warning and for the "Enforce" combobox. No other exact-text assertions are left in either PR's new tests.
  • B: on an unreadable value, "Edit allowed models" repeats the warning and shows the kept text. The rows start from the value's own allow when it has one. The save button reads "Replace the unreadable value". It saves only after the person picks a mode; the file's own mode is marked "(as the file says)". The row warning now also says that changing the mode or resetting replaces the value. A browser test covers this.
  • N1: HANDOFF_MAX_TOKENS (10 000 000, the server's real limit) is exported. Both handoff size fields are clamped to it through boundHandoffTokens, and a unit test checks that the clamped values pass the save's schema.
  • N2: a model-policy row whose driver no provider on the selected environments has gets a warning. Nothing is flagged when no provider is known.
  • N3: a project sub-row reset is offered only if its result passes the server's strict check (subRowResetValue). A project whose own playtest is on therefore never gets a step reset that drops a step it needs.
  • N4: the withFieldsFrom tests now cover threads (an object) and push (a list) by value.

The state question:

  • Runs again: same as before.
  • Stops half-way: the dialog keeps its text and mode.
  • Old or empty settings: unchanged. An unreadable value that is not an object starts from [] with no mode.
  • Removed provider: its policy rows are flagged but stay editable.

Format, lint, typecheck, contracts tests and web unit tests (5718) all pass locally. The seam check against #542 passes for both heads. Browser tests could not run on this PC, and CI is running now.

@scuttletoby
scuttletoby force-pushed the fork-settings-page-gate branch from 73796c2 to c50b20a Compare November 19, 2026 18:39
@scuttletoby
scuttletoby changed the base branch from fork-settings-page-gate to main November 19, 2026 20:12
scuttletoby and others added 5 commits November 19, 2026 20:13
…ings, and usage pacing rows

Every fork setting gets one Settings page, Fork (/settings/fork), next to Threads in the Agents
nav group. Its top lists each fork feature as on or off (the fork report's rules). Group Agents
holds Waits, Wait checks and Agent slots, moved here from Settings > Threads (the Threads page is
upstream's again), and the new Usage pacing section; group Reviews holds Review rules. A project
screen shows only what a project may override (wait checks, review rules).

Usage pacing had no screen: the gate (off, advise, enforce), the lower-effort map as pairs like
high=medium, and one row per provider account by its display name with its reserve percent and
its spend-first and no-limits switches. An entry for an account that is gone is listed with
Remove; a stored entry has a reset. Every row is in the settings search.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d does

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…k report, and a model policy row

Fix round for the review of #543:

- A managed-policy lock or a missing write permission now makes every
  control of a Fork row inert (the switches and lists below the title
  too), through a fork row wrapper; upstream's row only greys its main
  control.
- The Overview reads where each feature is on with the fork report's
  own rules, now shared from the contracts (forkFeatures.ts): a
  project's override or one thread's handoff entry counts on a server
  screen, a project screen reads its effective value, and selected
  servers that differ show "Mixed". The fork report uses the same
  function, and the Overview's labels are typed by every feature, so
  the two cannot drift.
- A reserve typed above 100 is saved as 100 and the field shows 100
  again (the field restarts when the bound changes the number).
- The lower-effort map refuses a level no model on the server offers
  (a typo such as hgih=medium).
- Model policy (#268): a section in the Agents group after Usage pacing,
  server only: the mode, the allowed rows edited as JSON and checked as
  the server's save checks them, a warning with the kept text when the
  stored value cannot be read, an Overview line and search items.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ks for the mode; flag unknown drivers

- The unreadable-value test used exact text matches; use toMatchTextContent, as vitest 5's
  toHaveTextContent(string) is exact.
- "Edit allowed models" on an unreadable stored value repeats the warning with the kept text,
  starts from the value's own rows, and saves only after the person picks the mode (the file's own
  mode is marked), so a save no longer turns the mode into the fail-closed Enforce.
- The row warning names the mode select and reset as replacing the value too.
- A policy row whose driver no provider on the selected environments has is flagged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nknown-driver flag

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@scuttletoby

Copy link
Copy Markdown
Owner Author

Rebased onto main after #542 merged (dropped #542's own commits; #544 rebased on top, its base unchanged).

Conflicts and how they were resolved:

  • apps/server/src/golive/forkReport.ts: main's fork: read-only "is T3 busy?" probe for quiet checks #547 added the activityProbe feature to the report's own "where is each feature on" function, which this PR moves into the contracts (forkFeaturesWhere in packages/contracts/src/forkFeatures.ts). Kept this PR's move and added activityProbe to FORK_FEATURES and forkFeaturesWhere, so the report still lists it as main does.
  • Because the Overview is typed by every feature, it now has an "Activity probe" line (after Automatic updates); its two Overview tests were updated to match.
  • FORK_CHANGES.md: kept this PR's rows and main's new fork: read-only "is T3 busy?" probe for quiet checks #547 row, reformatted with vp fmt.

Local checks on both branches: typecheck, lint, vp fmt --check, the seam check with main as --config-ref, the FORK_CHANGES list test, contracts tests, server golive tests (fork report) and web settings unit tests all pass. Browser tests run in CI only.

@scuttletoby
scuttletoby merged commit 119fe4f into main Nov 19, 2026
37 checks passed
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.

1 participant