feat(vscode): add message edit/rewind and message metadata UI#3762
Conversation
0c28d35 to
0d1b92e
Compare
- Add rewindSession extension method to ACP agent for session rewind - Add rewindToTurn method in Session to truncate conversation history - Handle conversationRewound event in webview to reset messages, tool calls, plans, and UI state - Add editMessage flow in VSCode companion: user edit → rewind request → truncated state - New MessageMeta component with timestamp, copy, and edit actions (hover-reveal) - Integrate MessageMeta into AssistantMessage and UserMessage components - Reset task timer on editMessage in WebViewProvider This enables users to edit a previous user message, which rewinds the conversation to that turn and re-submits the edited content. Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
0d1b92e to
b2fb6fc
Compare
# Conflicts: # packages/vscode-ide-companion/src/webview/App.test.tsx
Code Coverage Summary
CLI Package - Full Text ReportCore Package - Full Text ReportFor detailed HTML reports, please see the 'coverage-reports-22.x-ubuntu-latest' artifact from the main CI run. |
wenshao
left a comment
There was a problem hiding this comment.
[Critical] TypeScript still reports many build-blocking diagnostics that are not all suitable for a single inline anchor: widespread TS4111 index-signature dot access across the VS Code companion, plus unused declarations in WebViewProvider.ts. Please fix the deterministic typecheck failures before merging.
— gpt-5.5 via Qwen Code /review
|
Addressed the review feedback in |
wenshao
left a comment
There was a problem hiding this comment.
[Critical] The full workspace test run fails in packages/core: src/skills/skill-manager.test.ts no longer finds the bundled review skill. The assertions at lines 742 and 787 fail because listSkills() does not include review and loadSkill('review') returns null. This blocks CI until the bundled review skill packaging/metadata is restored, or the test and discovery path are updated consistently if the skill was intentionally removed or renamed.
— gpt-5.5 via Qwen Code /review
|
@wenshao I checked the latest bundled The current PR diff does not touch
It passes locally with all 50 tests green. The GitHub CI test matrix is also green on macOS/Ubuntu/Windows across Node 20/22/24. Could you please re-check or dismiss this changes-requested item? It looks like a stale or isolated review-environment result rather than an issue introduced by this PR. |
wenshao
left a comment
There was a problem hiding this comment.
[Critical] TypeScript build is blocked by deterministic diagnostics
TypeScript still reports 119 build-blocking diagnostics in changed VS Code companion files, mostly TS4111 index-signature dot access, plus unused declarations in WebViewProvider.ts. Please fix the deterministic typecheck failures before merging.
[Critical] Session switching loses user turn indexes used for edit rewind
In packages/vscode-ide-companion/src/webview/hooks/useWebViewMessages.ts, the qwenSessionSwitched path loads persisted message.data.messages through materializeMessages(...) without assigning turnIndex values to user messages or resetting userTurnCounterRef, unlike conversationLoaded. After switching or resuming a session, editing the last visible user message can therefore send a stale or fallback targetTurnIndex from the previous session to rewindSession, rewinding the wrong backend turn or rejecting the edit. Please apply the same user-message indexing logic here before calling materializeMessages, and update userTurnCounterRef.current to the next turn index.
— gpt-5.5 via Qwen Code /review
wenshao
left a comment
There was a problem hiding this comment.
[Suggestion] Test coverage gaps: qwenSessionSwitched 的 else 分支(无消息时 reset + clearMessages)和 conversationLoaded 的 turn-indexing 路径缺少测试用例。建议添加:一个传入不含 messages 属性的 qwenSessionSwitched 事件并验证计数器重置为 0;一个传入 conversationLoaded 事件并验证用户消息被正确索引。
— deepseek-v4-pro via Qwen Code /review
# Conflicts: # packages/cli/src/acp-integration/session/Session.test.ts # packages/cli/src/acp-integration/session/Session.ts # packages/cli/src/ui/utils/historyMapping.ts # packages/vscode-ide-companion/src/webview/App.tsx
Summary
What changed: Added full message editing (rewind) flow and a unified
MessageMetacomponent for hover-reveal timestamp, copy, and edit actions on both user and assistant messages in the desktop companion webview.rewindSessionextension method that validatessessionIdandtargetTurnIndex, delegates to the active Session'srewindToTurn.rewindToTurntruncates conversation history (messages + API) to a given turn index and returns the new truncation point.editMessageflow — user clicks edit → companion sends rewind request to the agent → agent rewinds session → companion receivesconversationRewoundevent → webview drops transcript state from the edited turn onward (messages, tool calls, plans, usage stats, permission prompts, waiting/thinking states).MessageMetacomponent renders timestamp + copy button + optional edit button, revealed on hover viagroupCSS. Integrated into bothAssistantMessageandUserMessage.WebViewProviderresets task timer and notification guard oneditMessage(same assendMessage).Why it changed: Desktop users need the ability to edit a previously sent message, rewinding the conversation to that point and resubmitting. This matches the rewind/edit pattern used by Claude Code desktop and is a core interaction for conversational AI IDE companions.
Reviewer focus: The
conversationRewoundhandler inuseWebViewMessages.ts— it must correctly truncate messages, rewind tool calls, clear plan entries, and reset all transient UI state. Also therewindToTurnlogic inSession.tsfor correct history truncation.Validation
conversationRewoundcase inuseWebViewMessages.tsand therewindToTurnmethod inSession.ts, then check the corresponding test files.Scope / Risk
rewindSessionis a new extension method andconversationRewoundis a new event type. Existing flows are unchanged.Testing Matrix
Testing matrix notes:
Screenshots / Video Demo
Linked Issues / Bugs
No linked issues.
🤖 Generated with Qwen Code