Skip to content

fix(wework): order tool blocks by creation time - #2218

Merged
qdaxb merged 1 commit into
mainfrom
fix/wework-tool-block-order
Jul 25, 2026
Merged

qdaxb merged 1 commit into
mainfrom
fix/wework-tool-block-order

Conversation

@qdaxb

@qdaxb qdaxb commented Jul 25, 2026 •

Copy link
Copy Markdown
Contributor

What changed

  • Order workbench processing blocks by their creation timestamp before rendering.
  • Preserve the original arrival order when timestamps are equal.
  • Keep streamed narrative blocks before the tool event that finalizes them.
  • Cover out-of-order live events and restored transcripts with unit tests.
  • Add a real Wework desktop E2E scenario that opens a seeded task, expands the processing timeline, and verifies the earlier-created tool card is visually above the later-created card.
  • Document the processing timeline behavior in Chinese and English.

Why

Executor events can arrive in a different order from the order in which tool calls were created. The workbench previously retained event arrival order, so a later-created tool could appear above an earlier-created tool in the processing timeline.

User impact

Tool calls, commands, and file operations in the Wework processing area now appear from top to bottom in their actual chronological order, including after reopening a historical task.

Validation

  • pnpm --filter @wegent/chat-core test — 123 tests passed
  • pnpm --filter @wegent/chat-core build
  • Wework unit suite — 217 files and 2165 tests passed
  • pnpm --filter wework exec node e2e/desktop/task-flow.e2e.mjs --tool-block-order-only
  • Pre-push ESLint, TypeScript, and unit-test checks passed

Summary by CodeRabbit

  • Documentation

    • Added guidance explaining that processed tool calls are displayed in actual creation order, even when events arrive out of sequence.
  • Bug Fixes

    • Corrected processing timelines so earlier-created commands, file operations, and tools consistently appear before later activity.
    • Preserved stable ordering when activities share the same creation time.

@coderabbitai

coderabbitai Bot commented Jul 25, 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 Plus

Run ID: 0e77d57a-2ee6-42fc-ad55-108f90877704

📥 Commits

Reviewing files that changed from the base of the PR and between bd0686d and c730f9b.

📒 Files selected for processing (6)
  • docs/en/wework/tasks.md
  • docs/zh/wework/tasks.md
  • packages/chat-core/src/workbench-message-reducer.test.ts
  • packages/chat-core/src/workbench-message-reducer.ts
  • wework/e2e/desktop/task-flow.e2e.mjs
  • wework/src/features/workbench/WorkbenchProvider.test.tsx

📝 Walkthrough

Walkthrough

Workbench processing blocks are now ordered by creation time, with stable ties and adjusted narrative timestamps. Unit, provider, and desktop end-to-end tests validate the ordering, and English and Chinese documentation describe the processing timeline behavior.

Changes

Chronological workbench ordering

Layer / File(s) Summary
Reducer timestamp ordering and validation
packages/chat-core/src/workbench-message-reducer.ts, packages/chat-core/src/workbench-message-reducer.test.ts, wework/src/features/workbench/WorkbenchProvider.test.tsx, docs/*/wework/tasks.md
Processing blocks are stably sorted by createdAt; finalized narrative blocks and moved text blocks receive timestamps aligned with incoming activity. Tests and documentation cover the resulting order.
End-to-end ordering verification
wework/e2e/desktop/task-flow.e2e.mjs
The desktop flow seeds earlier and later tool blocks, verifies their rendered positions, supports an isolated CLI mode, and includes the check in the full execution sequence.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

  • wecode-ai/Wegent#2032: Both changes adjust workbench reducer timestamp handling and narrative block finalization.

Suggested reviewers: icycrystal4

✨ 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 fix/wework-tool-block-order

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 July 25, 2026 15:44
@qdaxb
qdaxb merged commit 79ceafc into main Jul 25, 2026
28 of 29 checks passed
@qdaxb
qdaxb deleted the fix/wework-tool-block-order branch July 25, 2026 15:44
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