Skip to content

feat: add dimcode acp agent#1336

Merged
zerob13 merged 4 commits intodevfrom
codex/add-dimcode-acp-agent
Mar 8, 2026
Merged

feat: add dimcode acp agent#1336
zerob13 merged 4 commits intodevfrom
codex/add-dimcode-acp-agent

Conversation

@zerob13
Copy link
Collaborator

@zerob13 zerob13 commented Mar 8, 2026

Summary by CodeRabbit

  • New Features

    • Added DimCode ACP as a new built-in agent and icon support
    • Preserve system prompt when switching model/provider mid-session
  • Behavior

    • Track reasoning block start/end timestamps in message metadata and usage
  • Internationalization

    • Updated Chinese (zh-CN, zh-HK, zh-TW) translations for Skills labels
  • Tests

    • Added tests covering DimCode integration, model switching, and reasoning timing

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 8, 2026

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 92f7cbd2-5056-4a47-8cfb-987e93b2da65

📥 Commits

Reviewing files that changed from the base of the PR and between a203f14 and 152f3a1.

📒 Files selected for processing (1)
  • test/main/presenter/deepchatAgentPresenter/deepchatAgentPresenter.test.ts

📝 Walkthrough

Walkthrough

Adds a new built-in DimCode ACP agent (dimcode-acp), tracks reasoning timing metadata during streaming, updates icon resolution and UI to support the new agent, adjusts generation-setting sanitization on model switches, updates Chinese translations, and expands test coverage for these behaviors.

Changes

Cohort / File(s) Summary
DimCode ACP Agent Configuration
src/main/presenter/configPresenter/acpConfHelper.ts, src/main/presenter/configPresenter/acpInitHelper.ts
Appends dimcode-acp to builtin order and templates, defines default profile/command/args, and adds init commands and description for the new built-in agent.
Reasoning Timing and Metadata
src/main/presenter/deepchatAgentPresenter/accumulator.ts, src/renderer/src/pages/ChatPage.vue, src/shared/types/agent-interface.d.ts
Tracks block.reasoning_time during streaming, updates message metadata with reasoningStartTime/reasoningEndTime, and surfaces those values into message usage fields.
Model Icon & Status Bar UI
src/renderer/src/components/icons/ModelIcon.vue, src/renderer/src/components/chat/ChatStatusBar.vue
Adds dimcode-acp icon import and mapping, includes it in monochrome inversion list, and centralizes icon-id resolution via resolveModelIconId used across status bar and model icon rendering.
Type and Presenter Adjustments
src/shared/types/presenters/legacy.presenters.d.ts, src/main/presenter/deepchatAgentPresenter/index.ts
Updates AcpBuiltinAgentId union to include 'dimcode-acp'; preserves systemPrompt when sanitizing generation settings during provider/model changes.
i18n Chinese Translations
src/renderer/src/i18n/zh-CN/routes.json, src/renderer/src/i18n/zh-CN/settings.json, src/renderer/src/i18n/zh-HK/routes.json, src/renderer/src/i18n/zh-HK/settings.json, src/renderer/src/i18n/zh-TW/routes.json, src/renderer/src/i18n/zh-TW/settings.json
Normalizes Skills/settings labels across Simplified, Traditional, and Hong Kong Chinese locales (e.g., to "Skills设置"/"Skills設置"/"Skills設定").
Tests
test/main/presenter/configPresenter/acpConfHelper.test.ts, test/main/presenter/deepchatAgentPresenter/accumulator.test.ts, test/main/presenter/deepchatAgentPresenter/deepchatAgentPresenter.test.ts, test/renderer/components/ChatPage.test.ts, test/renderer/components/ChatStatusBar.test.ts, test/renderer/components/ModelIcon.test.ts, test/renderer/components/message/MessageBlockThink.test.ts
Adds/extends unit tests for dimcode-acp defaults and enabled agents, reasoning timing behavior and metadata, model-switching and generation defaults, ChatPage usage propagation, ModelIcon rendering for dimcode-acp, and MessageBlockThink timing fallback behavior.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • deepinfect

Poem

