Skip to content

[codex] Show Wework edit tool messages - #1640

Merged
qdaxb merged 1 commit into
mainfrom
codex/wework-edit-tool-messages
Jun 30, 2026
Merged

qdaxb merged 1 commit into
mainfrom
codex/wework-edit-tool-messages

Conversation

@qdaxb

@qdaxb qdaxb commented Jun 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add shared Wework chat tool-name classification for file read/create/edit, command, and guidance tools.
  • Render Claude MultiEdit/NotebookEdit-style edit tool blocks as file edit activity instead of generic executed tools.
  • Add regression coverage for edit tool activity summaries and expanded MultiEdit details.

Root Cause

Wework only recognized a narrow set of edit tool names (edit, edit_file, str_replace_editor). Claude edit tools such as MultiEdit fell through to the generic tool path, so edit activity appeared as a generic executed tool rather than an edit message.

Validation

  • pnpm --dir wework test src/components/chat/blocks/toolBlockActivity.test.ts src/components/chat/blocks/ToolBlockItem.test.tsx src/components/chat/blocks/ToolBlocksDisplay.test.tsx src/components/chat/MessageList.test.tsx
  • pnpm --dir wework exec tsc -p tsconfig.app.json --noEmit
  • pnpm --dir wework exec eslint src/components/chat/blocks/toolBlockActivity.ts src/components/chat/blocks/toolBlockActivity.test.ts src/components/chat/blocks/ToolBlockItem.tsx src/components/chat/blocks/ToolBlockItem.test.tsx src/components/chat/blocks/toolBlockKinds.ts
  • Pre-push hook: 103 wework test files passed, 966 tests passed, quality checks passed

Summary by CodeRabbit

  • New Features

    • File-edit tool messages now show clearer activity labels and expanded edit details, including multiple edit previews for a single file.
    • Multi-edit tool blocks are recognized as editable file activity and summarized accordingly.
  • Bug Fixes

    • Improved detection of file-related tool names, so tool activity and details display more consistently across naming variations.
    • Expanded file-path handling to surface the correct file location in tool details.

@coderabbitai

coderabbitai Bot commented Jun 30, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 843c51eb-8639-4e55-88c0-a2e79603ab28

📥 Commits

Reviewing files that changed from the base of the PR and between bd21451 and d2a78fe.

📒 Files selected for processing (5)
  • wework/src/components/chat/blocks/ToolBlockItem.test.tsx
  • wework/src/components/chat/blocks/ToolBlockItem.tsx
  • wework/src/components/chat/blocks/toolBlockActivity.test.ts
  • wework/src/components/chat/blocks/toolBlockActivity.ts
  • wework/src/components/chat/blocks/toolBlockKinds.ts

📝 Walkthrough

Walkthrough

A new toolBlockKinds.ts module is introduced with exported tool-name predicates and toolInput field extractors. toolBlockActivity.ts and ToolBlockItem.tsx are refactored to use these shared helpers instead of hardcoded string comparisons. FileEditDetail in ToolBlockItem.tsx gains multi-preview rendering supporting Claude MultiEdit blocks with an edits array.

Changes

MultiEdit support via toolBlockKinds

Layer / File(s) Summary
toolBlockKinds: predicates and input extractors
wework/src/components/chat/blocks/toolBlockKinds.ts
New module with internal name-normalization helpers, five exported predicates (isCommandToolName, isFileReadToolName, isFileCreateToolName, isFileEditToolName, isGuidanceToolName), and getInputField/getFileInputPath extractors.
toolBlockActivity refactor
wework/src/components/chat/blocks/toolBlockActivity.ts, wework/src/components/chat/blocks/toolBlockActivity.test.ts
Removes local tool-name Sets and predicate implementations; imports and re-exports from toolBlockKinds; updates getToolActivityKind to use predicates. Adds MultiEdit test asserting 已编辑 1 个文件.
ToolBlockItem refactor and MultiEdit FileEditDetail
wework/src/components/chat/blocks/ToolBlockItem.tsx, wework/src/components/chat/blocks/ToolBlockItem.test.tsx
Replaces hardcoded tool-name checks in getBlockLabel, renderBlockDetail, hasBlockDetail, and getWorkspaceFilePath with imported predicates. Refactors FileEditDetail to multi-preview via getEditPreviews supporting both direct old_string/new_string and toolInput.edits arrays. Adds component test for MultiEdit rendering.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 A new kinds file leaps into the code,
Predicates hopping down the module road.
MultiEdit arrives with edits in a row,
Old strings and new strings put on a show.
No more hardcoded names in sight—
The rabbit refactored everything right! ✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/wework-edit-tool-messages

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.

@qdaxb
qdaxb marked this pull request as ready for review June 30, 2026 09:38
@qdaxb
qdaxb merged commit 480e54c into main Jun 30, 2026
19 of 20 checks passed
@qdaxb
qdaxb deleted the codex/wework-edit-tool-messages branch June 30, 2026 09:38
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