Skip to content

[plan] Parameterize tools config fields (timeout, startup-timeout, per-tool versions) to accept expressions #23842

@github-actions

Description

@github-actions

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 strings

Expected Behavior

tools:
  timeout: ${{ inputs.tool-timeout }}          # ✅ Expression for integer
  startup-timeout: ${{ inputs.startup-timeout }}  #
  playwright:
    version: ${{ inputs.playwright-version }}   #

Approach

  1. tools.timeout and tools.startup-timeout (integers):

    • Apply preprocessIntFieldAsString pattern in pkg/workflow/tools_parser.go (NewTools).
    • Change ToolsConfig.Timeout and ToolsConfig.StartupTimeout from *int to *string.
    • Use AddTemplatableInt when building the handler config.
    • Update JSON schema items for timeout and startup-timeout to accept integer or expression string.
  2. tools.playwright.version (string):

    • PlaywrightToolConfig.Version is 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).
  3. tools.github.toolsets (array):

    • Allow ${{ inputs.toolsets }} as an alternative to a literal array (similar to network.allowed approach).
    • Lower priority; include if straightforward.
  4. Update JSON schema in pkg/parser/schemas/main_workflow_schema.json for each field.

  5. Update pkg/workflow/tools_parser.go to preprocess and validate expression values.

  6. Update compilation to emit expressions correctly in the compiled YAML.

  7. Add tests for each changed field.

Files to Modify

  • pkg/workflow/tools_parser.go — preprocess fields before unmarshaling
  • pkg/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: 60 still works (backward compatible)
  • tools.timeout: ${{ inputs.tool-timeout }} compiles and expression appears correctly in compiled .lock.yml
  • Same for tools.startup-timeout and tools.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

Metadata

Metadata

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions