Skip to content

Add timeout and strict mode configuration to 8 workflows#4861

Merged
pelikhan merged 2 commits intomainfrom
copilot/add-timeout-strict-mode
Nov 26, 2025
Merged

Add timeout and strict mode configuration to 8 workflows#4861
pelikhan merged 2 commits intomainfrom
copilot/add-timeout-strict-mode

Conversation

Copy link
Contributor

Copilot AI commented Nov 26, 2025

8 workflows lacked timeout protection, risking runaway costs. Added timeout-minutes and strict: true based on workflow complexity.

Changes

  • 5 min: Simple workflows (dev, example-permissions-warning, issue-triage-agent, notion-issue-summary)
  • 10 min: Standard complexity (ai-triage-campaign, daily-team-status)
  • 15 min: Complex analysis (github-mcp-structural-analysis)
  • 20 min: Data-intensive reporting (weekly-issue-summary)

Example

---
timeout-minutes: 10
strict: true
on:
  schedule:
    - cron: "0 14 * * 1-5"
---

Workflows using Claude engine or requiring write permissions retain strict: false as expected.

Closes #458

Original prompt

This section details on the original issue you should resolve

<issue_title>[q] Add timeout and strict mode configuration to 8 workflows</issue_title>
<issue_description># Q Workflow Optimization Report

Issues Found (from live data)

Analysis Overview

Analyzed 90 workflows using live data from gh-aw logs MCP server (last 7 days):

  • Total runs: 5 workflows
  • Duration: 16.7 minutes
  • Tokens: 680,661
  • Cost: $0.62
  • Errors: 17
  • Warnings: 5
  • Missing tools: 0

Configuration Gaps

8 workflows missing timeout protection (Run IDs: 19709887493, 19703556391, 19703556386):

  • ai-triage-campaign.md
  • daily-team-status.md
  • dev.md
  • example-permissions-warning.md
  • github-mcp-structural-analysis.md
  • issue-triage-agent.md
  • notion-issue-summary.md
  • weekly-issue-summary.md

Risk: Workflows can run indefinitely, incurring unexpected costs.


Changes Made

Added timeout and strict mode to 8 workflows. Set timeouts based on complexity:

  • 5-10 min: Simple/standard workflows
  • 15 min: Complex analysis
  • 20 min: Data-intensive reporting

All workflows compiled successfully. Lock files excluded (will regenerate after merge).


Expected Improvements

  1. Cost Protection: Timeout guards prevent runaway costs
  2. Better Validation: Strict mode catches errors at compile-time
  3. Appropriate Limits: Timeouts match workflow complexity

Validation

✅ All 8 workflows compiled successfully with gh-aw MCP server

References

  • Log location: /tmp/gh-aw/aw-mcp/logs/
  • Run IDs: 19709887493, 19709824777, 19703556391, 19703556386, 19692858223

AI generated by Q


[!NOTE]
This was originally intended as a pull request, but the git push operation failed.

Workflow Run: View run details and download patch artifact

The patch file is available as an artifact (aw.patch) in the workflow run linked above.
To apply the patch locally:

# Download the artifact from the workflow run https://github.com/githubnext/gh-aw/actions/runs/19709858993
# (Use GitHub MCP tools if gh CLI is not available)
gh run download 19709858993 -n aw.patch
# Apply the patch
git am aw.patch
Show patch preview (134 of 134 lines)
From 655b567f7edfc90ed2b7c07f6a055d4e20e6c4fd Mon Sep 17 00:00:00 2001
From: Q Workflow Optimizer <q@github-agentic-workflows.local>
Date: Wed, 26 Nov 2025 16:13:01 +0000
Subject: [PATCH] Add timeout and strict mode to 8 workflows

- Add timeout-minutes to prevent runaway costs
- Enable strict mode for better validation
- Set appropriate timeouts based on workflow complexity

Workflows modified:
- ai-triage-campaign.md
- daily-team-status.md
- dev.md
- example-permissions-warning.md
- github-mcp-structural-analysis.md
- issue-triage-agent.md
- notion-issue-summary.md
- weekly-issue-summary.md
---
 .github/workflows/ai-triage-campaign.md             | 2 ++
 .github/workflows/daily-team-status.md              | 2 ++
 .github/workflows/dev.md                            | 2 ++
 .github/workflows/example-permissions-warning.md    | 1 +
 .github/workflows/github-mcp-structural-analysis.md | 1 +
 .github/workflows/issue-triage-agent.md             | 2 ++
 .github/workflows/notion-issue-summary.md           | 1 +
 .github/workflows/weekly-issue-summary.md           | 2 ++
 8 files changed, 13 insertions(+)

diff --git a/.github/workflows/ai-triage-campaign.md b/.github/workflows/ai-triage-campaign.md
index 7e4430f..5e61c31 100644
--- a/.github/workflows/ai-triage-campaign.md
+++ b/.github/workflows/ai-triage-campaign.md
@@ -20,6 +20,8 @@ permissions:
   contents: read
   issues: read
 
+timeout-minutes: 15
+strict: true
 engine: copilot
 tools:
   github:
diff --git a/.github/workflows/daily-team-status.md b/.github/workflows/daily-team-status.md
index e8bab8d..e509529 100644
--- a/.github/workflows/daily-team-status.md
+++ b/.github/workflows/daily-team-status.md
@@ -9,6 +9,8 @@ permissions:
   issues: read
   pull-requests: read
 tracker-id: daily-team-status
+timeout-minutes: 10
+strict: true
 network: defaults
 imports:
 - githubnext/agentics/workflows/shared/reporting.md@d3422bf940923ef1d43db5559652b8e1e71869f3
diff --git a/.github/workflows/dev.md b/.github/workflows/
... (truncated)

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


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Added timeout-minutes and strict mode to:
- ai-triage-campaign.md: timeout-minutes: 10, strict: true
- daily-team-status.md: timeout-minutes: 10, strict: true
- dev.md: timeout-minutes: 5, strict: false (dev/test workflow)
- example-permissions-warning.md: timeout-minutes: 5 (strict: false already)
- github-mcp-structural-analysis.md: timeout-minutes: 15 (strict: false already)
- issue-triage-agent.md: timeout-minutes: 5, strict: true
- notion-issue-summary.md: timeout-minutes: 5 (strict: true already)
- weekly-issue-summary.md: timeout-minutes: 20, strict: true

Timeouts set based on workflow complexity:
- 5 min: Simple/standard workflows
- 10-15 min: Complex analysis
- 20 min: Data-intensive reporting

Closes #458

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add timeout and strict mode configuration to 8 workflows Add timeout and strict mode configuration to 8 workflows Nov 26, 2025
Copilot AI requested a review from pelikhan November 26, 2025 17:41
@pelikhan pelikhan marked this pull request as ready for review November 26, 2025 17:45
Copilot AI review requested due to automatic review settings November 26, 2025 17:45
@pelikhan pelikhan merged commit e6549d0 into main Nov 26, 2025
4 checks passed
@pelikhan pelikhan deleted the copilot/add-timeout-strict-mode branch November 26, 2025 17: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 adds timeout protection and strict mode configuration to 8 workflows that previously lacked these safeguards. The changes aim to prevent runaway costs by enforcing execution time limits and enabling stricter validation during compilation.

Key changes:

  • Added timeout-minutes to 8 workflows with values ranging from 5-20 minutes based on complexity
  • Added or retained strict: true for workflows using Copilot engine
  • Retained strict: false for workflows using Claude engine or requiring write permissions
  • Updated corresponding .lock.yml files to reflect the timeout changes

Reviewed changes

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

Show a summary per file
File Description
.github/workflows/ai-triage-campaign.md Added 10-minute timeout and strict mode for issue triage workflow
.github/workflows/ai-triage-campaign.lock.yml Updated compiled workflow with 10-minute timeout
.github/workflows/daily-team-status.md Added 10-minute timeout and strict mode for daily status reporting
.github/workflows/daily-team-status.lock.yml Updated compiled workflow with 10-minute timeout
.github/workflows/dev.md Added 5-minute timeout with strict: false for experimental Claude engine testing
.github/workflows/dev.lock.yml Updated compiled workflow with 5-minute timeout
.github/workflows/example-permissions-warning.md Added 5-minute timeout for example/demo workflow
.github/workflows/example-permissions-warning.lock.yml Updated compiled workflow with 5-minute timeout
.github/workflows/github-mcp-structural-analysis.md Added 15-minute timeout for complex structural analysis workflow
.github/workflows/github-mcp-structural-analysis.lock.yml Updated compiled workflow with 15-minute timeout
.github/workflows/issue-triage-agent.md Added 5-minute timeout and strict mode for simple triage automation
.github/workflows/issue-triage-agent.lock.yml Updated compiled workflow with 5-minute timeout
.github/workflows/notion-issue-summary.md Added 5-minute timeout for Notion integration workflow
.github/workflows/notion-issue-summary.lock.yml Updated compiled workflow with 5-minute timeout
.github/workflows/weekly-issue-summary.md Added 20-minute timeout and strict mode for data-intensive weekly reporting

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

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

@@ -1,4 +1,6 @@
---
Copy link

Copilot AI Nov 26, 2025

Choose a reason for hiding this comment

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

[nitpick] Inconsistent placement of timeout-minutes and strict fields. In this workflow, they are placed at the very top of the frontmatter, while in other workflows in this PR (e.g., ai-triage-campaign.md, weekly-issue-summary.md), they are placed after the description field.

For consistency across all 8 workflows, consider using a consistent ordering pattern. The recommended order based on the schema documentation would be:

---
description: ...
timeout-minutes: 5
strict: true
on:
  ...
Suggested change
---
---
description: List open issues with no labels and add appropriate labels.

Copilot uses AI. Check for mistakes.
Comment on lines +2 to +3
timeout-minutes: 10
strict: true
Copy link

Copilot AI Nov 26, 2025

Choose a reason for hiding this comment

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

[nitpick] Inconsistent placement of timeout-minutes and strict fields. In this workflow, they are placed at the very top of the frontmatter, while in other workflows in this PR (e.g., ai-triage-campaign.md, weekly-issue-summary.md), they are placed after the description or name fields.

For consistency across all 8 workflows, consider using a consistent ordering pattern. The recommended order based on the schema documentation would be:

---
description: ...
timeout-minutes: 10
strict: true
on:
  ...

Copilot uses AI. Check for mistakes.
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.

[q] Add timeout and strict mode configuration to 8 workflows

2 participants