Skip to content

Fix orphaned tool result UI fallback#188

Merged
im10furry merged 1 commit into
mainfrom
fix/orphaned-tool-result-ui
Jun 6, 2026
Merged

Fix orphaned tool result UI fallback#188
im10furry merged 1 commit into
mainfrom
fix/orphaned-tool-result-ui

Conversation

@im10furry

Copy link
Copy Markdown
Collaborator

Summary

  • Fix UI crash when rendering orphaned tool_result blocks whose tool_use_id no longer matches an assistant tool_use.
  • Keep provider/protocol handling strict; the fallback is limited to UI rendering.
  • Add a quiet fallback for successful tool results when tool lookup, tool renderer, or toolUseResult data is unavailable.
  • Keep rejected tool results on the existing rejection fallback when lookup/parsing fails.
  • Add Ink regression tests for orphaned success/rejected results and normal matched rendering.

Testing

  • bun test tests/unit/user-tool-result-message-orphaned.test.tsx
  • bun test tests/unit/messages-ui-consistency.test.ts tests/unit/repl-static-split.test.ts tests/unit/session-load.test.ts
  • bun run typecheck
  • bun run lint
  • bun run build:npm

Full bun test was also run; unrelated Windows 5s timeouts occurred in filesystem permission/LSP tests. The affected files passed with:

  • bun test --timeout 15000 tests/unit/file-permission-engine.test.ts tests/unit/lsp-tool.test.ts

- Fix UI crash when rendering orphaned tool_result blocks whose tool_use_id no
  longer matches an assistant tool_use.
- Keep provider/protocol handling strict; the fallback is limited to UI rendering.
- Add a quiet fallback for successful tool results when tool lookup, tool renderer,
  or toolUseResult data is unavailable.
- Keep rejected tool results on the existing rejection fallback when lookup/parsing
  fails.
- Add Ink regression tests for orphaned success/rejected results and normal matched
  rendering.
@im10furry im10furry merged commit 2c26822 into main Jun 6, 2026
3 checks passed
@im10furry im10furry deleted the fix/orphaned-tool-result-ui branch June 6, 2026 09:50
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