Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 15, 2025

The schema documentation incorrectly stated that timeout-minutes defaults to 15 minutes for agentic workflows. The actual implementation has always used 20 minutes via DefaultAgenticWorkflowTimeoutMinutes constant.

Changes

  • Schema documentation (pkg/parser/schemas/main_workflow_schema.json)

    • Updated timeout-minutes field: "15 minutes" → "20 minutes"
    • Updated deprecated timeout_minutes field: "15 minutes" → "20 minutes"
  • Test coverage (pkg/workflow/compiler_timeout_default_test.go)

    • Validates 20-minute default applied when timeout-minutes omitted
    • Validates explicit timeout values respected
    • Validates schema documentation matches constant value
    • Prevents future drift between docs and implementation

Example

Workflow without explicit timeout:

---
on: workflow_dispatch
permissions:
  contents: read
engine: copilot
---

Generates step with correct default:

timeout-minutes: 20

The 20-minute default is applied consistently across all engines (Copilot, Claude, Codex) and has been since initial implementation. No code changes required—only documentation correction.

Original prompt

This section details on the original issue you should resolve

<issue_title>[task] Verify and document timeout-minutes default behavior</issue_title>
<issue_description>## Objective
Investigate the actual timeout-minutes default behavior and update schema documentation to match reality.

Context

The schema claims "Defaults to 15 minutes for agentic workflows" but no code implementation sets this default. This creates misleading documentation. Part of discussion #4010.

Current State

Schema location: pkg/parser/schemas/main_workflow_schema.json

Schema claim: "Defaults to 15 minutes for agentic workflows"

Implementation: Field is extracted but no default value is assigned:

TimeoutMinutes string // extracted from frontmatter, no default set

Investigation Steps

  1. Search codebase for timeout-minutes default assignment
  2. Check GitHub Actions default timeout (documented as 360 minutes / 6 hours)
  3. Test actual workflow behavior when timeout-minutes is omitted
  4. Determine intended behavior: 15 minutes or GitHub Actions default

Decision Required

Choose one of these paths:

Option A: Implement 15-minute default

  • Add default value assignment in compiler
  • Keep schema description as-is
  • Files to modify: pkg/workflow/compiler.go or frontmatter extraction logic

Option B: Document actual behavior

  • Update schema description to reflect GitHub Actions default (360 minutes)
  • No code changes needed
  • File to modify: pkg/parser/schemas/main_workflow_schema.json

Files to Investigate

  • pkg/parser/schemas/main_workflow_schema.json - Schema documentation
  • pkg/workflow/compiler.go - Compiler logic
  • pkg/workflow/frontmatter_extraction.go - Field extraction
  • Any engine-specific timeout handling

Acceptance Criteria

  • Actual timeout-minutes default behavior is verified
  • Schema documentation matches implementation
  • If default is implemented, tests validate the 15-minute default
  • If documentation is updated, it accurately reflects GitHub Actions behavior

Related Information

  • GitHub Actions default timeout: 360 minutes (6 hours)
  • Current schema claims 15 minutes but this may be unimplemented

AI generated by Plan Command for discussion #4010</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Verify and document timeout-minutes default behavior Fix timeout-minutes schema documentation: 20 minutes, not 15 Nov 15, 2025
Copilot AI requested a review from pelikhan November 15, 2025 07:06
Copilot finished work on behalf of pelikhan November 15, 2025 07:06
@pelikhan pelikhan marked this pull request as ready for review November 15, 2025 12:44
Copilot AI review requested due to automatic review settings November 15, 2025 12:44
Copilot finished reviewing on behalf of pelikhan November 15, 2025 12:46
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR corrects documentation in the schema to match the actual implementation: the default timeout for agentic workflows is 20 minutes, not 15 minutes. The default has always been 20 minutes via DefaultAgenticWorkflowTimeoutMinutes constant, but the schema documentation incorrectly stated 15 minutes.

Key changes:

  • Updated schema documentation to correctly reflect the 20-minute default
  • Added comprehensive test coverage to validate the default timeout behavior and prevent future documentation drift

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
pkg/parser/schemas/main_workflow_schema.json Updated timeout documentation from "15 minutes" to "20 minutes" for both timeout-minutes and deprecated timeout_minutes fields
pkg/workflow/compiler_timeout_default_test.go Added new test file with three test functions: validates default timeout applied when omitted, validates explicit timeouts respected, and validates schema documentation matches the constant value

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +121 to +135
// Helper function to convert int to string
func intToString(n int) string {
if n == 0 {
return "0"
}
if n < 0 {
return "-" + intToString(-n)
}
result := ""
for n > 0 {
result = string(rune('0'+n%10)) + result
n /= 10
}
return result
}
Copy link

Copilot AI Nov 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This custom intToString helper function is unnecessary. Go's standard library provides strconv.Itoa() for integer-to-string conversion, which is already used elsewhere in the codebase (e.g., pkg/cli/logs.go, pkg/cli/mcp_server.go).

Recommended fix: Remove this function and use strconv.Itoa() on line 89 instead.

Copilot uses AI. Check for mistakes.
Comment on lines +87 to +90
expectedTimeoutStr := "timeout-minutes: " + string(rune(tt.expectedTimeout+'0'))
if tt.expectedTimeout >= 10 {
expectedTimeoutStr = "timeout-minutes: " + intToString(tt.expectedTimeout)
}
Copy link

Copilot AI Nov 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logic for building expectedTimeoutStr is flawed. Line 87 attempts to convert an integer to a string using string(rune(tt.expectedTimeout+'0')), which works incorrectly for multi-digit numbers. For example, with expectedTimeout=20, this would compute string(rune(68)) = "D", producing "timeout-minutes: D".

While the code on lines 88-90 fixes this for values >= 10 by calling intToString, the initial assignment on line 87 is incorrect and unnecessary.

Recommended fix: Use Go's standard library strconv.Itoa() instead:

import (
    "strconv"
    // ... other imports
)

// In the test:
expectedTimeoutStr := "timeout-minutes: " + strconv.Itoa(tt.expectedTimeout)

This eliminates the need for the custom intToString helper function (lines 121-135) and the conditional check on line 88.

Copilot uses AI. Check for mistakes.
@pelikhan pelikhan merged commit 0aeebc1 into main Nov 15, 2025
78 of 84 checks passed
@pelikhan pelikhan deleted the copilot/verify-timeout-minutes-default branch November 15, 2025 12:47
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.

[task] Verify and document timeout-minutes default behavior

2 participants