← Back to PRs

#21280: fix(exec): reflect configured exec host in tool schema default (#11150)

by Asm3r96 open 2026-02-19 21:38 View on GitHub →
agents size: S
Fixes openclaw/openclaw#11150. When ools.exec.host is configured (e.g. "gateway"), parameter-filling models often send host: "sandbox" because the exec tool schema default was static. This causes avoidable failed tool calls. Changes: - Make exec schema default host dynamic and derived from effective config. - Add regression test for schema defaults. - Document tools.exec host/security/ask defaults in schema help. AI-assisted: yes. Testing: - pnpm check - pnpm vitest run src/agents/bash-tools.exec.schema.test.ts <!-- greptile_comment --> <h3>Greptile Summary</h3> Fixed parameter-filling models sending disallowed `host` values by making the exec tool schema default dynamic based on effective configuration. When `tools.exec.host` is configured (e.g., "gateway"), the schema now reflects this as the default instead of hardcoding "sandbox", preventing unnecessary failed tool calls. **Changes:** - Converted static `execSchema` to `createExecSchema()` function that accepts `defaultHost` parameter - Updated `createExecTool` to pass configured host value to schema generator - Maintained backward compatibility by exporting default `execSchema` instance - Added regression tests verifying schema defaults match configuration - Documented `tools.exec.host`, `tools.exec.security`, and `tools.exec.ask` defaults in schema help <h3>Confidence Score: 5/5</h3> - This PR is safe to merge with minimal risk - The implementation is straightforward, well-tested, and maintains backward compatibility. The change only affects the tool schema default value shown to models, making it align with the actual configuration. The old `execSchema` export is preserved, tests cover both configured and unconfigured cases, and the documentation accurately describes the new behavior. - No files require special attention <sub>Last reviewed commit: 1c9a4c9</sub> <!-- greptile_other_comments_section --> <sub>(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!</sub> <!-- /greptile_comment -->

Most Similar PRs