diff --git a/FORK_CHANGES.md b/FORK_CHANGES.md index 79ef142ea7bda..c32009d0e1a4b 100644 --- a/FORK_CHANGES.md +++ b/FORK_CHANGES.md @@ -25,7 +25,7 @@ setting is missing here or a setting named here does not exist. | Machine facts: `t3_environment_read` also returns `hostResources` (CPU, cores, memory; the field of upstream PR #34293, closed there unmerged) and `placement` (labels, available and reason, running agents, slots free, memory floor, facts time), for this machine and a linked one. | An agent choosing where to run work can see which machine has room without asking the person. | none | always | [#820](https://github.com/scuttletoby/t3code/pull/820) | | Waits: agents can wait for a pull request, a file, a system unit, a named check command or a free agent slot (`wait_for`, `wait_list`, `wait_cancel`), and are woken when it happens. | An agent no longer polls or sleeps while it waits. | `server.waitFor`, `server.waitChecks`, `projectOverride.waitChecks` | off | [#84](https://github.com/scuttletoby/t3code/pull/84), [#90](https://github.com/scuttletoby/t3code/pull/90), [#91](https://github.com/scuttletoby/t3code/pull/91), [#103](https://github.com/scuttletoby/t3code/pull/103), [#106](https://github.com/scuttletoby/t3code/pull/106), [#109](https://github.com/scuttletoby/t3code/pull/109), [#110](https://github.com/scuttletoby/t3code/pull/110), [#116](https://github.com/scuttletoby/t3code/pull/116), [#119](https://github.com/scuttletoby/t3code/pull/119) | | Delegated results: `task_list` lists a thread's delegated tasks whose result it has not read, and its running children per place from live status; a parent whose finished child's result never arrived gets one reminder. | A finished child's result can no longer sit unseen. | `server.waitFor` (the reminder) | off; `task_list` always (read only) | [#622](https://github.com/scuttletoby/t3code/pull/622), [#641](https://github.com/scuttletoby/t3code/pull/641) | -| The Settings page **Fork** (`/settings/fork`): every fork setting in one place, with one line per feature at the top saying whether it is on: waits, wait checks, agent slots, usage pacing (per account by name), model policy, review rules, automatic updates, handoff, playtest and MCP profiles. | Change every fork setting without editing a file. | `server.waitFor`, `server.waitChecks`, `server.agentSlots`, `server.usagePacing`, `server.usagePacingGate`, `server.usagePacingLowerEffort`, `server.reviewRules`, `server.modelPolicy`, `server.automaticUpdates`, `server.automaticUpdatesQuietCommand`, `server.handoff`, `server.playtest`, `server.mcpProfiles`, `server.mcpProfile`, `server.mcpSubagentProfile`, `server.mcpThreadProfiles` | off | [#104](https://github.com/scuttletoby/t3code/pull/104), [#543](https://github.com/scuttletoby/t3code/pull/543), [#544](https://github.com/scuttletoby/t3code/pull/544) | +| The Settings page **Fork** (`/settings/fork`): every fork setting in one place, grouped by what a person wants to do, each with one line of help saying what on and off do and its default, rare options under Advanced, and one line per feature at the top saying whether it is on: waits, wait checks, agent slots, usage pacing (per account by name), model policy, review rules, automatic updates, handoff, playtest and MCP profiles. | Change every fork setting without editing a file. | `server.waitFor`, `server.waitChecks`, `server.agentSlots`, `server.usagePacing`, `server.usagePacingGate`, `server.usagePacingLowerEffort`, `server.reviewRules`, `server.modelPolicy`, `server.automaticUpdates`, `server.automaticUpdatesQuietCommand`, `server.handoff`, `server.playtest`, `server.mcpProfiles`, `server.mcpProfile`, `server.mcpSubagentProfile`, `server.mcpThreadProfiles` | off | [#104](https://github.com/scuttletoby/t3code/pull/104), [#543](https://github.com/scuttletoby/t3code/pull/543), [#544](https://github.com/scuttletoby/t3code/pull/544) | | The fork's checks on `delegate_task` (pacing, slots) sit behind one fork module. | Fewer fork lines in upstream's code, so syncs conflict less. No change in behaviour. | none | always | [#174](https://github.com/scuttletoby/t3code/pull/174) | | The fork's service layers in the server are wired from one fork file (`apps/server/src/fork/forkLayers.ts`). | Fewer fork lines in upstream's code, so syncs conflict less. No change in behaviour. | none | always | [#384](https://github.com/scuttletoby/t3code/pull/384) | | A pure capacity rule for "dynamic slots" (one budget per machine), with shared test cases. Not wired into anything yet. | A later step replaces fixed agent counts with what the machine can take. | none | not used | [#203](https://github.com/scuttletoby/t3code/pull/203) | diff --git a/README.md b/README.md index 2e7a31efc3f1b..32bf2a68f93b1 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ -> **This is a fork of [T3 Code](https://github.com/pingdotgg/t3code).** It follows upstream's releases daily. With no fork -> settings it behaves like upstream, except that it updates from this fork's releases. What it adds: +> **This is a fork of [T3 Code](https://github.com/pingdotgg/t3code)** for people who run many coding agents on their own +> machines and plans. It rebases onto upstream's newest release daily and ships it as `v.fork.`. With no fork +> settings it behaves like upstream, except that it updates from this fork's releases. Every fork switch is off until you +> turn it on, most in **Settings → Fork** (a few only in the settings file). Among what it adds: > -> - **Usage pacing and agent slots:** agents keep a reserve of each subscription limit free for you, and a machine never -> runs more agents than it has room for. -> - **Waits:** an agent sleeps until a pull request, file, system unit or check changes, and is woken then, instead of polling. -> - **Self-update:** a server running as a boot service can update itself once no thread is working. -> - **Fleet CI:** one-job runners on your own machines and desktops, each behind walls, a merge queue and shared CI actions. +> - **Plan usage pacing and a limit on running agents:** agents leave you part of each plan, and a machine never runs too many. +> - **Agent waits**, **models agents may use**, **tool profiles**, **handoff instead of compaction**, **automatic updates**. > -> Every change, one line each: [FORK_CHANGES.md](FORK_CHANGES.md). Settings and how to install: [docs/fork/README.md](docs/fork/README.md). +> About the fork, every feature with where to turn it on, and what is planned: [docs/fork/about.md](docs/fork/about.md). +> Install and every setting: [docs/fork/README.md](docs/fork/README.md). Every change: [FORK_CHANGES.md](FORK_CHANGES.md).

diff --git a/apps/web/src/components/settings/WaitsAndSlotsSettings.browser.test.tsx b/apps/web/src/components/settings/WaitsAndSlotsSettings.browser.test.tsx index e548c046890a4..79f02b099e262 100644 --- a/apps/web/src/components/settings/WaitsAndSlotsSettings.browser.test.tsx +++ b/apps/web/src/components/settings/WaitsAndSlotsSettings.browser.test.tsx @@ -120,8 +120,8 @@ describe("WaitsAndSlotsSettings (#105)", () => { await expect.element(screen.getByText("Agents on Claude A")).toBeVisible(); // The unit beside a field is separate text, so the field's own name has to say it. const names = [ - "Default time limit in hours", - "Open waits per thread in waits", + "Time limit when the agent sets none in hours", + "Waits open at once per thread in waits", "Agents on Claude A in agents", ]; const unnamed = names.filter( diff --git a/apps/web/src/components/settings/WaitsAndSlotsSettings.tsx b/apps/web/src/components/settings/WaitsAndSlotsSettings.tsx index cc578dc60dd4b..19c288c4e9ffe 100644 --- a/apps/web/src/components/settings/WaitsAndSlotsSettings.tsx +++ b/apps/web/src/components/settings/WaitsAndSlotsSettings.tsx @@ -59,6 +59,7 @@ import { withWaitCheck, withoutWaitCheck, } from "./waitsAndSlotsSettings.logic"; +import { defaultIs } from "./fork/forkDefaultText.logic"; type UpdateSettings = ReturnType; @@ -103,7 +104,7 @@ function NumberSettingRow({ serverScoped id={`${settingKey}-${field.key}`} title={field.title} - description={field.description} + description={`${field.description} Default: ${defaultValue} ${field.unit}.`} settingKeys={[settingKey]} mixed={mixed} resetAction={ @@ -153,7 +154,7 @@ function WaitForSection({ updateSettings }: { readonly updateSettings: UpdateSet )); return ( - + + + + {isProjectScope ? null : } + + + ); +} + +/** Agent slots are environment-wide, so a project screen does not show them. */ +export function AgentSlotsSettings() { + const updateSettings = useUpdateScopedSettings(); + return ; +} + /** * Waits and agent slots are environment-wide, so a project screen shows only its wait checks, * which a project may override as a whole map. */ export function WaitsAndSlotsSettings({ isProjectScope }: { readonly isProjectScope: boolean }) { - const updateSettings = useUpdateScopedSettings(); return ( <> - {isProjectScope ? null : } - - {isProjectScope ? null : } + + {isProjectScope ? null : } ); } diff --git a/apps/web/src/components/settings/fork/AssistantSettings.tsx b/apps/web/src/components/settings/fork/AssistantSettings.tsx index be1cd71251524..9ca2673566c6e 100644 --- a/apps/web/src/components/settings/fork/AssistantSettings.tsx +++ b/apps/web/src/components/settings/fork/AssistantSettings.tsx @@ -38,6 +38,7 @@ import { assistantThreadText, makeAssistantThread, } from "./assistantSetup.logic"; +import { defaultIs } from "./forkDefaultText.logic"; /** True once this client holds no thread `ref` (deleted, or never made); false after 5 seconds. */ const waitForThreadShellGone = (ref: ScopedThreadRef) => @@ -144,7 +145,7 @@ export function AssistantSettings() { {...searchableSetting("assistant")} settingKeys={["assistant"]} lockPaths={["assistant"]} - description="One thread you talk to across projects, Claude only. Its profile `assistant` has no shell, files, web or outside servers, but its T3 tools do more than read, start and message threads, and it uses them without asking you: it can also change another thread's model and settings, interrupt threads, stop workflows, link and unlink environments, create projects, clone a repository onto disk, and delete projects (a forced delete also deletes all of that project's threads, archived ones too). Splitting these tools is fork issue #954. Off: Settings offers no Make assistant." + description={`On: Settings offers Make assistant, one Claude thread you talk to that works across all your projects. Off: no assistant is offered. ${defaultIs("assistant")} Know before you turn it on: its profile \`assistant\` has no shell, files, web or outside servers, but its T3 tools do more than read, start and message threads, and it uses them without asking you: it can also change another thread's model and settings, interrupt threads, stop workflows, link and unlink environments, create projects, clone a repository onto disk, and delete projects (a forced delete also deletes all of that project's threads, archived ones too). Splitting these tools into smaller sets is planned.`} control={ { await userEvent.click(toggle); expect(state.update.mock.calls[0]![0]).toEqual({ automaticUpdates: true }); + // The quiet check is a rarely changed option, folded under Advanced. + await userEvent.click(screen.getByRole("button", { name: "Advanced" })); await userEvent.type( screen.getByRole("textbox", { name: "Quiet check before an update" }), " /usr/local/bin/quiet {Enter}", diff --git a/apps/web/src/components/settings/fork/ForkRow.tsx b/apps/web/src/components/settings/fork/ForkRow.tsx index d9b5bdd94c985..c76adfd07847f 100644 --- a/apps/web/src/components/settings/fork/ForkRow.tsx +++ b/apps/web/src/components/settings/fork/ForkRow.tsx @@ -6,10 +6,12 @@ */ /* oxlint-disable t3code/no-untranslated-copy -- Fork: the fork's own settings are English only; upstream's translation catalogs hold no fork keys. */ import { isManagedSettingPath, type ServerSettings } from "@t3tools/contracts"; -import { type ComponentProps, useState } from "react"; +import { CheckIcon, CircleAlertIcon } from "lucide-react"; +import { type ComponentProps, type ReactNode, useState } from "react"; import { useEnvironmentProviders } from "../../../state/environments"; import { EMPTY_SERVER_PROVIDERS } from "../../../state/server"; +import { AdvancedSettings } from "../AdvancedSettings"; import { IntervalSecondsField } from "../IntervalSecondsField"; import { useSettingsScope } from "../SettingsScopeContext"; import { SettingResetButton, SettingsRow } from "../settingsLayout"; @@ -138,3 +140,75 @@ export function useSubRowReset( ); }; } + +/** + * A dropdown row's help: a lead line, then one line for every option, then a closing line. The chosen + * option is marked with a check and the words "(chosen)" for screen readers, not by colour alone. + * Upstream's select items hold only a label, so the choices are explained here. + */ +export function OptionLines({ + lead, + options, + selected, + tail, +}: { + readonly lead?: ReactNode; + readonly options: ReadonlyArray<{ readonly value: string; readonly description: string }>; + readonly selected?: string | null | undefined; + readonly tail: ReactNode; +}) { + return ( + <> + {lead ? {lead} : null} + {options.map((option) => + option.value === selected ? ( + + + + {option.description} + (chosen) + + + ) : ( + + {option.description} + + ), + )} + {tail} + + ); +} + +/** + * Upstream's Advanced fold, plus a line above it naming a problem in a saved value under the fold, + * so a problem shows while the fold is closed. + */ +export function ForkAdvanced({ + targetIds, + problem, + children, +}: { + readonly targetIds: ReadonlyArray; + readonly problem?: string | null; + readonly children: ReactNode; +}) { + return ( + <> + {problem ? ( +

+ + Under Advanced: {problem} +

+ ) : null} + {children} + + ); +} diff --git a/apps/web/src/components/settings/fork/ForkSettingsPanel.tsx b/apps/web/src/components/settings/fork/ForkSettingsPanel.tsx index e50bbda61362f..9fd07ee385dcc 100644 --- a/apps/web/src/components/settings/fork/ForkSettingsPanel.tsx +++ b/apps/web/src/components/settings/fork/ForkSettingsPanel.tsx @@ -1,16 +1,17 @@ /** - * Fork: the Settings page "Fork" (/settings/fork), every fork setting in one place. Each group - * mounts the fork's own panels; a project screen shows only the settings a project may override. + * Fork: the Settings page "Fork" (/settings/fork), every fork setting in one place, grouped by what a + * person wants to do. Each group mounts the fork's own panels; a project screen shows only the + * settings a project may override, and a group with nothing to show is left out. */ /* oxlint-disable t3code/no-untranslated-copy -- Fork: this page is the fork's own and its text is English only; upstream's translation catalogs hold no fork keys. */ import { DEFAULT_SERVER_SETTINGS } from "@t3tools/contracts"; -import type { ReactNode } from "react"; +import { Children, type ReactNode, useId } from "react"; import { ReviewRulesSettings } from "../ReviewRulesSettings"; import { useSettingsScope } from "../SettingsScopeContext"; import { SettingsPageContainer, SettingsRow, SettingsSection } from "../settingsLayout"; import { useSearchableSetting } from "../settingsSearch"; -import { WaitsAndSlotsSettings } from "../WaitsAndSlotsSettings"; +import { AgentSlotsSettings, WaitsSettings } from "../WaitsAndSlotsSettings"; import { AssistantSettings } from "./AssistantSettings"; import { forkFeatureStatuses } from "./forkStatus.logic"; import { HandoffSettings } from "./HandoffSettings"; @@ -36,23 +37,37 @@ export function ForkSettingsPanel() { ); } + const server = (node: ReactNode) => (isProjectScope ? null : node); return ( - - - {isProjectScope ? null : } - {isProjectScope ? null : } - {isProjectScope ? null : } + + {server()} + {server()} + {server()} + + + - - + + {server()} + - {isProjectScope ? null : } + {/* A group of one section shows no group heading: the section's own title names it. */} + + {server()} - - {isProjectScope ? null : } + {server()} ); } @@ -67,7 +82,7 @@ function ForkStatusSection() {
    {statuses.map((status) => ( @@ -84,12 +99,37 @@ function ForkStatusSection() { ); } -function ForkGroup({ title, children }: { readonly title: string; readonly children: ReactNode }) { +/** A heading for related sections, left out when its sections have nothing to show here. */ +function ForkGroup({ + title, + description, + children, +}: { + readonly title: string; + readonly description: string; + readonly children: ReactNode; +}) { + const titleId = useId(); + const descriptionId = useId(); + if (Children.toArray(children).length === 0) return null; return ( -
    -

    - {title} -

    +
    +
    +

    + {title} +

    +

    + {description} +

    +
    {children}
    ); diff --git a/apps/web/src/components/settings/fork/HandoffSettings.tsx b/apps/web/src/components/settings/fork/HandoffSettings.tsx index 18e0579d1bc4e..5d06c2f3056dd 100644 --- a/apps/web/src/components/settings/fork/HandoffSettings.tsx +++ b/apps/web/src/components/settings/fork/HandoffSettings.tsx @@ -17,7 +17,6 @@ import { useThreadShells } from "../../../state/entities"; import { Button } from "../../ui/button"; import { Input } from "../../ui/input"; import { Select, SelectItem, SelectPopup, SelectTrigger, SelectValue } from "../../ui/select"; -import { AdvancedSettings } from "../AdvancedSettings"; import { SettingResetButton, SettingsSection } from "../settingsLayout"; import { useSearchableSetting } from "../settingsSearch"; import { @@ -28,7 +27,7 @@ import { useUpdateScopedSettings, } from "../useScopedSettings"; import { CommitTextField } from "./CommitTextField"; -import { BoundedNumberField, ForkRow, useSubRowReset } from "./ForkRow"; +import { BoundedNumberField, ForkAdvanced, ForkRow, OptionLines, useSubRowReset } from "./ForkRow"; import { HANDOFF_MODE_OPTIONS, boundHandoffTokens, @@ -40,6 +39,7 @@ import { threadModeProblem, withThreadMode, } from "./handoffSettings.logic"; +import { defaultIs } from "./forkDefaultText.logic"; const MIXED = "The selected environments or projects have different handoff settings. Select one to edit them."; @@ -103,7 +103,6 @@ export function HandoffSettings({ isProjectScope }: { readonly isProjectScope: b isProjectScope && source === "project", save, ); - const option = HANDOFF_MODE_OPTIONS.find((candidate) => candidate.value === shown.mode); const scopeNote = !isProjectScope ? "" : source === "project" @@ -126,7 +125,7 @@ export function HandoffSettings({ isProjectScope }: { readonly isProjectScope: b if (mixed) { return ( - + + clearScopedSettings(["handoff"])} - description={`${option?.description ?? ""}${scopeNote}`} + description={ + + } resetAction={ !isProjectScope && shown.mode !== DEFAULT_HANDOFF_SETTINGS.mode ? (
    @@ -231,8 +236,9 @@ export function HandoffSettings({ isProjectScope }: { readonly isProjectScope: b ) : null}
    -
    -
    +
    ); } diff --git a/apps/web/src/components/settings/fork/McpProfileSettings.browser.test.tsx b/apps/web/src/components/settings/fork/McpProfileSettings.browser.test.tsx index 5a9b912806d31..52c0960adbf74 100644 --- a/apps/web/src/components/settings/fork/McpProfileSettings.browser.test.tsx +++ b/apps/web/src/components/settings/fork/McpProfileSettings.browser.test.tsx @@ -172,6 +172,7 @@ describe("McpProfileSettings", () => { setup({ mcpProfiles: { lean: { servers: [], t3Tools: "all" } } }); state.writeAllowed = false; await using screen = await render(); + await userEvent.click(screen.getByRole("button", { name: "Advanced" })); await expect.element(screen.getByText("lean")).toBeVisible(); for (const selector of [ '[aria-label="Delete MCP profile lean"]', @@ -191,6 +192,7 @@ describe("McpProfileSettings", () => { mcpThreadProfiles: { "thread-2": "t3-only" }, }); await using screen = await render(); + await userEvent.click(screen.getByRole("button", { name: "Advanced" })); await userEvent.click(screen.getByRole("button", { name: "Add thread" })); const id = screen.getByRole("textbox", { name: "Thread id for an MCP profile pick" }); await userEvent.fill(id, "thread-1"); @@ -221,6 +223,7 @@ describe("McpProfileSettings", () => { it("writes nothing on cancel, also after a profile was chosen", async () => { setup({}); await using screen = await render(); + await userEvent.click(screen.getByRole("button", { name: "Advanced" })); await userEvent.click(screen.getByRole("button", { name: "Add thread" })); await userEvent.fill( screen.getByRole("textbox", { name: "Thread id for an MCP profile pick" }), @@ -249,6 +252,13 @@ describe("McpProfileSettings", () => { }); state.shells = [shellOf("parent", "Lead"), shellOf("child", "Helper", "parent")]; await using screen = await render(); + // Shown with Advanced still folded. + await expect + .element( + screen.getByText("Under Advanced: 1 thread pick gives more than the thread's parent has."), + ) + .toBeVisible(); + await userEvent.click(screen.getByRole("button", { name: "Advanced" })); await expect .element( screen.getByText( @@ -264,6 +274,11 @@ describe("McpProfileSettings", () => { it("shows a blank pick from a hand edit as broken, and clears it", async () => { setup({ mcpThreadProfiles: { "thread-1": " " } }); await using screen = await render(); + // Shown with Advanced still folded. + await expect + .element(screen.getByText("Under Advanced: 1 thread pick is blank and ignored.")) + .toBeVisible(); + await userEvent.click(screen.getByRole("button", { name: "Advanced" })); await expect .element(screen.getByText(/Its pick in settings.json is blank, so it is ignored/)) .toBeVisible(); diff --git a/apps/web/src/components/settings/fork/McpProfileSettings.tsx b/apps/web/src/components/settings/fork/McpProfileSettings.tsx index 665f3a150a271..b7daf1d05846a 100644 --- a/apps/web/src/components/settings/fork/McpProfileSettings.tsx +++ b/apps/web/src/components/settings/fork/McpProfileSettings.tsx @@ -29,7 +29,7 @@ import { useScopedSettingsMixed, useUpdateScopedSettings, } from "../useScopedSettings"; -import { ForkRow, useForkRowLock } from "./ForkRow"; +import { ForkAdvanced, ForkRow, useForkRowLock } from "./ForkRow"; import { MCP_ALWAYS_KEPT_NOTE, MCP_NOT_A_SANDBOX_NOTE, @@ -44,6 +44,7 @@ import { emptyMcpProfileDraft, mcpProfileChoices, mcpProfileRows, + mcpPickProblemSummary, mcpServerSuggestions, mcpThreadPickRows, notSetUpNotes, @@ -52,6 +53,7 @@ import { threadPickPatch, threadPickProblem, } from "./mcpProfileSettings.logic"; +import { defaultIs } from "./forkDefaultText.logic"; const MIXED = "The selected environments or projects have different MCP profile settings. Select one to edit them."; @@ -197,7 +199,7 @@ function ProfileEditor({

    {editing}

    )} + clearScopedSettings(["mcpProfile"])} - description={`The profile a top-level thread gets when nobody picked one for it. ${MCP_PROFILE_ALL}: every outside server and every T3 tool, as without profiles.${ + description={`The profile a thread gets when nobody picked one for it. ${MCP_PROFILE_ALL}: every outside server and every T3 tool, as in upstream T3 Code. ${defaultIs("mcpProfile")}${ isProjectScope && defaultSource === "project" ? " This project's own value." : "" } ${MCP_PICK_APPLIES_NOTE}`} control={ @@ -350,7 +352,7 @@ export function McpProfileSettings({ isProjectScope }: { readonly isProjectScope settingKeys={["mcpSubagentProfile"]} lockPaths={["mcpSubagentProfile"]} onResetOverride={() => clearScopedSettings(["mcpSubagentProfile"])} - description={`The profile a delegated child gets when nobody picked one for it. ${MCP_SUBAGENT_INHERIT}: the same as a top-level thread. A child never gets more than its parent.${ + description={`The profile a sub-agent gets when nobody picked one for it. ${MCP_SUBAGENT_INHERIT}: the same as any other thread. A sub-agent never gets more than its parent. ${defaultIs("mcpSubagentProfile")}${ isProjectScope && ruleSource === "project" ? " This project's own value." : "" }`} control={ @@ -367,7 +369,7 @@ export function McpProfileSettings({ isProjectScope }: { readonly isProjectScope if (isProjectScope) { return ( - + {defaultRow} {ruleRow} @@ -380,6 +382,11 @@ export function McpProfileSettings({ isProjectScope }: { readonly isProjectScope const threadSettings = { ...settings, mcpCarriedProfiles, projectSettingsOverrides, threadRoles }; const pickEffect = (threadId: string, name: string) => threadPickEffect(threadSettings, threadId, name, shells); + const blankPicks = pickRows.filter((row) => row.pick === null).length; + const widerPicks = pickRows.filter( + (row) => row.pick !== null && pickEffect(row.threadId, row.pick).widerThanParent, + ).length; + const pickProblem = mcpPickProblemSummary(blankPicks, widerPicks); const draftEffect = pickDraft !== null && pickDraft.threadId.trim() !== "" && pickDraft.profile !== null ? pickEffect(pickDraft.threadId.trim(), pickDraft.profile) @@ -399,12 +406,12 @@ export function McpProfileSettings({ isProjectScope }: { readonly isProjectScope }; return ( - +
    {rows.map((row) => ( @@ -524,124 +531,126 @@ export function McpProfileSettings({ isProjectScope }: { readonly isProjectScope {defaultRow} {ruleRow} - -
    - {pickRows.map((row) => { - const effect = row.pick === null ? null : pickEffect(row.threadId, row.pick); - return ( -
    -
    - - - {row.title ?? "Unknown thread"} + + +
    + {pickRows.map((row) => { + const effect = row.pick === null ? null : pickEffect(row.threadId, row.pick); + return ( +
    +
    + + + {row.title ?? "Unknown thread"} + + {row.threadId} - {row.threadId} - - - save(threadPickPatch(mcpThreadProfiles, row.threadId, name)) - } - /> - + + save(threadPickPatch(mcpThreadProfiles, row.threadId, name)) + } + /> + +
    + {row.pick === null ? ( +

    {MCP_BLANK_PICK_ISSUE}

    + ) : effect?.widerThanParent ? ( +

    {effect.text}

    + ) : null}
    - {row.pick === null ? ( -

    {MCP_BLANK_PICK_ISSUE}

    - ) : effect?.widerThanParent ? ( -

    {effect.text}

    - ) : null} -
    - ); - })} - {pickDraft === null ? ( -
    - -
    - ) : ( -
    -
    - { - setPickError(null); - setPickDraft({ ...pickDraft, threadId: event.target.value }); - }} - onKeyDown={(event) => { - if (event.key === "Enter") addPick(); - }} - /> - { - setPickError(null); - setPickDraft({ ...pickDraft, profile: name }); - }} - /> -
    - {draftEffect !== null ? ( -

    - {draftEffect.text} -

    - ) : null} - {pickError !== null ? ( -

    - {pickError} -

    - ) : null} -
    - + ); + })} + {pickDraft === null ? ( +
    -
    - )} -
    -
    + ) : ( +
    +
    + { + setPickError(null); + setPickDraft({ ...pickDraft, threadId: event.target.value }); + }} + onKeyDown={(event) => { + if (event.key === "Enter") addPick(); + }} + /> + { + setPickError(null); + setPickDraft({ ...pickDraft, profile: name }); + }} + /> +
    + {draftEffect !== null ? ( +

    + {draftEffect.text} +

    + ) : null} + {pickError !== null ? ( +

    + {pickError} +

    + ) : null} +
    + + +
    +
    + )} +
    + + ); } diff --git a/apps/web/src/components/settings/fork/ModelPolicySettings.tsx b/apps/web/src/components/settings/fork/ModelPolicySettings.tsx index 21c352f822180..2b554e858bf06 100644 --- a/apps/web/src/components/settings/fork/ModelPolicySettings.tsx +++ b/apps/web/src/components/settings/fork/ModelPolicySettings.tsx @@ -30,7 +30,7 @@ import { SettingResetButton, SettingsSection } from "../settingsLayout"; import { useSearchableSetting } from "../settingsSearch"; import { useScopedSettings, useUpdateScopedSettings } from "../useScopedSettings"; import { targetsDiffer } from "../waitsAndSlotsSettings.logic"; -import { ForkRow, useSelectedProvidersByEnvironment } from "./ForkRow"; +import { ForkRow, OptionLines, useSelectedProvidersByEnvironment } from "./ForkRow"; import { aliasModelPolicyRows, MODEL_POLICY_MODE_OPTIONS, @@ -43,6 +43,7 @@ import { unreadableModelPolicyText, withModelPolicyAllow, } from "./modelPolicySettings.logic"; +import { defaultIs } from "./forkDefaultText.logic"; const MIXED = "The selected environments have different values. Select one environment to edit it."; @@ -225,7 +226,7 @@ export function ModelPolicySettings() { if (mixed) { return ( - + + + } resetAction={ isDefault ? null : ( - + {option?.label ?? shown.mode} diff --git a/apps/web/src/components/settings/fork/PlaytestSettings.tsx b/apps/web/src/components/settings/fork/PlaytestSettings.tsx index 160ea37b606dc..5c124963bd377 100644 --- a/apps/web/src/components/settings/fork/PlaytestSettings.tsx +++ b/apps/web/src/components/settings/fork/PlaytestSettings.tsx @@ -40,6 +40,7 @@ import { withPlaytestSteps, } from "./playtestSettings.logic"; import { BoundedNumberField, ForkRow, useSubRowReset } from "./ForkRow"; +import { defaultIs } from "./forkDefaultText.logic"; const MIXED = "The selected environments or projects have different playtest settings. Select one to edit them."; @@ -174,7 +175,7 @@ export function PlaytestSettings({ isProjectScope }: { readonly isProjectScope: if (mixed) { return ( - + + 0 ? `Set the steps below first (missing: ${missing.join(", ")}).` - : "You try an agent's unfinished work on a test target, round after round. Nothing starts a session yet." + : `On: an agent can start a playtest with its playtest tool: T3 claims your test target, sends each round with your steps, and gives the target back at the end, so you can try unfinished work. Off: no playtest starts. ${defaultIs("playtest")}` }${scopeNote}`} resetAction={ !isProjectScope && !Equal.equals(shown, DEFAULT_SERVER_SETTINGS.playtest) ? ( @@ -226,7 +227,7 @@ export function PlaytestSettings({ isProjectScope }: { readonly isProjectScope: ["claim", "renew", "push", "release"], "Reset playtest steps to the environment's", )} - description="claim takes the target, renew keeps the claim, push sends a round (one or more named steps), release puts the target back. See docs/fork/playtest.md." + description="The commands T3 runs: claim takes the target, renew keeps the claim, push sends a round (one or more named steps), release gives the target back. All four are needed before playtests can be turned on." control={