Skip to content

feat(agent): default proactive collaboration - #2480

Merged
zerob13 merged 2 commits into
devfrom
dimagent/agent-collaboration-default
Oct 29, 2026
Merged

zerob13 merged 2 commits into
devfrom
dimagent/agent-collaboration-default

Conversation

@zerob13

@zerob13 zerob13 commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

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

BEFORE
Subagents                                      [on]
  Configured child Agents...

AFTER
Subagents                                      [on]
Proactive collaboration by default in new chats [off]
  Allow starting and continuing subtasks without per-action confirmation.
  Applies to new chats; each chat can override it.
  Configured child Agents...

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

  • 183 relevant Vitest tests passed across repository/config contracts, session lifecycle/assignment, Agent settings, draft state, and new-chat flows.
  • Built Electron UI check passed with isolated user data: keyboard toggle, save/reload, disabling and re-enabling Subagents, and 760px dark appearance.
  • pnpm format:check, pnpm i18n, pnpm lint, pnpm typecheck, and pnpm build passed.

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

  • New Features
    • DeepChat Agents can now set a default collaboration policy for new sessions. When enabled, the main Agent can start and continue subtasks without confirming each action; the setting applies only to new sessions and can be changed per session.
    • Updated versions and downloads for several available agents, including OpenCode and OpenCode V2.
  • Improvements
    • New-session defaults respect Subagents availability and preserve your manual policy choice while settings load. Existing sessions are unaffected by later changes to an Agent’s default.

@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c3aa8c09-e0c4-4157-974d-f05624d56661
Commits

Reviewing files that changed from the base of the PR and between 48c5460 and 8072e56.

Files selected for processing: 35
  • docs/architecture/proactive-multi-agent-orchestration/spec.md
  • resources/acp-registry/registry.json
  • resources/model-db/providers.json
  • src/main/agent/deepchat/deepChatAgentRepository.ts
  • src/renderer/settings/components/DeepChatAgentsSettings.vue
  • src/renderer/src/i18n/bo-CN/settings.json
  • src/renderer/src/i18n/da-DK/settings.json
  • src/renderer/src/i18n/de-DE/settings.json
  • src/renderer/src/i18n/en-US/settings.json
  • src/renderer/src/i18n/es-ES/settings.json
  • src/renderer/src/i18n/fa-IR/settings.json
  • src/renderer/src/i18n/fr-FR/settings.json
  • src/renderer/src/i18n/he-IL/settings.json
  • src/renderer/src/i18n/id-ID/settings.json
  • src/renderer/src/i18n/it-IT/settings.json
  • src/renderer/src/i18n/ja-JP/settings.json
  • src/renderer/src/i18n/ko-KR/settings.json
  • src/renderer/src/i18n/mn-Mong-CN/settings.json
  • src/renderer/src/i18n/ms-MY/settings.json
  • src/renderer/src/i18n/pl-PL/settings.json
  • src/renderer/src/i18n/pt-BR/settings.json
  • src/renderer/src/i18n/ru-RU/settings.json
  • src/renderer/src/i18n/tr-TR/settings.json
  • src/renderer/src/i18n/ug-CN/settings.json
  • src/renderer/src/i18n/vi-VN/settings.json
  • src/renderer/src/i18n/zh-CN/settings.json
  • src/renderer/src/i18n/zh-HK/settings.json
  • src/renderer/src/i18n/zh-TW/settings.json
  • src/renderer/src/pages/NewThreadPage.vue
  • src/shared/contracts/domainSchemas.ts
  • src/shared/types/agent-interface.d.ts
  • test/main/agent/deepchat/deepChatAgentRepository.test.ts
  • test/main/shared/orchestrationPolicy.test.ts
  • test/renderer/components/DeepChatAgentsSettings.test.ts
  • test/renderer/components/NewThreadPage.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

Walkthrough

Adds a per-Agent default orchestration policy for new sessions, applies it to eligible drafts, and updates version and distribution metadata for ACP registry entries.

Changes: Per-Agent orchestration defaults

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: Normal

Estimated code review effort: 3 (Moderate) | ~25 minutes

Change: Feature

Possibly related PRs

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: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Out of Scope Changes check Warning resources/acp-registry/registry.json updates versions, URLs, checksums, and distribution metadata for 20 registry entries. These changes do not implement or test issue #2472. The PR description says… Remove the unrelated resources/acp-registry/registry.json refresh from this pull request, or provide a repository requirement that makes this generated update necessary for the issue implementation.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed 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 an…
Linked Issues check Passed Issue #2472 requires 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 c…
Docstring Coverage Passed 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. Documentat…
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 #2472 requires 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 add defaultOrchestrationPolicy to the Agent schema and type, persist it in deepChatAgentRepository, expose and disable the setting in DeepChatAgentsSettings.vue without clearing it, and initialize NewThreadPage drafts to proactive only when the saved preference and Subagents are enabled. Unset or disabled configurations use explicit. 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.json updates 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.json refresh 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@zerob13 zerob13 left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 createDetachedSession for 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 explicit cannot tell a manual explicit choice 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 workspaceDisposed guard 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 dev commits 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, and test/renderer/components/NewThreadPage.test.ts (89 passed).

@zerob13
zerob13 merged commit a19ad1c into dev Oct 29, 2026
12 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.

[Feature] Agent 设置支持「主动协作」默认开启

1 participant