Repository navigation
fix(wework): preserve active turn running state - #2398
Conversation
📝 WalkthroughWalkthroughRuntime task lifecycle state now tracks turn identity. Stream handlers and providers forward identifiers to lifecycle actions. Reducer logic rejects stale settlements. Desktop E2E tests reproduce the stale-event scenario, and CI classification adds supervisor-lifecycle coverage. ChangesRuntime lifecycle reconciliation
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
Suggested labels: Sequence Diagram(s)sequenceDiagram
participant DesktopE2E
participant RuntimeTaskLifecycleProvider
participant RuntimeTaskLifecycleStore
participant RuntimeTaskLifecycleReducer
DesktopE2E->>RuntimeTaskLifecycleProvider: dispatch stale turn_settled event
RuntimeTaskLifecycleProvider->>RuntimeTaskLifecycleStore: call turnSettled with turnId
RuntimeTaskLifecycleStore->>RuntimeTaskLifecycleReducer: dispatch lifecycle event
RuntimeTaskLifecycleReducer-->>RuntimeTaskLifecycleStore: retain newer active turn
RuntimeTaskLifecycleStore-->>DesktopE2E: task remains running
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 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/e2e/automation.ts`:
- Around line 762-768: Split the cohesive control-command handling from
executeDesktopControlCommand into a separate module because the automation file
exceeds the 1,000-line guideline. Keep executeDesktopControlCommand as the
dispatcher, move the relevant command cases and their supporting logic together,
and delegate to the extracted module without changing command behavior.
🪄 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 Plus
Run ID: 91f6e554-e575-499f-abef-68ab744bbf05
📒 Files selected for processing (13)
.github/scripts/classify-wework-desktop-e2e.sh.github/scripts/test-classify-ci-changes.shwework/DESIGN.mdwework/e2e/desktop/task-flow.e2e.mjswework/src/e2e/automation.tswework/src/features/workbench/WorkbenchProvider.tsxwework/src/features/workbench/runtimePaneMessages.tswework/src/features/workbench/runtimeTaskLifecycle/RuntimeTaskLifecycleProvider.tsxwework/src/features/workbench/runtimeTaskLifecycle/RuntimeTaskLifecycleStore.test.tswework/src/features/workbench/runtimeTaskLifecycle/RuntimeTaskLifecycleStore.tswework/src/features/workbench/runtimeTaskLifecycle/RuntimeTaskMachine.tswework/src/features/workbench/runtimeTaskLifecycle/reducer.tswework/src/features/workbench/runtimeTaskLifecycle/types.ts
| case 'dispatchRuntimeLifecycleEvent': | ||
| window.dispatchEvent( | ||
| new CustomEvent('wework:e2e:runtime-task-lifecycle', { | ||
| detail: JSON.parse(command.value ?? '{}'), | ||
| }) | ||
| ) | ||
| return '' |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟠 Major | 🏗️ Heavy lift
Split wework/src/e2e/automation.ts before adding more command cases.
The file has at least 1,116 lines after this change. Extract a cohesive control-command group into a separate module. Keep executeDesktopControlCommand as the dispatcher.
As per coding guidelines, "split files over 1000 lines."
🤖 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 `@wework/src/e2e/automation.ts` around lines 762 - 768, Split the cohesive
control-command handling from executeDesktopControlCommand into a separate
module because the automation file exceeds the 1,000-line guideline. Keep
executeDesktopControlCommand as the dispatcher, move the relevant command cases
and their supporting logic together, and delegate to the extracted module
without changing command behavior.
Source: Coding guidelines
Summary
supervisor-lifecyclein the CI desktop checkpoint matrix and path classifierReproduction
The new desktop E2E fails on the test-only baseline commit
b5dee1103: while the supervisor correction assistant message is still streaming, replaying an older turn settlement clears the lifecycle and sidebar running indicator.Verification
pnpm --filter wework testpnpm --filter wework exec eslint ...changed files...pnpm --filter wework exec prettier --check ...changed files...pnpm --filter wework e2e:desktop -- --segment supervisor-lifecycle.github/scripts/test-classify-ci-changes.shSummary by CodeRabbit
Bug Fixes
Tests