Commit f9bfa5d
HCL
fix(schema): accept tools.codeMode at agent-entry scope (#83388)
docs/reference/code-mode.md describes 'tools.codeMode.enabled: true' as
settable on 'the agent or runtime config'. The top-level ToolsSchema
already accepts codeMode, but AgentToolsSchema is .strict() and didn't
include the key, so gateway startup rejected the documented per-agent
shape with 'agents.list.0.tools: Unrecognized key: "codeMode"'.
Add 'codeMode: CodeModeSchema' to AgentToolsSchema. The schema is the
same one consumed at the top level, so the boolean shorthand and the
full object form (enabled/runtime/timeoutMs/languages/...) all behave
identically at the per-agent scope. strict() is preserved on the inner
schema; unknown nested keys still reject.
Adds 1 regression case in zod-schema.agent-defaults.test.ts covering:
- per-agent { codeMode: { enabled: true } } shape accepts
- boolean codeMode: true shape accepts
- full options object accepts
- unknown nested key still rejected (strict() preserved)1 parent 6baa2b3 commit f9bfa5d
2 files changed
Lines changed: 48 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
342 | 342 | | |
343 | 343 | | |
344 | 344 | | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
345 | 387 | | |
346 | 388 | | |
347 | 389 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
703 | 703 | | |
704 | 704 | | |
705 | 705 | | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
706 | 712 | | |
707 | 713 | | |
708 | 714 | | |
| |||
0 commit comments