Repository navigation
fix(wework): restore historical tool records - #2075
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughRuntime transcript restoration now accepts numeric assistant subtask identifiers, normalizes them to strings, and updates related typing, tests, and documentation. The desktop cloud project E2E flow now opens projects through the enabled new-conversation control. ChangesRuntime transcript compatibility
Desktop project flow
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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: 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 `@wework/src/features/workbench/runtimePaneMessages.ts`:
- Around line 587-588: Update the subtask ID resolution logic around the visible
subtaskId selection so each camelCase and snake_case alias is validated for a
non-empty, non-whitespace string before choosing it; fall back to
message.subtask_id when message.subtaskId is invalid, and add a regression test
covering both fields being present with an empty or whitespace camelCase value
and a valid snake_case value.
🪄 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: 28d93b46-5d3d-4e31-a503-0ee6baa3ba0f
📒 Files selected for processing (6)
docs/en/developer-guide/runtime-local-work.mddocs/zh/developer-guide/runtime-local-work.mdwework/src/features/workbench/WorkbenchProvider.test.tsxwework/src/features/workbench/runtimePaneMessages.test.tswework/src/features/workbench/runtimePaneMessages.tswework/src/types/api.ts
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 `@wework/src/features/workbench/runtimePaneMessages.test.ts`:
- Around line 544-550: Expand the historical block restoration test around
runtimeMessagesToWorkbenchMessages to cover messages using snake_case
subtask_id, plus a message with an invalid or blank subtaskId alongside a valid
subtask_id. Assert both cases restore their blocks, preserving the existing
numeric subtaskId regression coverage.
In `@wework/src/features/workbench/runtimePaneMessages.ts`:
- Around line 587-589: Preserve both subtask ID aliases in the restoration
contract: update the resolver in runtimePaneMessages.ts to validate subtaskId
first and fall back to a non-empty subtask_id value, retain subtask_id?: string
| number | null in the input type in api.ts, and add regression fixtures in
runtimePaneMessages.test.ts covering snake_case-only and mixed-alias 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: 6081deb8-19bd-4e5a-98ac-5af6ab1ae316
📒 Files selected for processing (6)
docs/en/developer-guide/runtime-local-work.mddocs/zh/developer-guide/runtime-local-work.mdwework/src/features/workbench/WorkbenchProvider.test.tsxwework/src/features/workbench/runtimePaneMessages.test.tswework/src/features/workbench/runtimePaneMessages.tswework/src/types/api.ts
What changed
subtaskIdandsubtask_idwhen restoring runtime transcript messagesRoot cause
Historical transcript payloads can use snake_case
subtask_id, while Wework only read camelCasesubtaskId. Without a recognized subtask identity, Wework intentionally dropped the assistant message's processing blocks, hiding both historical tool calls and file-edit records. Live events were unaffected because they use camelCase.Validation
pnpm --filter wework exec prettier --check ...pnpm --filter wework exec eslint ...pnpm --filter wework test— 183 files, 1847 tests passedSummary by CodeRabbit