#20865: fix(agents): replace AgentTool<any> with Record<string, unknown> generics
agents
size: XS
Cluster:
Session Management and Fixes
## Summary
Replace `any` generic parameter in `createProcessTool` and `createExecTool` return types with `Record<string, unknown>`.
## Changes
- `bash-tools.process.ts`: `AgentTool<any, unknown>` → `AgentTool<Record<string, unknown>, unknown>`
- `bash-tools.exec.ts`: `AgentTool<any, ExecToolDetails>` → `AgentTool<Record<string, unknown>, ExecToolDetails>`
- Remove both `oxlint-disable-next-line` comments
## Motivation
Both functions immediately cast `args` inside `execute()`. TypeBox validates runtime values, so `Record<string, unknown>` accurately describes the schema argument type without `any`.
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Replaced `any` generic parameter with `Record<string, unknown>` in `createProcessTool` and `createExecTool` return type signatures, and removed corresponding `oxlint-disable-next-line` comments.
**Changes:**
- `bash-tools.process.ts:121`: `AgentTool<any, unknown>` → `AgentTool<Record<string, unknown>, unknown>`
- `bash-tools.exec.ts:216`: `AgentTool<any, ExecToolDetails>` → `AgentTool<Record<string, unknown>, ExecToolDetails>`
- Removed both lint-disable comments
**Rationale:**
Both functions immediately cast `args` to specific types inside their `execute()` implementations (line 247 in exec.ts, line 155 in process.ts). TypeBox validates runtime values at the schema boundary, so `Record<string, unknown>` accurately represents the untyped schema arguments without using `any`.
This improves type safety by avoiding `any` while maintaining existing runtime behavior.
<h3>Confidence Score: 5/5</h3>
- This PR is safe to merge with minimal risk
- The change is a straightforward type improvement that replaces `any` with `Record<string, unknown>` in generic type parameters. Both functions already cast args immediately inside execute(), and TypeBox handles runtime validation. The change improves type safety without altering runtime behavior, and removes technical debt by eliminating lint-disable comments.
- No files require special attention
<sub>Last reviewed commit: 98e7f64</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
#20864: fix(auto-reply): replace any with unknown in extractTextFromToolResult
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%
#12642: feat(tools): typed tool schemas for xAI/Grok compatibility
by 2nd-ren · 2026-02-09
71.6%
#3872: improve bash-tools.exec.ts code quality
by Bestom927 · 2026-01-29
71.3%
#9861: fix(agents): re-run tool_use/tool_result repair after limitHistoryT...
by CyberSinister · 2026-02-05
71.0%
#8874: Fix parameter order in execute function
by andycaihello · 2026-02-04
70.6%
#3647: fix: sanitize tool arguments in session history
by nhangen · 2026-01-29
70.5%
#11185: fix #11150 - [Bug]: Exec tool schema host default ignores tools.exe...
by Lucky-Lodhi2004 · 2026-02-07
70.3%
#18466: fix: suppress recoverable mutating tool errors when agent already r...
by stijnhoste · 2026-02-16
70.2%
#19632: fix: suppressToolErrors now suppresses exec tool failure notifications
by Gitjay11 · 2026-02-18
69.7%