Skip to content

fix(wework): stabilize runtime task visibility and ordering - #2017

Merged
qdaxb merged 1 commit into
mainfrom
fix/stable-runtime-task-list
Jul 17, 2026
Merged

qdaxb merged 1 commit into
mainfrom
fix/stable-runtime-task-list

Conversation

@qdaxb

@qdaxb qdaxb commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

What changed

  • resolve managed worktree tasks through the persisted source repository path before applying project visibility filtering
  • persist and expose a dedicated conversation completion timestamp
  • sort runtime tasks by completion time so streaming updatedAt changes do not move sidebar rows
  • only honor persisted thread order when the project explicitly uses manual sorting

Root cause

The runtime task filter recomputed a worktree's project root from live .git metadata on every refresh. When that metadata was temporarily unavailable, the worktree path could not be mapped back to its project and the task was omitted from the response. Separately, the sidebar used provider updatedAt and non-manual thread order, both of which can change while chunks stream.

Impact

Tasks remain visible across transient worktree metadata failures. In automatic sort mode, a running conversation keeps its previous position while chunks stream and moves only after the turn completes. Explicit manual ordering remains unchanged.

Validation

  • pnpm --filter wework test — 177 files, 1747 tests passed
  • cd executor && cargo test --quiet — full suite passed
  • pnpm --filter wework typecheck
  • focused Prettier and ESLint checks for changed Wework files
  • pre-push ESLint, TypeScript, Wework unit tests, cargo fmt, cargo test, and cargo clippy
  • isolated real Tauri verification with two completed conversations, a follow-up streaming response, repeated task-list refreshes, and captured screenshots

Summary by CodeRabbit

  • Improvements

    • Runtime tasks now retain and display completion times when available.
    • Task lists use completion time for ordering, keeping finished tasks in a stable position while active tasks stream updates.
    • Workspace grouping more accurately reflects each task’s originating workspace.
    • Manual sidebar ordering is now applied consistently to project and projectless conversations.
  • Bug Fixes

    • Cancelled and finished tasks now receive completion timestamps for more reliable status and sorting behavior.

@coderabbitai

coderabbitai Bot commented Jul 17, 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: 8e71ea93-d145-4901-a23e-3937b32cdea9

📥 Commits

Reviewing files that changed from the base of the PR and between a90dd5c and 6fdd927.

📒 Files selected for processing (8)
  • executor/src/runtime_work/codex_global_state.rs
  • executor/src/runtime_work/handler.rs
  • executor/src/runtime_work/response.rs
  • executor/src/runtime_work/worktrees.rs
  • executor/tests/app_runtime_work_workspace_contract.rs
  • wework/src/components/layout/runtimeTaskSidebarHelpers.test.ts
  • wework/src/components/layout/runtimeTaskSidebarHelpers.ts
  • wework/src/types/api.ts

📝 Walkthrough

Walkthrough

Runtime tasks now carry completion timestamps through executor state, API responses, and sidebar sorting. Codex indexing filters for manual thread ordering, and project grouping can use persisted worktree source paths.

Changes

Runtime task ordering and metadata

Layer / File(s) Summary
Manual project-order filtering
executor/src/runtime_work/codex_global_state.rs, executor/tests/app_runtime_work_workspace_contract.rs
Codex global-state indexing retains sidebar thread orders with sortKey: "manual", and related fixtures now provide that value.
Completion state and executor ordering
executor/src/runtime_work/response.rs, executor/src/runtime_work/handler.rs
Runtime task links record completion timestamps, terminal task updates populate them, and executor serialization and ordering use completion time.
Persisted worktree source resolution
executor/src/runtime_work/worktrees.rs, executor/src/runtime_work/handler.rs
Visible project links prefer persisted worktree source paths for grouping, with the existing workspace path fallback retained.
Sidebar completion-aware sorting
wework/src/types/api.ts, wework/src/components/layout/runtimeTaskSidebarHelpers.ts, wework/src/components/layout/runtimeTaskSidebarHelpers.test.ts
The frontend accepts completedAt and uses it to keep completed-task ordering stable during streaming updates.

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

Sequence Diagram(s)

sequenceDiagram
  participant Executor
  participant RuntimeTaskSummary
  participant Sidebar
  Executor->>Executor: Record completed_at for terminal tasks
  Executor->>RuntimeTaskSummary: Serialize completedAt
  RuntimeTaskSummary->>Sidebar: Provide runtime task metadata
  Sidebar->>Sidebar: Sort by completedAt before fallback timestamps
Loading

Possibly related PRs

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/stable-runtime-task-list

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 17, 2026 07:22
@qdaxb
qdaxb merged commit bc9c9bf into main Jul 17, 2026
29 of 30 checks passed
@qdaxb
qdaxb deleted the fix/stable-runtime-task-list branch July 17, 2026 07:22
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