Skip to content

[bug] Todo dock UI does not refresh after todowrite tool updates session todos #33063

Closed as not planned

Description

Description

The todo dock panel (SessionTodoDock) displays stale todo data from initial session load and does not re-render when the todowrite tool (packages/core/src/tool/todowrite.ts) updates session todos.

Root cause: serverSync().data.session_todo does not trigger SolidJS reactivity when the todo.updated event arrives. The createMemo depends on serverSync().data.session_todo[id], but if this property is mutated in-place (object property assignment without store.replace), SolidJS has no signal that the value changed. The TUI terminal version uses a different path (props.api.state.session.todo(session_id)) which is properly reactive via the @opencode-ai/state observable pattern.

Steps to reproduce

  1. Open a session and let the model call todowrite with pending tasks. Todo dock shows correct initial state
  2. The model calls todowrite again with updated tasks (e.g., marking some completed)
  3. The todo dock still shows the old data from the first call
  4. Only a full page reload shows the updated data

Expected behavior

The todo dock should re-render immediately when todowrite updates session todos, without requiring a page reload. The todo.updated event publisher should trigger a store-level reactivity update in SolidJS rather than an in-place mutation.

Code location

  • packages/core/src/session/todo.ts
  • packages/core/src/tool/todowrite.ts (L47: todos.update() call)
  • packages/app/src/pages/session/composer/session-composer-state.ts (L52-L58)
  • packages/app/src/pages/session/composer/session-todo-dock.tsx

Environment

OpenCode Desktop 1.17.8, Windows 11

Plugins

None

Activity

  1. lexlian commented on Jun 20, 2026

    @lexlian

    @LifetimeVip @Hona I fixed the issue with PR #33116.

    The SessionTodoDock rendered its checkbox list with Solid's <Index>, which only re-renders when the array length or item references change. The global todo store updates via reconcile({ key: "id" }), which preserves item references for unchanged IDs — so <Index> saw stale items when only a todo's status or content changed. Switching to <For> (which diffs by value reference, like the working TUI sidebar at packages/tui/src/feature-plugins/sidebar/todo.tsx) makes the dock reactive to in-place updates.

    Single-file fix in packages/app/src/pages/session/composer/session-todo-dock.tsx. TUI was unaffected — it already uses <For>.

  2. lexlian commented on Jun 22, 2026

    @lexlian

    @LifetimeVip,

    I can take a look of the issues you mentioned first. But finally I think it's up to Opencode committers' decisions of how to handle PR for issues and features, to align with their development focus.

    我可以先看一下你提到到的Issue。但最终是Opencode项目的committer来决定如何处理issue或feature的PR,同他们的开发目标保持一致。

    @lexlian 你好,感谢你修了 Todo 面板的问题!

    我最近发现了 opencode 的很多 bug,都提了 issue。虽然这些 bug 是 AI 辅助分析挖掘出来的,但都是在实际使用中真的觉得不好用,才去提的 issue。

    想问一下,你还有时间和精力帮忙看看其他的 bug 吗?如果方便的话,可以去我提交的那些 issue 看看。尤其是下面几个影响最大的:

    1. 误删和误修 — Edit 工具会静默删除符号定义([bug] Edit tool silently deletes symbol definitions without cross-reference validation #33062),而且没有写前预读检查([FEATURE]: Optional read-before-write precondition for edit/write tools #33089),很容易在不知情的情况下改错文件
    2. 批量查找和批量修改时的错误 — Glob/Grep 可以跑到工作区外面去([bug] Glob and Grep tools allow directory traversal outside Location boundary #33070),WebFetch URL 验证形同虚设([bug] WebFetch tool URL validation is a no-op: invalid URLs pass through silently #33073),Write 工具能写入空内容覆盖已有文件([bug] Write tool silently writes empty content, overwriting existing files with nothing #33078)
    3. Windows 残留进程 — Bash 工具执行完后可能遗留孤儿进程([bug] Bash tool on Windows: TOCTOU race in taskkill /T /F process tree cleanup (orphan leak) #33071)

    这些都是实际开发中踩过的坑,不是空想出来的。如果你或者你认识的人有兴趣帮忙修,那就太好了!

  3. rekram1-node commented on Jun 22, 2026

    @rekram1-node
    Contributor

    STOP SPAMMING ISSUES.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions