Draft
Conversation
Agent-Logs-Url: https://github.com/githubnext/autoloop/sessions/a0cff281-ac21-4c37-a270-c1410ce4b382 Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Investigate cost control options for harnesses
Add cost-control deep-dive report
May 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Deep-dive report on cost-control possibilities for the harnesses Autoloop runs on (gh-aw + Copilot/Claude/Codex/Gemini engines): what levers exist today, what we use, and what to add to express
$/token budgets per iteration / day / week / month and to default to cheaper models.Changes
docs/cost-control.md(new): the report itself.engine.model,max-turns(claude),max-continuations(copilot),COPILOT_PROVIDER_MAX_*(BYOK),timeout-minutes,stop-after,concurrency,rate-limit,skip-if-match,safe-outputs.*.max, plusgh aw logs --json/gh aw auditfor measurementworkflows/autoloop.mduses today (onlyengine: copilot+timeout-minutes: 45)cost:frontmatter forprogram.md(per-iteration.max-{tokens,usd}+budget.{window,max-*,on-exceeded}), enforced scheduler-side by reading historical spend fromgh aw logs --json. Covers per-iteration / per-program / repo-wide / per-account scopes, distinguishing hard vs soft capsengine.model,concurrency,stop-after, and a per-program attribution key sogh aw logscan be grouped by program)AGENTS.md: link to the report from the Reference section.Key finding
gh-aw exposes no portable per-run
token-budget:knob — only Claude'smax-turnsand Copilot-BYOK'sCOPILOT_PROVIDER_MAX_*. Real$/week caps therefore have to be enforced by the Autoloop scheduler readinggh aw logs --jsonand refusing to schedule over-budget programs. The natural extension point isparse_program_frontmatterinworkflows/scripts/autoloop_scheduler.py, which would benefit from being refactored from its current 5-tuple return into a dataclass before adding acost_configfield.Documentation only; no behaviour change.
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:
github.github.com/home/REDACTED/work/_temp/ghcca-node/node/bin/node /home/REDACTED/work/_temp/ghcca-node/node/bin/node --enable-source-maps /home/REDACTED/work/_temp/copilot-developer-action-main/dist/index.js(dns block)If you need me to access, download, or install something from one of these locations, you can either: