Skip to content

docs: add Cost Management reference page#20078

Merged
pelikhan merged 5 commits intomainfrom
copilot/add-cost-reference-page-aws
Mar 8, 2026
Merged

docs: add Cost Management reference page#20078
pelikhan merged 5 commits intomainfrom
copilot/add-cost-reference-page-aws

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 8, 2026

No existing documentation explained the cost model for running agentic workflows — how charges accumulate, which triggers are expensive, or how to reduce spend.

New page: reference/cost-management

  • Cost components — Actions minutes (detection job + agent job, each with ~1.5 min runner setup overhead) plus provider inference billing; Copilot charges are drawn from the COPILOT_GITHUB_TOKEN owner's premium request quota
  • Trigger risk table — rates push, check_run, and issues as high-frequency/high-cost; schedule and workflow_dispatch as predictable/low-risk
  • Cost reduction strategiesskip-if-match/skip-if-no-match to bypass the agent job entirely, lighter model selection (gpt-4.1-mini, claude-haiku-4-5), prompt/context scoping, rate-limit, and schedule-based runs using fuzzy syntax (daily on weekdays)
  • Agentic cost optimization — a meta-agent pattern using the agentic-workflows MCP tool (logs + audit) to self-inspect running workflows, identify expensive or inefficient ones, and apply targeted optimizations (model downgrade, tighter skip conditions, rate limits, trigger changes); includes a signal-to-action table
  • Scenario estimates — rough monthly Actions minutes and premium-request figures for four representative patterns (weekly digest, issue triage, per-push PR review, on-demand slash command)
  • Sidebar — added "Cost Management" entry in astro.config.mjs between Concurrency and Copilot Agent Files
  • Related Documentation — added link to GH-AW as an MCP Server for the agentic-workflows tool reference

Custom agent used: technical-doc-writer
AI technical documentation writer for GitHub Actions library using GitHub Docs voice

Original prompt

Add a reference page on cost of running if AWs.

  • the cost is the sum of Actions minutes + inference cost (from inference provider ). copilot is billed to the owner of COPILOT_GITHUB_TOKEN
  • agent + detection, 2 agent runs

The rest is really up to the user decide how often and how much context to handle. Certain events like checks, push, issues, can be dangerous because they happen at high frequency. Schedules are more predictable.

Select cheaper models for AW also reduces cogs.

Use skip-if-match and other deterministic checks to shortcut agentic phase.

document costs of common scenarios

Custom agent used: technical-doc-writer
AI technical documentation writer for GitHub Actions library using GitHub Docs voice


💡 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] Add reference page on cost of running in AWS docs: add Cost Management reference page Mar 8, 2026
Copy link
Copy Markdown
Collaborator

@pelikhan pelikhan left a comment

Choose a reason for hiding this comment

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

@copilot there is currently a 1.5min overhead of setup in AW.

The "logs" command shows aggregates

| Pre-activation / detection | Validates the trigger, runs membership checks, evaluates `skip-if-match` conditions | 10–30 seconds |
| Agent | Runs the AI engine and executes tools | 1–15 minutes |

Detection runs on every trigger regardless of whether the agent job proceeds, so high-frequency triggers multiply Actions minutes quickly even when the agent is skipped.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@copilot not true, remove sentence

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed in 57bf9a0. Replaced with a note about the ~1.5min runner setup overhead per job (to incorporate the PR-level feedback as well).

```aw wrap
on:
schedule:
- cron: '0 9 * * 1' # Monday 9 AM UTC
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@copilot use "daily on weekdays" syntax

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated to schedule: daily on weekdays in 57bf9a0.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 8, 2026

@copilot there is currently a 1.5min overhead of setup in AW.

The "logs" command shows aggregates

Added a note about the ~1.5min runner setup overhead per job in 57bf9a0. The TIP already described gh aw logs as showing "aggregate metrics across recent runs" — kept that wording as it matched your description.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • telemetry.astro.build
    • Triggering command: /opt/hostedtoolcache/node/24.14.0/x64/bin/node node /home/REDACTED/work/gh-aw/gh-aw/docs/node_modules/.bin/astro build (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@pelikhan
Copy link
Copy Markdown
Collaborator

pelikhan commented Mar 8, 2026

@copilot add section on Agentic cost optimization. AW can be inspected and optimization automatically by socialized agents that aim at reducing AW overall cost.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 8, 2026

@copilot add section on Agentic cost optimization. AW can be inspected and optimization automatically by socialized agents that aim at reducing AW overall cost.

Added in 8cea974 — new Agentic Cost Optimization section that explains how a scheduled meta-agent can use the agentic-workflows MCP tool (logs + audit) to identify expensive workflows and open PRs with targeted optimizations (model downgrade, tighter skip conditions, rate limits, trigger changes). Also includes a signal-to-action table and an example workflow skeleton.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • telemetry.astro.build
    • Triggering command: /opt/hostedtoolcache/node/24.14.0/x64/bin/node node /home/REDACTED/work/gh-aw/gh-aw/docs/node_modules/.bin/astro build tion instructio (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

2. Deep-dive into individual runs with the `audit` tool (equivalent to `gh aw audit <run-id>`).
3. Propose or directly apply frontmatter changes (cheaper model, tighter `skip-if-match`, lower `rate-limit`) via a pull request.

### Example Optimizer Workflow
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@copilot remove this example

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed in 262d00f. The "How It Works" description and the "What to Optimize Automatically" signal-to-action table are retained; only the example frontmatter block and its surrounding prose were deleted.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 8, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • telemetry.astro.build
    • Triggering command: /opt/hostedtoolcache/node/24.14.0/x64/bin/node node /home/REDACTED/work/gh-aw/gh-aw/docs/node_modules/.bin/astro build tion instructio (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@pelikhan pelikhan marked this pull request as ready for review March 8, 2026 16:31
Copilot AI review requested due to automatic review settings March 8, 2026 16:31
Copy link
Copy Markdown
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

Adds a new reference page describing how costs accumulate when running GitHub Agentic Workflows, and links it from the docs sidebar so it’s discoverable.

Changes:

  • Introduces a new reference/cost-management page covering cost components, trigger risk, reduction strategies, and scenario-based estimates.
  • Adds “Cost Management” to the Reference section of the Starlight sidebar.

Reviewed changes

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

File Description
docs/src/content/docs/reference/cost-management.md New documentation page explaining cost drivers and optimization approaches for agentic workflows.
docs/astro.config.mjs Adds the new page to the Reference sidebar navigation.

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

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +14 to +19
Every workflow job consumes Actions compute time billed at standard [GitHub Actions pricing](https://docs.github.com/en/billing/managing-billing-for-your-products/managing-billing-for-github-actions/about-billing-for-github-actions). A typical agentic workflow run includes at least two jobs:

| Job | Purpose | Typical duration |
|-----|---------|-----------------|
| Pre-activation / detection | Validates the trigger, runs membership checks, evaluates `skip-if-match` conditions | 10–30 seconds |
| Agent | Runs the AI engine and executes tools | 1–15 minutes |
Copy link

Copilot AI Mar 8, 2026

Choose a reason for hiding this comment

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

The job breakdown here doesn’t match the documented compiled workflow structure. In reference/compilation-process.md the core jobs are activation (always) and agent (always), pre_activation is conditional, and detection only exists when safe-outputs.threat-detection is enabled. Consider updating the text/table to reflect the actual job names and which jobs are always present vs optional (and avoid combining pre-activation and detection into one row).

Suggested change
Every workflow job consumes Actions compute time billed at standard [GitHub Actions pricing](https://docs.github.com/en/billing/managing-billing-for-your-products/managing-billing-for-github-actions/about-billing-for-github-actions). A typical agentic workflow run includes at least two jobs:
| Job | Purpose | Typical duration |
|-----|---------|-----------------|
| Pre-activation / detection | Validates the trigger, runs membership checks, evaluates `skip-if-match` conditions | 10–30 seconds |
| Agent | Runs the AI engine and executes tools | 1–15 minutes |
Every workflow job consumes Actions compute time billed at standard [GitHub Actions pricing](https://docs.github.com/en/billing/managing-billing-for-your-products/managing-billing-for-github-actions/about-billing-for-github-actions). A typical agentic workflow run includes at least two core jobs, with additional optional jobs depending on your configuration:
| Job | Purpose | Typical duration |
|-----|---------|-----------------|
| `activation` | Validates the trigger, runs membership checks, evaluates `skip-if-match` conditions | 10–30 seconds |
| `agent` | Runs the AI engine and executes tools | 1–15 minutes |
| `pre_activation` (optional) | Runs custom pre-activation logic you define in the workflow | Varies (usually seconds) |
| `detection` (optional) | Runs safe-outputs threat detection when `safe-outputs.threat-detection` is enabled | 10–60 seconds |

Copilot uses AI. Check for mistakes.
Scheduled workflows fire at a fixed cadence, making cost easy to estimate and cap:

```aw wrap
schedule: daily on weekdays
Copy link

Copilot AI Mar 8, 2026

Choose a reason for hiding this comment

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

This schedule example uses a top-level schedule: key, but the trigger syntax elsewhere in the docs uses on: schedule: … (see reference/triggers.md and reference/schedule-syntax.md). To avoid confusing readers, align this snippet with the documented trigger/frontmatter format.

Suggested change
schedule: daily on weekdays
on:
schedule: daily on weekdays

Copilot uses AI. Check for mistakes.
Comment on lines +148 to +154
These are rough estimates to help with budgeting. Actual costs vary by prompt size, tool usage, model, and provider pricing.

| Scenario | Frequency | Actions minutes/month | Inference/month |
|----------|-----------|----------------------|-----------------|
| Weekly digest (schedule, 1 repo) | 4×/month | ~1 min | ~4–8 premium requests (Copilot) |
| Issue triage (issues opened, 20/month) | 20×/month | ~10 min | ~20–40 premium requests |
| PR review on every push (busy repo, 100 pushes/month) | 100×/month | ~100 min | ~100–200 premium requests |
Copy link

Copilot AI Mar 8, 2026

Choose a reason for hiding this comment

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

The Actions minutes estimates in this table appear inconsistent with the earlier statement that each job incurs ~1.5 minutes of runner setup overhead (and with workflows typically having multiple jobs beyond just the agent). For example, 4 runs/month would generally exceed ~1 minute/month even before agent execution. Please clarify the assumptions (e.g., whether setup/auxiliary jobs are excluded) or adjust the estimates to be internally consistent.

Suggested change
These are rough estimates to help with budgeting. Actual costs vary by prompt size, tool usage, model, and provider pricing.
| Scenario | Frequency | Actions minutes/month | Inference/month |
|----------|-----------|----------------------|-----------------|
| Weekly digest (schedule, 1 repo) | 4×/month | ~1 min | ~4–8 premium requests (Copilot) |
| Issue triage (issues opened, 20/month) | 20×/month | ~10 min | ~20–40 premium requests |
| PR review on every push (busy repo, 100 pushes/month) | 100×/month | ~100 min | ~100–200 premium requests |
These are rough estimates to help with budgeting. Actual costs vary by prompt size, tool usage, model, and provider pricing. Estimates include runner setup overhead (~1.5 minutes per job) and both the pre-activation and agent jobs.
| Scenario | Frequency | Actions minutes/month | Inference/month |
|----------|-----------|----------------------|-----------------|
| Weekly digest (schedule, 1 repo) | 4×/month | ~10 min | ~4–8 premium requests (Copilot) |
| Issue triage (issues opened, 20/month) | 20×/month | ~30 min | ~20–40 premium requests |
| PR review on every push (busy repo, 100 pushes/month) | 100×/month | ~200 min | ~100–200 premium requests |

Copilot uses AI. Check for mistakes.
@pelikhan pelikhan merged commit a4807cc into main Mar 8, 2026
64 checks passed
@pelikhan pelikhan deleted the copilot/add-cost-reference-page-aws branch March 8, 2026 16:41
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.

3 participants