Skip to content

fix(tui): restore inline todo table rendering from tool args - #129

Merged
buchenberg merged 1 commit into
mainfrom
fix/tui-todo-rendering
Aug 3, 2026
Merged

fix(tui): restore inline todo table rendering from tool args#129
buchenberg merged 1 commit into
mainfrom
fix/tui-todo-rendering

Conversation

@buchenberg

Copy link
Copy Markdown
Owner

The persistent todo table at the top of the viewport relied on \CtrlTodos\ arriving via the control channel. If the channel-buffered message was silently dropped (select/default), or arrived after the ToolEndEvent already refreshed the viewport, the table would never render.

Changes

1. Remove select/default from OnWrite (\cmd/yaah/agent_frame.go)
The \default\ case silently dropped \CtrlTodos\ if the channel buffer was full. Removed it so the send always succeeds. The 64-slot buffer makes blocking a non-issue in practice.

2. Inline table rendering from tool args (\internal/tui/tui.go)
Added \parseTodosFromArgs\ and inline rendering in \AddToolResult. When \ odowrite\ completes, the tool args JSON is parsed directly to render the table inside the tool result box. This completely bypasses the control channel and guarantees the table is always visible.

The inline rendering also works alongside the existing persistent top-of-viewport rendering — both paths complement each other.

The persistent todo table at the top of the viewport depended on CtrlTodos
arriving via the control channel. If the channel-buffered message was
silently dropped (select/default), or arrived after the ToolEndEvent
already refreshed the viewport, the table would never render.

Two changes:

1. Remove select/default from the OnWrite callback so CtrlTodos is never
   silently dropped. The 64-slot buffered channel makes blocking a
   non-issue in practice.

2. Add inline todo table rendering in AddToolResult. When the todowrite
   tool completes, parse the tool args JSON directly and render the table
   inside the tool result box. This bypasses the control channel entirely
   and guarantees the table is always visible regardless of CtrlTodos
   delivery timing.
@buchenberg
buchenberg merged commit d66e312 into main Aug 3, 2026
4 checks passed
@buchenberg
buchenberg deleted the fix/tui-todo-rendering branch August 3, 2026 16:57
Comment thread internal/tui/tui.go
rendered := m.renderToolResult(toolName, content)

if toolName == "todowrite" && toolArgs != "" {
if items := parseTodosFromArgs(toolArgs); len(items) > 0 {

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.

WARNING: Inline todo rendering receives truncated tool args

toolArgs comes from ToolEndEvent.Args (tui.go:762), which is truncated to 80 characters via abbreviateArgs(tc.Function.Arguments, 80) at internal/agent/agent_tools.go:46. For any realistic todowrite call with multiple todo items, the JSON exceeds 80 chars and is truncated with ..., causing json.Unmarshal in parseTodosFromArgs (tui.go:1869) to fail and return nil. The inline table rendering at this line never fires.

The actual table-visibility guarantee comes solely from change #1 (the blocking send at cmd/yaah/agent_frame.go:574), not this inline path. Consider reading from TodoWriteTool.Store.List() directly, or carrying full (unabbreviated) args in ToolEndEvent.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@kilo-code-bot

kilo-code-bot Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 1
SUGGESTION 0
Issue Details (click to expand)

WARNING

File Line Issue
internal/tui/tui.go 503 Inline todo table rendering reads from ToolEndEvent.Args, which is truncated to 80 chars via abbreviateArgs() — JSON parsing fails for any realistic todowrite call, so the inline table never renders
Files Reviewed (2 files)
  • cmd/yaah/agent_frame.go — blocking send fix (change feat(tui): markdown rendering, bordered panels, banner, and powershell tool #1) is correct; OnWrite now reliably delivers CtrlTodos; no issues found
  • internal/tui/tui.go — 1 WARNING: parseTodosFromArgs(toolArgs) at line 503 receives truncated args from ToolEndEvent.Args (80-char limit at agent_tools.go:46); inline table never renders for realistic inputs

Fix these issues in Kilo Cloud


Reviewed by laguna-s-2.1:free · Input: 756K · Output: 31.6K · Cached: 511.4K

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