Repository navigation
feat(threads): add model advisors and automatic reviews - #1471
Merged
Merged
Conversation
nixuuu
enabled auto-merge (squash)
November 29, 2026 15:00
nixuuu
disabled auto-merge
November 29, 2026 15:04
nixuuu
marked this pull request as draft
November 29, 2026 15:04
nixuuu
marked this pull request as ready for review
November 29, 2026 15:19
nixuuu
enabled auto-merge (squash)
November 29, 2026 15:19
nixuuu
disabled auto-merge
November 29, 2026 15:21
nixuuu
marked this pull request as draft
November 29, 2026 15:21
nixuuu
marked this pull request as ready for review
November 29, 2026 15:30
nixuuu
enabled auto-merge (squash)
November 29, 2026 15:30
nixuuu
added a commit
that referenced
this pull request
Nov 29, 2026
nixuuu
added a commit
that referenced
this pull request
Nov 29, 2026
## Change Project roles are off by default. An owner can enable them globally and let each project inherit, opt in or opt out. Ordinary delegation and file mentions work independently of project role settings. Define an agent role in the project's `.agents/agents/` directory or import an existing plugin's Markdown definition in **Settings → Projects → Agent roles**. Start a thread with its role, provider, model and reasoning settings, or mention `@role` in a message to ask the current agent to delegate. The agent bus lists project roles and accepts `spawn_thread.role`. The gateway resolves the definition against the target checkout and retains the admitted instructions and tool policy with the thread. The worker preserves imported metadata and detects stale edits. Claude sessions can honor supported tool restrictions and required skills. Worker and linked-gateway capabilities gate these features. When a role has a native Claude tool allowlist, it cannot request an advisor consultation through MCP. Owner-configured automatic reviews still apply independently. The advisor schema now exposes the tool to Claude sessions that allow it, while the call handler continues to require a question or review. Fixes: #1471 (Claude advisor tool discovery) ## Verification - Ran focused gateway/worker integration tests for catalogue scope, Markdown import, edit conflicts, real Git worktrees, role discovery, explicit mentions and side-thread creation. Ran the affected draft, agent bus and Claude harness tests. - Tested the sample ITSOL Svelte reviewer with a real Claude CLI and a local inference fixture. The request contained the role and skill and exposed the four declared tools. - Verified role creation writes Markdown, imported the original ITSOL file, selected a role and submitted a message mentioning a different role in the real web app with a disposable database and worker. Checked `@` suggestions and the missing-model state at 390 px as well as desktop layout. - Verified opt-in using the real web settings and gateway. A fresh account made zero catalogue requests, offered only files at `@`, and the gateway rejected a named launch. Tested both directions of the project override and changing the inherited account default back to off. Integration tests cover settings sync, catalogue and execution gates, ordinary delegation, and compatibility with older linked computers. - Checked the native role picker and mentions on an Android emulator with sample data. Verified the account switch on the normal Settings → Threads → Sandbox and subagents screen, including its accessibility label and narrow layout. The paired gateway was offline. Project setting writes and end-to-end launch on mobile were not exercised. - Verified coexistence with model advisors in a running web app. A draft kept its previously selected advisor when the project opted into roles. After submitting the new thread, the gateway returned the code reviewer role, high reasoning effort and the selected advisor. - Restored a web draft after its role was changed to subagent-only on disk. Send stayed disabled with its role and text intact. Choosing No role enabled Send and preserved the task. - Verified stored-session validation with Claude absent from PATH. - Generated the contracts; scoped package typechecks and lint passed. Full CI checks run on the PR revision. ## Copy audit The web settings, role editor, picker, role mentions and mobile role controls use the existing Canopy terms. “Agent role” and “role” are documented in the glossary. Creation and import use action labels. Missing models, incompatible effort and conflicting edits give a recovery action. Verified descriptions with short, typical and long content and checked accessible control labels and selection states.
nixuuu
added a commit
that referenced
this pull request
Nov 29, 2026
Fixes: #1471 ## Summary - Keep the Advisor picker beside the model controls after a web or desktop thread starts. Save the model, Off, and automatic review for future turns. - Show the most recent loaded consultation and link to its transcript entry. Keep consultation history accessible while the composer is sending a message. - Keep the confirmed setting visible when a live update changes another part of the thread during a save. ## Verification - Web typecheck, lint on edited components, and `git diff --check`. - Nine advisor integration and worker tests through `check:tmp`. - Chromium with an isolated gateway and test worker. Verified saving during a turn, next-turn settings, live consultation states, the history jump, a failed save and retry, a concurrent thread update, and consultation access while sending. Checked touch layouts at 320 and 390 px with a long model name. - Repository-wide checks remain with GitHub CI. ## Copy audit - **Advisor** → **Advisor off** for an unconfigured composer. The label now states the setting explicitly. - The picker now tells users when a change takes effect and whether the latest consultation is in progress, completed, stopped, or failed. **View consultation** takes users to the transcript entry. - The save error tells users to retry. Checked sentence case, accessible names, and long model names at narrow widths.
This was referenced Nov 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Behavior
A thread can use a second model for advice. Its main agent can ask a focused question or request a review of the current plan or changes. The owner can also enable automatic reviews. The worker passes the task and relevant material to an isolated text session on the chosen provider instance.
Restoring the general new-thread defaults preserves the advisor and project scope. The Advisor card provides individual resets for its model, automatic review and project scope.
Local verification
Focused worker and gateway tests covered consultation execution, isolated harnesses, redelivery, Stop, restart, usage attribution, synchronized settings, thread reads and draft inheritance.
Targeted package typechecks, changed-file lint and formatting, and existing work grouping tests passed.
In an isolated gateway and PostgreSQL stack, Chromium exercised save, reload, cancel, explicit Off, and both kinds of transcript entry at desktop and phone widths. A new-thread draft synchronized the model choice, explicit Off, and the reset to inheritance.
Six gateway integration tests exercised advisor inheritance and linked settings. Coverage includes scratch threads, explicit overrides, a newly added project, resetting an empty selection to All, and resolving distinct home workspaces for a single grouped project across two gateways.
Chromium exercised All projects, selected projects, quick edits, search, explicit project Off, a custom model outside the selection, and returning to inheritance. Sending through the composer created threads with the expected advisor and kept the excluded thread Off after switching back to All. The scope selector stayed aligned and usable at 390, 790 and 1240 px.
After splitting the groups, Chromium verified the two cards on the global and project screens, the inherited Off label, the independent general reset with persistence after reload, conditional controls and the searchable picker at 390, 790 and 1240 px.
A disposable Android emulator exercised the native controls with fixture data, including the consultation states, scope search, quick multi-selection, No project, empty selection, reopening the sheet and returning to All. The client rendered the project picker in light and dark mode. The real Android thread settings screen was also exercised with fixture data after separating the cards. Closing the native project picker without edits produced zero saves and adding a project produced one. The independent project card was exercised in Chromium. Provider verification used harness fixtures.
A duplicate workspace project ID had displaced useful content from the bot handoff excerpt. The link now sets the extra ID only when it rewrites the visible project ID. The 10 handoff tests and linked-project checks passed locally after this correction.
Copy audit
Reviewed the new strings against §8 of docs/copy.md. The glossary distinguishes advisor and automatic review from a user's draft review. The collapsed consultation identifies its trigger. The existing thread dialog explains when changes apply. Icon-only controls retain accessible names. The scope row explains project precedence and identifies an empty selection. “No project” matches the existing workspace choice. In the Advisor card, the heading identifies the feature and the rows read Model, Automatic review and Projects. The model control keeps its explicit accessible name.
Full repository verification runs in CI.