#11185: fix #11150 - [Bug]: Exec tool schema host default ignores tools.exec.host config
agents
stale
## Description
Fixes issue #11150
## Changes
Modified createExecTool to dynamically set the default value for the host parameter in the tool schema using the provided configuration.
<!-- greptile_comment -->
<h2>Greptile Overview</h2>
<h3>Greptile Summary</h3>
This PR updates `createExecTool` to set the `host` parameter’s schema default dynamically from `defaults?.host` (falling back to `"sandbox"`), so generated tool schemas reflect `tools.exec.host` configuration instead of always defaulting to sandbox.
The change is localized to `src/agents/bash-tools.exec.ts` and affects the tool schema metadata used for parameter validation/introspection.
<h3>Confidence Score: 3/5</h3>
- This PR is close to mergeable, but the schema-spread approach risks breaking TypeBox schema integrity in tooling/validation paths.
- The functional intent is clear and the behavioral change is small, but mutating a TypeBox schema via object spread can drop internal metadata and cause runtime issues in parameter validation/introspection. Fixing the schema construction to use TypeBox APIs should make this safe.
- src/agents/bash-tools.exec.ts
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#21280: fix(exec): reflect configured exec host in tool schema default (#11...
by Asm3r96 · 2026-02-19
87.0%
#21562: fix: exec host error message shows configuredHost instead of reques...
by TopangaLudwitt · 2026-02-20
78.9%
#21820: fix(exec): show requested host in disallowed host hint
by AlexAnys · 2026-02-20
77.1%
#21509: fix: show requestedHost instead of configuredHost in exec host erro...
by sleitor · 2026-02-20
76.1%
#4897: fix: config logic issues (#4689, #4654)
by lailoo · 2026-01-30
75.8%
#15983: feat(exec): support env field in tools.exec config
by Imccccc · 2026-02-14
73.8%
#11854: fix: resolve per-agent tools.exec config in pi-tools
by Yida-Dev · 2026-02-08
73.5%
#23811: Config: fail closed when exec host=sandbox but sandbox mode is off
by bmendonca3 · 2026-02-22
71.6%
#10189: fix: resolve file_path param in tool display for read/write tools
by Yida-Dev · 2026-02-06
71.5%
#3872: improve bash-tools.exec.ts code quality
by Bestom927 · 2026-01-29
71.1%