feat(agent): add progress todo tool#1635
Conversation
📝 Walkthrough<review_stack_artifact> 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add 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 |
There was a problem hiding this comment.
Actionable comments posted: 4
🧹 Nitpick comments (1)
src/main/presenter/agentRuntimePresenter/dispatch.ts (1)
362-363: ⚡ Quick winUse shared tool-name constant instead of string literal.
Line 362 hardcodes
'update_plan'; this can drift from the source constant and silently stop internal plan-block marking if renamed.♻️ Suggested patch
-import type { AgentPlanSnapshot } from '`@shared/types/agent-plan`' +import type { AgentPlanSnapshot } from '`@shared/types/agent-plan`' +import { UPDATE_PLAN_TOOL_NAME } from '../toolPresenter/agentTools' function markInternalPlanToolCallBlock(blocks: AssistantMessageBlock[], toolCallId: string): void { @@ - if (!block?.tool_call || block.tool_call.name !== 'update_plan') { + if (!block?.tool_call || block.tool_call.name !== UPDATE_PLAN_TOOL_NAME) { return }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/main/presenter/agentRuntimePresenter/dispatch.ts` around lines 362 - 363, The conditional currently compares block.tool_call.name to the hardcoded string 'update_plan'; change it to use the centralized tool-name constant exported by the tools module (e.g. UPDATE_PLAN_TOOL_NAME or the exported symbol that represents the update-plan tool) instead, updating the import at the top of dispatch.ts and replacing the literal in the if check that references block?.tool_call and block.tool_call.name so the code always uses the shared constant.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/features/agent-progress-todo/plan.md`:
- Line 175: The doc currently contradicts the architecture by calling the
renderer store / event `chat.plan.updated` canonical while line 175 instructs to
keep the message block as canonical; update the wording so the message block is
explicitly the single source-of-truth for DeepChat progress state and describe
`chat.plan.updated` and the renderer store as derived/secondary views used for
UI rendering and fallback only; change the sentence at line 175 to state the
floating panel should be collapsed by default and that the message block is
canonical, and scan other mentions of `chat.plan.updated` and "renderer store"
to rephrase them as derived or fallback mechanisms to avoid implementation
drift.
In `@docs/features/agent-progress-todo/spec.md`:
- Line 7: Replace the machine-specific absolute path
`/Users/zerob13/Downloads/agent-progress-todo-spec.md` in
docs/features/agent-progress-todo/spec.md with a portable reference: either a
repo-relative path (e.g.,
docs/features/agent-progress-todo/agent-progress-todo-spec.md) or a generic
external-note like "see agent-progress-todo-spec.md in project docs"; keep the
`update_plan` mention and any other identifiers unchanged so reviewers can still
find the referenced model behavior.
In `@src/renderer/src/components/chat/AgentProgressFloat.vue`:
- Line 43: Replace the hardcoded ARIA label construction in
AgentProgressFloat.vue that directly interpolates entry.status and entry.step
with the vue-i18n translation lookup; map the possible status tokens (e.g.,
in_progress, completed, failed) to i18n keys in src/renderer/src/i18n and build
the aria-label via $t(...) (or the composable useI18n) so aria-label uses
translated status text and the translated step label rather than raw tokens
(refer to entry.status, entry.step and the :aria-label binding when making the
change).
In `@src/renderer/src/components/message/MessageBlockPlan.vue`:
- Line 31: The aria-label currently hardcodes "[${entry.status}] ${entry.label}"
in MessageBlockPlan.vue; replace this with a vue-i18n lookup that composes a
localized message and localized status label (e.g. use a key like
message.planEntryAria with params { status: $t(`status.${entry.status}`), label:
entry.label }) and ensure corresponding i18n keys exist in src/renderer/src/i18n
(message.planEntryAria and status.<statusName> entries); implement the lookup
either inline in the template using $t or via a computed property (referencing
entry.status and entry.label) so assistive text is fully translatable.
---
Nitpick comments:
In `@src/main/presenter/agentRuntimePresenter/dispatch.ts`:
- Around line 362-363: The conditional currently compares block.tool_call.name
to the hardcoded string 'update_plan'; change it to use the centralized
tool-name constant exported by the tools module (e.g. UPDATE_PLAN_TOOL_NAME or
the exported symbol that represents the update-plan tool) instead, updating the
import at the top of dispatch.ts and replacing the literal in the if check that
references block?.tool_call and block.tool_call.name so the code always uses the
shared constant.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 98d1b010-58bd-466c-8884-b50bff61bebc
📒 Files selected for processing (38)
docs/features/agent-progress-todo/plan.mddocs/features/agent-progress-todo/spec.mddocs/features/agent-progress-todo/tasks.mddocs/issues/assistant-action-type-null-renderer-crash/plan.mddocs/issues/assistant-action-type-null-renderer-crash/spec.mddocs/issues/assistant-action-type-null-renderer-crash/tasks.mdsrc/main/presenter/agentRuntimePresenter/dispatch.tssrc/main/presenter/agentRuntimePresenter/messageStore.tssrc/main/presenter/toolPresenter/agentTools/agentPlanTool.tssrc/main/presenter/toolPresenter/agentTools/agentToolManager.tssrc/main/presenter/toolPresenter/agentTools/index.tssrc/main/presenter/toolPresenter/index.tssrc/renderer/api/ChatClient.tssrc/renderer/src/components/chat/AgentProgressFloat.vuesrc/renderer/src/components/chat/messageListItems.tssrc/renderer/src/components/message/MessageBlockPlan.vuesrc/renderer/src/components/message/MessageItemAssistant.vuesrc/renderer/src/pages/ChatPage.vuesrc/renderer/src/stores/ui/agentPlan.tssrc/shared/chat.d.tssrc/shared/contracts/common.tssrc/shared/contracts/events.tssrc/shared/contracts/events/chat.events.tssrc/shared/types/agent-interface.d.tssrc/shared/types/agent-plan.tssrc/shared/types/core/chat.tssrc/shared/types/presenters/tool.presenter.d.tstest/main/presenter/agentRuntimePresenter/dispatch.test.tstest/main/presenter/agentRuntimePresenter/messageStore.test.tstest/main/presenter/toolPresenter/agentTools/agentPlanTool.test.tstest/main/presenter/toolPresenter/toolPresenter.test.tstest/main/routes/contracts.test.tstest/renderer/api/clients.test.tstest/renderer/components/AgentProgressFloat.test.tstest/renderer/components/ChatPage.test.tstest/renderer/components/McpIndicator.test.tstest/renderer/components/message/MessageBlockBasics.test.tstest/renderer/stores/agentPlanStore.test.ts
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@docs/features/agent-progress-todo/spec.md`:
- Line 60: The line claiming the floating panel "retains persistent records in
messages" conflicts with the rule that update_plan must not write plan blocks
into assistant messages; reword it to state that the floating progress panel
provides a lightweight, collapsible UI that shows real-time progress while
persisting state outside of assistant messages (e.g., in the UI
state/storage/logging), and explicitly reference update_plan and "plan" blocks
to clarify they must not be injected into assistant messages.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 53fa7856-c354-42d1-8ea5-0671bdd62064
📒 Files selected for processing (19)
docs/features/agent-progress-todo/plan.mddocs/features/agent-progress-todo/spec.mdsrc/main/presenter/agentRuntimePresenter/dispatch.tssrc/renderer/src/components/chat/AgentProgressFloat.vuesrc/renderer/src/components/message/MessageBlockPlan.vuesrc/renderer/src/i18n/da-DK/chat.jsonsrc/renderer/src/i18n/en-US/chat.jsonsrc/renderer/src/i18n/fa-IR/chat.jsonsrc/renderer/src/i18n/fr-FR/chat.jsonsrc/renderer/src/i18n/he-IL/chat.jsonsrc/renderer/src/i18n/ja-JP/chat.jsonsrc/renderer/src/i18n/ko-KR/chat.jsonsrc/renderer/src/i18n/pt-BR/chat.jsonsrc/renderer/src/i18n/ru-RU/chat.jsonsrc/renderer/src/i18n/zh-CN/chat.jsonsrc/renderer/src/i18n/zh-HK/chat.jsonsrc/renderer/src/i18n/zh-TW/chat.jsontest/renderer/components/AgentProgressFloat.test.tstest/renderer/components/message/MessageBlockBasics.test.ts
✅ Files skipped from review due to trivial changes (8)
- src/renderer/src/i18n/he-IL/chat.json
- src/renderer/src/i18n/ja-JP/chat.json
- src/renderer/src/i18n/ko-KR/chat.json
- src/renderer/src/i18n/zh-HK/chat.json
- src/renderer/src/i18n/fa-IR/chat.json
- src/renderer/src/i18n/zh-CN/chat.json
- src/renderer/src/i18n/da-DK/chat.json
- src/renderer/src/i18n/fr-FR/chat.json
🚧 Files skipped from review as they are similar to previous changes (5)
- src/renderer/src/components/chat/AgentProgressFloat.vue
- test/renderer/components/AgentProgressFloat.test.ts
- test/renderer/components/message/MessageBlockBasics.test.ts
- src/renderer/src/components/message/MessageBlockPlan.vue
- src/main/presenter/agentRuntimePresenter/dispatch.ts
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/renderer/src/pages/ChatPage.vue`:
- Around line 283-294: syncPlanFloatReservedHeight currently uses only the
trigger's offsetHeight which causes the expanded plan body to overlap messages;
modify syncPlanFloatReservedHeight to reserve the full floating panel height by
using the layer's full offsetHeight (or, if there is an expanded-inner element,
query its offsetHeight) instead of just the trigger height, then add
PLAN_FLOAT_SAFE_GAP and set planFloatReservedHeight.value accordingly; reference
planFloatLayer, latestPlanSnapshot, syncPlanFloatReservedHeight,
PLAN_FLOAT_SAFE_GAP and planFloatReservedHeight when making the change.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: e801c8b2-513d-4b2b-b84b-02314f867667
📒 Files selected for processing (3)
src/renderer/src/components/chat/AgentProgressFloat.vuesrc/renderer/src/pages/ChatPage.vuetest/renderer/components/ChatPage.test.ts
🚧 Files skipped from review as they are similar to previous changes (1)
- test/renderer/components/ChatPage.test.ts
Summary
Tests
Note: local Node is v22.13.1, while package engines request >=24.14.1 <25; commands completed with engine warnings.
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Tests