-
Notifications
You must be signed in to change notification settings - Fork 328
[plan] Parameterize tools config fields (timeout, startup-timeout, per-tool versions) to accept expressions #23842
Description
Objective
Allow commonly used numeric and boolean fields within tools configuration (e.g. tools.timeout, tools.startup-timeout, tool-specific version fields) to accept GitHub Actions expression strings, enabling reusable workflow_call workflows to customize tool behavior at call time.
Context
Tracked in issue #23724. The tools field is complex (many sub-fields with different types) so this issue focuses on the highest-value fields: timeouts and per-tool version overrides. The templatables.go helpers (preprocessIntFieldAsString, AddTemplatableInt, preprocessBoolFieldAsString, AddTemplatableBool) should be applied to these fields.
Target Fields
| Field | Type | Use Case |
|---|---|---|
tools.timeout |
integer (seconds) | Per-workflow tool timeout |
tools.startup-timeout |
integer (seconds) | Tool startup timeout |
tools.playwright.version |
string | Pin Playwright version per workflow |
tools.github.toolsets |
array of strings | Could be expression (list) |
Current Behavior
tools:
timeout: 60 # Only literal integers
startup-timeout: 30 # Only literal integers
playwright:
version: "1.41.0" # Only literal stringsExpected Behavior
tools:
timeout: ${{ inputs.tool-timeout }} # ✅ Expression for integer
startup-timeout: ${{ inputs.startup-timeout }} # ✅
playwright:
version: ${{ inputs.playwright-version }} # ✅Approach
-
tools.timeoutandtools.startup-timeout(integers):- Apply
preprocessIntFieldAsStringpattern inpkg/workflow/tools_parser.go(NewTools). - Change
ToolsConfig.TimeoutandToolsConfig.StartupTimeoutfrom*intto*string. - Use
AddTemplatableIntwhen building the handler config. - Update JSON schema items for
timeoutandstartup-timeoutto accept integer or expression string.
- Apply
-
tools.playwright.version(string):PlaywrightToolConfig.Versionis already a string; check if expression detection is needed.- Update the schema to explicitly allow
${{ ... }}strings if not already. - Ensure the version string is passed safely to the compiled YAML (not shell-injected).
-
tools.github.toolsets(array):- Allow
${{ inputs.toolsets }}as an alternative to a literal array (similar tonetwork.allowedapproach). - Lower priority; include if straightforward.
- Allow
-
Update JSON schema in
pkg/parser/schemas/main_workflow_schema.jsonfor each field. -
Update
pkg/workflow/tools_parser.goto preprocess and validate expression values. -
Update compilation to emit expressions correctly in the compiled YAML.
-
Add tests for each changed field.
Files to Modify
pkg/workflow/tools_parser.go— preprocess fields before unmarshalingpkg/workflow/tools_types.go— change field types where needed (*int→*string)pkg/parser/schemas/main_workflow_schema.json— relax type constraints- Compilation code emitting tool config — use templatable helpers
- Tests in
pkg/workflow/
Acceptance Criteria
-
tools.timeout: 60still works (backward compatible) -
tools.timeout: ${{ inputs.tool-timeout }}compiles and expression appears correctly in compiled.lock.yml - Same for
tools.startup-timeoutandtools.playwright.version - Invalid non-expression strings produce clear error messages
- Tests pass:
make agent-finish
Related to Ask: Runtime Parameterization of Compile-Time Frontmatter Fields #23724
Generated by Plan Command for issue #23724 · ◷
- expires on Apr 3, 2026, 5:44 AM UTC