#20864: fix(auto-reply): replace any with unknown in extractTextFromToolResult
size: XS
Cluster:
Session Management and Fixes
## Summary
Replace `any` parameter type with `unknown` in the private `extractTextFromToolResult` function.
## Changes
- Remove `// oxlint-disable-next-line typescript/no-explicit-any` comment
- Change `result: any` to `result: unknown`
## Motivation
The function body already performs proper type narrowing via `typeof` checks and explicit casts, making the `any` annotation unnecessary.
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Replaced `any` with `unknown` in the `extractTextFromToolResult` function parameter type, removing the associated oxlint disable comment. The function already performs proper type narrowing via `typeof` checks (line 57, 61) and explicit casts (line 60), making this change safe. The downstream `collectTextContentBlocks` function already accepts `unknown`, ensuring type compatibility. This aligns with the repository's coding style guideline to prefer strict typing and avoid `any`.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk
- The change improves type safety by replacing `any` with `unknown` in a single function parameter. The function implementation already contains proper type guards and narrowing, and all downstream dependencies accept `unknown`. This is a straightforward refactoring with no behavioral changes.
- No files require special attention
<sub>Last reviewed commit: 5d0e1f7</sub>
<!-- greptile_other_comments_section -->
<sub>(5/5) You can turn off certain types of comments like style [here](https://app.greptile.com/review/github)!</sub>
<!-- /greptile_comment -->
Most Similar PRs
#20865: fix(agents): replace AgentTool<any> with Record<string, unknown> ge...
by novalis133 · 2026-02-19
75.2%
#13884: feat: Replace any types with proper TypeScript interfaces for bette...
by trevorgordon981 · 2026-02-11
72.8%
#6819: fix(tui): handle unstructured tool results and errors in tool execu...
by TreyDong · 2026-02-02
69.6%
#17885: fix: replace anyOf union type in image tool schema
by pierreeurope · 2026-02-16
67.3%
#21285: fix(auto-reply): parse toolCall read paths in post-compaction audit
by Jackten · 2026-02-19
67.2%
#22087: Preserve assistant reply when exec fails under suppressToolErrors
by graysurf · 2026-02-20
67.1%
#14098: Sanitize JSON tool-call payload text
by helloember99 · 2026-02-11
66.5%
#19632: fix: suppressToolErrors now suppresses exec tool failure notifications
by Gitjay11 · 2026-02-18
66.2%
#23381: fix(tools): allow empty newText in edit tool for text deletion
by SidQin-cyber · 2026-02-22
65.8%
#16733: fix(ui): avoid injected newlines when tool output is hidden
by jp117 · 2026-02-15
65.7%