Skip to content

fix(desktop): keep restored todo state current#4309

Closed
GTC2080 wants to merge 1 commit into
esengine:main-v2from
GTC2080:GTC/issue-4259-todo-state
Closed

fix(desktop): keep restored todo state current#4309
GTC2080 wants to merge 1 commit into
esengine:main-v2from
GTC2080:GTC/issue-4259-todo-state

Conversation

@GTC2080

@GTC2080 GTC2080 commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Closes #4259.

Summary

  • Replay successful complete_step calls into restored desktop history so the visible todo_write state matches the runtime host-advanced task list after session reloads or tab switches.
  • Hide the desktop todo panel once every item is completed, while keeping an incomplete list visible until the user dismisses it.
  • Key todo dismissals by the stable todo list state instead of transient event IDs, so the same stale list does not reappear under a new history id.
  • Add desktop history replay regressions and wire the todo visibility/performance check into the frontend test scripts.

Root cause

The live runtime advances canonical todos when complete_step succeeds, but restored desktop history was rebuilt from the original todo_write arguments. After switching sessions or reloading, the frontend could therefore rediscover an older incomplete todo list, even though the task had already advanced or finished. The frontend also treated any non-empty successful todo list as visible, so a fully completed list stayed pinned.

Verification

  • go test . -run 'TestHistoryMessages.*TodoWrite' in desktop/ (failed before the fix)
  • npm run test:todo-visibility (failed before the fix)
  • npm run test:all in desktop/frontend/
  • npm run build in desktop/frontend/
  • go test ./... at repo root
  • go test ./... in desktop/
  • gofmt -l .
  • git diff --check
  • Browser smoke: opened http://127.0.0.1:5174/, confirmed title Reasonix, root render, and zero console errors

Related: #4241 describes the completed-list half of the same restored todo-state failure mode; #4259 covers the broader stale-progress case.

Copy link
Copy Markdown
Collaborator

Thanks again for this contribution. I opened #4313 as an integration PR that includes this PR's restored desktop history replay, stable todo dismissal key, and restored-history regression coverage.

#4313 also fixes the two remaining replay gaps from review: lowercase failed tool results like error:/blocked: no longer restore as success, and a complete_step call without a matching successful tool result no longer advances restored todo state. To keep review focused, I’m closing this PR as superseded by #4313. You are credited in the integration commit and PR body.

@SivanCola SivanCola closed this Jun 13, 2026
esengine pushed a commit that referenced this pull request Jun 14, 2026
…#4313)

Seed the agent's canonical todo state from approved plans so later complete_step calls advance the visible panel, and rebuild restored desktop history by replaying todo_write/complete_step only on explicitly successful tool results (missing or errored results no longer count as completed). Hide the panel once all todos are done, keyed to stable content rather than array identity. Integrates #4159, #4230, #4271, and #4309.

Closes #4259
Closes #4105
Closes #4170
Closes #4241

Co-authored-by: JesonChou <51042251+JesonChou@users.noreply.github.com>
Co-authored-by: ashishexee <144021866+ashishexee@users.noreply.github.com>
Co-authored-by: GTC2080 <140309575+GTC2080@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

desktop Wails desktop app (desktop/**) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: 待办没有及时更新,经常任务结束待办还是卡在某个条目;手动关闭代码,切换会话后还会出现待办框

2 participants