Skip to content

fix: type safety for nullable content fields#849

Open
EricSeastrand wants to merge 1 commit intoslopus:mainfrom
EricSeastrand:fix/nullable-content-type-safety
Open

fix: type safety for nullable content fields#849
EricSeastrand wants to merge 1 commit intoslopus:mainfrom
EricSeastrand:fix/nullable-content-type-safety

Conversation

@EricSeastrand
Copy link

Summary

  • Fixes a crash caused by empty tool_result content arrays triggering an infinite re-fetch loop
  • Adds proper type narrowing for nullable content fields in typesRaw.ts and runAcp.ts

Test plan

  • Verify tool results with empty content arrays no longer cause infinite re-fetch
  • Verify normal tool results with content still render correctly
  • Typecheck passes

🤖 Generated with Claude Code
via Happy

- typesRaw.ts: use optional chaining for tool_result content array to
  prevent crash on empty arrays (fixes infinite re-fetch loop)
- runAcp.ts: widen formatOptionalDetail parameter to accept null

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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