Skip to content

fix(executor): preserve task update time on selection - #2384

Merged
qdaxb merged 2 commits into
mainfrom
fix/wework-task-selection-updated-at
Aug 3, 2026
Merged

qdaxb merged 2 commits into
mainfrom
fix/wework-task-selection-updated-at

Conversation

@qdaxb

@qdaxb qdaxb commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

What changed

  • treat runtime.tasks.goal.get as read-only task-state hydration
  • keep real goal transitions updating task activity time while skipping unchanged status writes
  • add a regression test for preserving updated_at during goal hydration
  • document that opening or selecting a LocalTask must not advance updatedAt

Root cause

Selecting a Wework task hydrates its goal state. The executor reused the mutation-oriented goal synchronization path, which unconditionally assigned now_ms() to the LocalTask updated_at. As a result, merely opening a task changed its displayed update time and could affect list ordering.

Impact

Selecting or reopening a task no longer changes its update time. Actual task content and lifecycle changes continue to advance task activity time.

Validation

  • cargo fmt --check --manifest-path executor/Cargo.toml
  • cargo test --manifest-path executor/Cargo.toml --lib goal_status
  • cargo test --manifest-path executor/Cargo.toml --lib syncing_
  • pre-push: cargo test --all-features --lib
  • pre-push: cargo clippy
  • documentation Prettier check for Chinese and English runtime-local-work guides
  • isolated real Tauri verification: created and completed a task, recorded updatedAt = 1785743247743, switched away, reopened it, reloaded Wework, and confirmed updatedAt remained 1785743247743

Summary by CodeRabbit

  • Bug Fixes

    • Reading or opening a local task no longer incorrectly changes its activity timestamp.
    • Goal-status hydration updates task information without altering the existing activity time.
    • Activity timestamps now advance only when task content, lifecycle, or notification-driven changes occur.
  • Documentation

    • Updated English and Chinese developer guides to clarify read-only runtime behavior and activity timestamp rules.

@coderabbitai

coderabbitai Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@qdaxb, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 13 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 7ff51a8e-d28e-49da-8cd8-ddfc71da66a0

📥 Commits

Reviewing files that changed from the base of the PR and between 89ed8b2 and 0c3672f.

📒 Files selected for processing (1)
  • executor/src/runtime_work/handler/tests.rs
📝 Walkthrough

Walkthrough

The runtime handler now hydrates goal status without changing updated_at. Activity-triggered synchronization still updates the timestamp. Tests and English and Chinese documentation describe the distinction.

Changes

Goal status hydration

Layer / File(s) Summary
Separate hydration from activity updates
executor/src/runtime_work/handler/collection.rs, executor/src/runtime_work/handler/archives.rs
The shared update path skips unchanged statuses and updates updated_at only when requested. get_task_goal uses the non-activity hydration path.
Validate and document timestamp behavior
executor/src/runtime_work/handler/tests.rs, docs/en/wegent/developer-guide/runtime-local-work.md, docs/zh/wegent/developer-guide/runtime-local-work.md
A regression test verifies that hydration preserves the existing activity timestamp. Both guides document read-only access semantics.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: preserving task activity time when a task is selected.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ 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-task-selection-updated-at

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 August 3, 2026 08:10

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
executor/src/runtime_work/handler/tests.rs (1)

238-260: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Cover both hydration and activity-update branches.

This test covers only a changed status through hydrate_runtime_task_goal_status. Add one case for an unchanged status that preserves updated_at, and one case for a changed status through sync_runtime_task_goal_status that advances updated_at. These cases will detect a reversed activity flag or a removed no-op guard.

As per coding guidelines, run focused tests before committing and broader tests when risk warrants it.

🤖 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 `@executor/src/runtime_work/handler/tests.rs` around lines 238 - 260, Extend
the runtime task goal-status tests around hydrate_runtime_task_goal_status and
sync_runtime_task_goal_status: add an unchanged-status hydration case that
preserves updated_at, and a changed-status sync case that advances updated_at.
Keep the existing changed hydration case, and run focused tests plus broader
tests if warranted.

Source: Coding guidelines

🤖 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.

Nitpick comments:
In `@executor/src/runtime_work/handler/tests.rs`:
- Around line 238-260: Extend the runtime task goal-status tests around
hydrate_runtime_task_goal_status and sync_runtime_task_goal_status: add an
unchanged-status hydration case that preserves updated_at, and a changed-status
sync case that advances updated_at. Keep the existing changed hydration case,
and run focused tests plus broader tests if warranted.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f8f4093d-5dac-4203-9dfd-2bfa18e423f0

📥 Commits

Reviewing files that changed from the base of the PR and between d4bc498 and 89ed8b2.

📒 Files selected for processing (5)
  • docs/en/wegent/developer-guide/runtime-local-work.md
  • docs/zh/wegent/developer-guide/runtime-local-work.md
  • executor/src/runtime_work/handler/archives.rs
  • executor/src/runtime_work/handler/collection.rs
  • executor/src/runtime_work/handler/tests.rs

@qdaxb
qdaxb added this pull request to the merge queue Aug 3, 2026
Merged via the queue into main with commit 31c640a Aug 3, 2026
47 checks passed
@qdaxb
qdaxb deleted the fix/wework-task-selection-updated-at branch August 3, 2026 09:16
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