Repository navigation
Fork: assistant setup (switch, built-in assistant profile, Make assistant) - #953
scuttletoby wants to merge 3 commits into
Conversation
…tant) The switch assistant.enabled (off by default) offers "Make assistant" in Settings. It makes a thread in the Scratch project and names it the assistant in one person-path settings save: threadRoles.assistant (the server's role guard decides) and the thread's MCP profile pick "assistant". The new built-in profile "assistant" has no outside servers, no built-in tools (builtinTools "none", Claude only) and the T3 groups orchestration, threads and projects. The web list of built-ins now reads the one table in contracts. Assistant PR 2 of 18. Docs: docs/fork/assistant.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- FORK_CHANGES row: all five cells, naming server.assistant (the fork-changes-list test failed without it). - Make assistant saves the profile pick before it makes the thread, so a setup that stops half-way never leaves a wider "Assistant" thread; the role is a second save once the thread exists. - The button stays busy until the saves settle; a ref stops a double click from making two threads. - An archived assistant reads as not active (the client's thread list holds active threads only), not as deleted. - The button row is locked when a policy owns mcpThreadProfiles. - Docs: what the three T3 tool groups can do, the upgrade note for an own profile called "assistant", and the half-way states. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
lens: code · reviewer: lens agent (Opus, read-only) · read at: b1a7658 |
|
lens: code · reviewer: lens agent (Opus, read-only), replaces my report above (it missed two CI failures) · read at: b1a7658 |
Assistant PR 2 of 18 (#879). Builds on #927 (
builtinTools: "none") and #928 (threadRoles).What and why
The assistant is one long thread you talk to across projects. This PR lets you set it up. It is off by default.
Settings block
assistant(server, person-only, whole-managed).assistant.enabledis off by default. When it is off, Settings shows no Make assistant button. A bad or missing value reads as off.Built-in MCP profile
assistant:servers: []builtinTools: "none"(no shell, file or web tools; Claude only, as in fork: MCP profile builtinTools "none" (assistant PR 1) #927)t3Tools:orchestration,threads,projects, plus the tools every profile keeps.allandt3-onlyin the one built-in table in contracts. The web list of built-ins now reads that table instead of keeping its own copy.Settings → Fork → Assistant: a switch, then a row with Make assistant. The button makes two settings saves from the person at the screen:
mcpThreadProfiles[id] = "assistant"for a new thread id, before the thread exists;threadRoles.assistant = id;Because the pick comes first, a thread called "Assistant" never runs with a wider profile, even if setup stops half-way. The role goes through the existing
threadRolesserver guard (thread exists, top-level, own project; person-only key). No agent path writes a role or a profile pick. If the role save is refused, the new thread is deleted while it is still empty (onlyIfUnused). The button stays busy until the saves settle, and a ref stops a double click. The row is locked when a managed policy ownsthreadRolesormcpThreadProfiles, and it shows whether the assistant thread is active or not.Docs: new
docs/fork/assistant.md, including what the three T3 tool groups can really do (projectscan also create, clone, update and delete projects;threadscan configure other threads). Indocs/fork/README.md: a table row and section forserver.assistant, and the built-ins text now lists three. AFORK_CHANGES.mdline.Owner answers used (#153–#158, all yes): the assistant may start work without a tap (#158), so it runs full-access with no built-in tools.
Size
The plan said at most 400 changed lines. This PR is 585+ / 20−: 361 code, 130 test, 94 docs. I did not split it. Without its tests and docs it is under 400, and none of the parts is useful on its own: the setting, the profile and the button only make sense together. #927 grew the same way (531+ against a plan of 250).
Upstream fit
ForkSettingsPanel.useScratchProject,threadEnvironment.create/delete,waitForThreadShelland the settings save.threadRoles), with no new server path.General vs project
All general. There are no project names, paths or facts. The profile is a general least-privilege set; any thread can pick it. Which provider and model to use comes from the environment's providers.
State question
threadRoles.assistantto it. The old thread keeps itsassistantpick and is not touched. Nothing is lost. A double click makes one thread, because a ref guards the run and the button stays busy until the saves settle.threadRolesrule). The pointer and pick stay until the next Make assistant replaces the pointer.assistantsaved before this version: the entry makes the built-in "broken", so every thread that picks it is refused (fail closed) until it is removed. This uses the same rule asallandt3-only, and the test is extended to coverassistant. The docs carry an upgrade note: rename your own profile and move its picks first, because after removal those picks get the built-in.assistantis read leniently: anything butenabled: trueis off, and other settings are kept (tested). A badthreadRolesreads as no roles (Calm sidebar part 1: threadRoles and calmSidebarEnabled settings #928). A thread whose profile cannot be read is refused, never widened.assistantprofile and no role; Settings still says there is no assistant. If the role save fails or the thread does not reach the client, the empty thread is deleted and the pick stays, which is harmless.assistant.assistant) is refused as an unknown profile, nothing is made, and nothing is widened.Known limits (later PRs)
docs/fork/assistant.mdand left for PR 3.Tests (each fails without the change)
I ran the new and changed tests against origin/main's source files with this PR's tests in place:
packages/contracts/src/assistant.test.ts: 2 fail (noassistantkey).packages/shared/src/forkSettingsPatch.test.ts"takes a pick of the assistant's built-in": fails (the pick is refused as unknown).packages/shared/src/forkDocs.test.ts: 3 fail (README row and section with no setting)..github/scripts/fork-changes-list.test.cjs: fails with the first version of theFORK_CHANGES.mdrow (noserver.assistantnamed), and passes now.apps/server/src/fork/mcpProfile.test.ts: 2 fail. A hand-writtenassistantentry is accepted, and the built-in is "not set up".apps/server/src/golive/forkReport.test.ts: 1 fails.apps/web/.../assistantSetup.logic.test.ts: fails (the module is missing). It checks that the pick save passes the save check before the thread exists, that the pick alone already resolves tobuiltinTools: "none", and then the role save.mcpProfileSettings.logic.test.ts: 2 fail (only two built-ins;assistantcan be saved as a custom profile).The tests use real behaviour: the patch goes through
applyServerSettingsPatchandforkSettingsWriteProblem, and its pick through the real resolver. No mocks.Checks run
McpProfileSettings9, all passing..github/scripts/*.test.cjs: 368 passing.vp fmt --checkon the touched files passes.node .github/scripts/fork-seam-check.cjs --config-ref origin/main origin/main HEADreturns 0.Review
One Opus lens (high effort, read-only, asked the state question). It found:
FORK_CHANGES.mdrow had one cell, not five, and did not nameserver.assistant.mcpThreadProfiles.assistantand what the tool groups can do.projectsandthreadsgroups give the assistant more than starting and messaging work: it can delete or clone projects and configure other threads. This PR documents it; a finer split of the groups is a later decision.🤖 Generated with Claude Code