🐰 I hopped in swift, a dimcode friend,
I track each thought from start to end,
Icons gleam in dark and day,
Translations tuned and tests at play,
A rabbit cheers — new agents blend!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding a new dimcode ACP agent to the system. It is specific, related to the primary modification, and follows commit message conventions.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch codex/add-dimcode-acp-agent

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 and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/main/presenter/deepchatAgentPresenter/index.ts`:
- Around line 620-623: When switching models the call to
sanitizeGenerationSettings is dropping session-specific overrides because it
only passes systemPrompt; change the call to pass currentGeneration (from
getEffectiveSessionGenerationSettings) as the baseSettings argument so
sanitizeGenerationSettings(nextProviderId, nextModelId, currentGeneration)
preserves temperature, context length, max tokens, and reasoning overrides while
still allowing the function to validate/merge in the new model defaults; locate
the usage at the top-level in deepchatAgentPresenter where currentGeneration and
sanitizeGenerationSettings are referenced and ensure only fields that must be
replaced are updated after sanitization.

In `@src/renderer/src/components/chat/ChatStatusBar.vue`:
- Around line 638-643: The current resolveModelIconId function returns 'acp'
when providerId === 'acp' but modelId is missing, which ModelIcon.vue doesn't
recognize; update resolveModelIconId so it only returns modelId for ACP when
modelId is present and otherwise falls back to the Anthropic icon (or the same
fallback used for other unknown providers). Specifically, change the logic in
resolveModelIconId to: if providerId === 'acp' return modelId when modelId is
truthy, otherwise return the default/fallback icon (e.g., 'anthropic');
reference resolveModelIconId, providerId, modelId and ModelIcon.vue when making
the change.

In `@test/main/presenter/deepchatAgentPresenter/deepchatAgentPresenter.test.ts`:
- Around line 1237-1242: The current cast of (agent as any).runtimeState to
Map<string, { status: string }> is too narrow for the object being set; update
the cast to use the full DeepChatSessionState shape (e.g., Map<string, { status:
string; providerId: string; modelId: string; permissionMode: string }>) so the
call to .set('s1', { status: 'generating', providerId: 'openai', modelId:
'gpt-4', permissionMode: 'full_access' }) matches the declared type and avoids
excess property/type errors when setting runtimeState on agent.
- Around line 1109-1128: The runtimeState Map is being cast too narrowly to
Map<string, { status: string }>, which omits required properties of
DeepChatSessionState; update the cast/remove the any and instead use the full
Map<string, DeepChatSessionState> type (or let TypeScript infer it) when
accessing or setting entries on (agent as any).runtimeState so the objects you
set include status, providerId, modelId, and permissionMode; adjust the two
sites that set 's1' (the current narrow-cast locations around the runtimeState
usage) to use Map<string, DeepChatSessionState> so the shape matches the
DeepChatSessionState interface.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 531cf068-bcee-4235-a998-89b339578e9b

📥 Commits

Reviewing files that changed from the base of the PR and between 14b3b66 and a203f14.

⛔ Files ignored due to path filters (1)
  • src/renderer/src/assets/llm-icons/dimcode.svg is excluded by !**/*.svg
📒 Files selected for processing (22)
  • src/main/presenter/configPresenter/acpConfHelper.ts
  • src/main/presenter/configPresenter/acpInitHelper.ts
  • src/main/presenter/deepchatAgentPresenter/accumulator.ts
  • src/main/presenter/deepchatAgentPresenter/index.ts
  • src/renderer/src/components/chat/ChatStatusBar.vue
  • src/renderer/src/components/icons/ModelIcon.vue
  • src/renderer/src/i18n/zh-CN/routes.json
  • src/renderer/src/i18n/zh-CN/settings.json
  • src/renderer/src/i18n/zh-HK/routes.json
  • src/renderer/src/i18n/zh-HK/settings.json
  • src/renderer/src/i18n/zh-TW/routes.json
  • src/renderer/src/i18n/zh-TW/settings.json
  • src/renderer/src/pages/ChatPage.vue
  • src/shared/types/agent-interface.d.ts
  • src/shared/types/presenters/legacy.presenters.d.ts
  • test/main/presenter/configPresenter/acpConfHelper.test.ts
  • test/main/presenter/deepchatAgentPresenter/accumulator.test.ts
  • test/main/presenter/deepchatAgentPresenter/deepchatAgentPresenter.test.ts
  • test/renderer/components/ChatPage.test.ts
  • test/renderer/components/ChatStatusBar.test.ts
  • test/renderer/components/ModelIcon.test.ts
  • test/renderer/components/message/MessageBlockThink.test.ts

@zerob13 zerob13 merged commit d732e24 into dev Mar 8, 2026
1 of 2 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.

1 participant