Skip to content

feat: accept object form for toolsConfig values#1462

Merged
Evanfeenstra merged 1 commit into
mainfrom
feat/toolsconfig-object-values
Jul 10, 2026
Merged

feat: accept object form for toolsConfig values#1462
Evanfeenstra merged 1 commit into
mainfrom
feat/toolsconfig-object-values

Conversation

@Evanfeenstra

Copy link
Copy Markdown
Collaborator

What

toolsConfig values can now optionally be an object, in addition to the existing string | boolean | null forms. This lets a caller pass a description override and tool-specific options at once — e.g. graph_sub_agent's maxDepth/maxSteps (follow-up to #1461).

Fully backwards compatible.

Value Meaning
true enable (default description)
false disable
"some string" enable + use string as description override
null keep default
{ ... } new — enable (unless enabled: false) + carry description and options
{
  "toolsConfig": {
    "graph_sub_agent": { "description": "Explore the graph...", "maxDepth": 3, "maxSteps": 15 },
    "logs_agent": { "description": "custom desc" },
    "bash": { "enabled": false }
  }
}

How

  • New types in tools.ts: ToolConfigObject (enabled?, description?, maxDepth?, maxSteps?) and ToolConfigValue = string | boolean | null | ToolConfigObject.
  • Two helpers centralize all interpretation of a config value:
    • toolConfigEnabled(v) — truthiness that also honors { enabled: false }.
    • toolConfigDescription(v) — pulls the string override or object.description.
  • Routed every existing toolsConfig read through the helpers instead of ad-hoc if (toolsConfig.X) / typeof … === "string" checks: the opt-in tools (ask_clarifying_questions, logs_agent, str_replace_based_edit_tool, apply_patch, generate_*, concepts), the generic filter loop, and the 3 truthiness sites in agent.ts.
  • The generic filter loop now also applies object description overrides and honors { enabled: false } for any tool.
  • graph_sub_agent reads maxDepth/maxSteps from the object form (previously hardcoded), making recursion depth user-configurable.

Testing

  • npx tsc --noEmit clean
  • tools + docgen suites — 56/56 pass

A per-tool config value can now be an object ({ enabled?, description?,
maxDepth?, maxSteps? }) in addition to the existing string/boolean/null forms,
so a caller can pass a description override AND tool-specific options at once
(e.g. graph_sub_agent maxDepth/maxSteps).

Adds ToolConfigObject/ToolConfigValue types plus toolConfigEnabled() and
toolConfigDescription() helpers, and routes every toolsConfig read through them
(opt-in tools, the generic filter loop, and agent.ts). The generic loop now
also applies object description overrides and honors { enabled: false } for any
tool. Fully backwards compatible.
@Evanfeenstra Evanfeenstra merged commit 0f85c39 into main Jul 10, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant