Repository navigation
feat(agent): default proactive collaboration - #2480
Conversation
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Agent policy setting src/shared/contracts/domainSchemas.ts, src/shared/types/agent-interface.d.ts, src/main/agent/deepchat/deepChatAgentRepository.ts, src/renderer/settings/components/DeepChatAgentsSettings.vue, src/renderer/src/i18n/*/settings.json, test/main/shared/orchestrationPolicy.test.ts, test/main/agent/deepchat/deepChatAgentRepository.test.ts, test/renderer/components/DeepChatAgentsSettings.test.ts |
Adds optional defaultOrchestrationPolicy config validation and typing. Agent settings store and serialize the value, normalize saved values, and disable the control when Subagents are disabled. Adds localized labels and tests for config handling and settings behavior. |
New-session policy initialization src/renderer/src/pages/NewThreadPage.vue, test/renderer/components/NewThreadPage.test.ts, docs/architecture/proactive-multi-agent-orchestration/spec.md |
New-session drafts use the selected Agent’s proactive default only when Subagents are enabled; otherwise they use explicit. Draft changes are preserved when configuration resolves late, after switching to ACP, or after unmounting. The specification describes the Session-level control and its new-session scope. |
ACP registry updates
| Layer / File(s) | Summary |
|---|---|
Registry release metadata resources/acp-registry/registry.json |
Updates versions and distribution metadata for 20 registry entries. Binary-based entries receive updated release URLs and checksums; package-based entries receive updated versions. DimCode’s website URL also changes. |
Priority:
Estimated code review effort: 3 (Moderate) | ~25 minutes
Change: Feature
Possibly related PRs
- ThinkInAIXYZ/deepchat#2469: Both PRs modify
NewThreadPage.vueand its tests around selected-Agent draft defaults.
Suggested reviewers: zhangmo8, yyhhyyyyyy
Merge Risk: 
Minimal · up to 8072e
-
This change adds a per-Agent default for proactive collaboration in new chats, leaves existing sessions unchanged, and refreshes ACP registry metadata. No merge-blocking risk was found.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Title check
-
Explanation
The title "feat(agent): default proactive collaboration" matches the main change. The PR adds a per-Agent default for proactive collaboration that initializes new-session drafts. The title is short and specific, uses a conventional commit prefix, and names the primary behavior. It does not cover every detail, such as the Subagents-enabled gating or the draft override, which is acceptable.
Full details: Linked Issues check
-
Explanation
Issue
#2472requires a per-Agent default for new-chat proactive collaboration, availability only with Subagents enabled, draft initialization, per-chat override, and no effect on existing chats. The changes adddefaultOrchestrationPolicyto the Agent schema and type, persist it indeepChatAgentRepository, expose and disable the setting inDeepChatAgentsSettings.vuewithout clearing it, and initializeNewThreadPagedrafts toproactiveonly when the saved preference and Subagents are enabled. Unset or disabled configurations useexplicit. The draft revision handling preserves manual choices and prevents late responses from replacing another Agent or a disposed page. The added tests cover these requirements.
Full details: Docstring Coverage
-
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 7 files. (27 skipped: 27 unsupported.)
-
Full details: Out of Scope Changes check
-
Explanation
resources/acp-registry/registry.jsonupdates versions, URLs, checksums, and distribution metadata for 20 registry entries. These changes do not implement or test issue#2472. The PR description says the changes came from a normal build, but that does not connect the registry refresh to the linked issue.Resolution
Remove the unrelated
resources/acp-registry/registry.jsonrefresh from this pull request, or provide a repository requirement that makes this generated update necessary for the issue implementation.
-
Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
zerob13
left a comment
There was a problem hiding this comment.
Verdict: approve. No blocking code issue. One copy/scope mismatch is worth fixing or documenting; details below.
This PR is authored by the same account used for review, so GitHub does not allow a formal APPROVE or REQUEST_CHANGES here. This comment is the review record.
What this changes
Each DeepChat Agent gets a new defaultOrchestrationPolicy setting in its Subagents section. When it is on, a new chat starts with proactive collaboration instead of explicit confirmation, and the user can still change it per chat before sending. Agents without the setting, or with Subagents disabled, start in explicit.
Finding (P2, non-blocking): "new sessions" is broader than what the code actually does
The settings copy says "Enable proactive collaboration by default for new sessions" and the spec says the preference applies to "new Sessions". In practice only the desktop new-chat page reads it (src/renderer/src/pages/NewThreadPage.vue:1552). Sessions created by the scheduler (src/main/scheduler/runSessionStarter.ts:57), remote channels (src/main/remote/conversation/runner.ts:459), and the CLI (src/main/cli/runService.ts:257) call createDetachedSession without this field, so they still start at explicit (src/main/session/lifecycle.ts:433).
That behavior may be intentional, especially for unattended remote and cron runs. The problem is only that users are told it covers "new sessions" when it covers new chats in the desktop composer. Please pick one:
- narrow the setting description and the spec sentence to new chats created in the app, or
- apply the Agent default inside
createDetachedSessionfor the human-initiated paths.
Checked
- Over-design: no. The change adds one config field, one switch, and a small revision counter. The counter is needed because comparing the current value against
explicitcannot tell a manualexplicitchoice apart from the untouched default; the current approach is the smaller correct one. - Consistency: follows the existing draft-default pattern (
defaultModelPreset,permissionMode,defaultToolMode): stored on the Agent config, resolved through the same merge path, applied only when the new-chat draft loads. The schema, the main-process type, and the repository merge are all updated together. - Breaking changes: none. The field is optional, old configs resolve to
explicit, and no stored session is rewritten. - Late responses: the
workspaceDisposedguard plus the per-page request sequence correctly stop a stale config response from touching the draft after navigation or an Agent switch. - Tests: proportionate. Four files, one test per behavior (persist, save, disabled state, two-Agent switching, manual override, ACP switch, unmount). No test duplicates the same assertion path.
- Catalogs: the second commit is the usual generated provider/ACP refresh. Recent
devcommits show the same 137k-146k line churn, so this is routine, not a hidden behavior change.
Verification
- CI on head
8072e561: PR Check and Package Check both pass. - Locally on the PR head:
test/main/shared/orchestrationPolicy.test.ts,test/main/agent/deepchat/deepChatAgentRepository.test.ts(19 passed),test/renderer/components/DeepChatAgentsSettings.test.ts, andtest/renderer/components/NewThreadPage.test.ts(89 passed).
Agents that regularly delegate currently require enabling proactive collaboration in every new chat. Add an opt-in default in each DeepChat Agent's Subagents section and initialize new-chat drafts from that preference.
The default remains explicit when unset or when Subagents are disabled. Disabling Subagents retains the saved preference. Each chat can override its initial policy, and changing the Agent default never rewrites existing sessions. Pending config responses cannot overwrite a manual draft choice, another Agent's draft, or a draft after navigation. ACP and child-session authorization remain unchanged.
Closes #2472.
UI
The new switch is disabled when Subagents are off and retains its checked preference. Its label and description are accessible to keyboard and screen-reader users.
Validation
pnpm format:check,pnpm i18n,pnpm lint,pnpm typecheck, andpnpm buildpassed.The normal build refreshed provider and ACP registry snapshots; those outputs are retained in a separate commit as required by repository guidelines. The new copy uses English for bo-CN, mn-Mong-CN, and ug-CN.
Summary by CodeRabbit