Skip to content

fix(session-ui): drop stale todowrite tool label - #53966

Merged
Brendonovich merged 5 commits into
devfrom
todowrite-tool-title
Oct 13, 2026
Merged

Brendonovich merged 5 commits into
devfrom
todowrite-tool-title

Conversation

@opencode-agent

@opencode-agent opencode-agent Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Opening a session that has an old todowrite tool part crashes the Desktop renderer whenever the UI language isn't English.

getToolInfo still had a todowrite case that returned i18n.t("ui.tool.todos"). That key was removed with the todo tool in #35989. In the app, a missing key resolves to undefined, so the context tool-group label passed undefined into i18n.list. For English locales, list uses join(", "), which quietly drops the value. For every other locale it calls Intl.ListFormat#format, which throws (Iterable yielded undefined which is not a string) and takes down the renderer. A failed todowrite part can still reach a context group, because renderable returns true for failed tools before the todowrite filter runs.

The first commit removes the stale case, so todowrite falls back to its tool name like any other unknown tool.

lint:changed requires every touched GUI file to be lint-clean, and tool-renderer.tsx had 91 existing anti-slop problems, so the second commit clears them:

  • Tool input and metadata fields are decoded with Effect Schema (toolInput / toolMetadata), not typeof checks. Each field decodes on its own, so one malformed value only drops that field. ToolProps keeps the raw open records (with a SAFETY suppression) because GenericTool shows arbitrary input keys and executeToolFailed / patchFileGroups read the raw metadata.
  • getToolInfo was only ever called with no input to label context groups, so it's now toolTitle, which returns just the title. The unused icons, subtitles and the ToolInfo type are gone.
  • Question, answer, diagnostic and loaded-path entries are decoded per item, so invalid entries are still filtered out the same way.
  • Agent tone and theme lookups use Maps, and the file-group patch entries are typed as FileDiffInfo.
  • A few map/filter chains and chained literal ternaries were rewritten.

Seen in a Windows Desktop 2.0.25 debug export: the fatal renderer error fired on every launch.

Verification: bun run lint:changed (0 problems), bun run typecheck in packages/session-ui and packages/app, bun test src in packages/session-ui (250 pass), and prettier --check.

Requested by: @Brendonovich (Brendan via Slack)

Clear the anti-slop lint debt that blocks changes to tool-renderer.tsx:
decode the tool input and metadata fields each renderer reads with Effect
Schema instead of typeof checks, reduce the context group label to a tool
title, and use Maps for agent tone lookups.
@opencode-agent
opencode-agent Bot force-pushed the todowrite-tool-title branch from c5a1d5f to d35aeaf Compare October 13, 2026 06:26
@Brendonovich
Brendonovich enabled auto-merge (squash) October 13, 2026 06:58
@Brendonovich
Brendonovich merged commit c7bddc3 into dev Oct 13, 2026
10 checks passed
@Brendonovich
Brendonovich deleted the todowrite-tool-title branch October 13, 2026 07:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant