Skip to content

Reduce Pelis Advisor AI credit burn with fixed low-cost model + turn cap#5166

Merged
lpcox merged 3 commits into
mainfrom
copilot/aw-increase-ai-credits-limit-again
Jun 17, 2026
Merged

Reduce Pelis Advisor AI credit burn with fixed low-cost model + turn cap#5166
lpcox merged 3 commits into
mainfrom
copilot/aw-increase-ai-credits-limit-again

Conversation

Copilot AI commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

The Pelis Agent Factory Advisor workflow intermittently aborted due to the max-ai-credits guardrail before completing useful analysis. This change tightens its execution budget by pinning a cheaper model and limiting turn count so scheduled runs stay within credits.

  • Workflow budget controls (source of truth)

    • Updated .github/workflows/pelis-agent-factory-advisor.md to explicitly constrain runtime:
      • engine.model: claude-haiku-4.5
      • max-turns: 4
  • Compiled workflow parity

    • Updated .github/workflows/pelis-agent-factory-advisor.lock.yml so runtime env matches frontmatter intent:
      • GH_AW_INFO_MODEL: claude-haiku-4.5
      • COPILOT_MODEL: claude-haiku-4.5
      • GH_AW_MAX_TURNS: 4
  • Regression guard for future edits

    • Added scripts/ci/pelis-agent-factory-advisor-workflow.test.ts to enforce that both source and lock workflow keep the low-cost model + turn cap configuration.
# .github/workflows/pelis-agent-factory-advisor.md
max-turns: 4
engine:
  id: copilot
  model: claude-haiku-4.5

Copilot AI changed the title [WIP] Update max-ai-credits in Pelis Agent Factory Advisor Reduce Pelis Advisor AI credit burn with fixed low-cost model + turn cap Jun 17, 2026
Copilot finished work on behalf of lpcox June 17, 2026 15:16
Copilot AI requested a review from lpcox June 17, 2026 15:16
@lpcox lpcox marked this pull request as ready for review June 17, 2026 15:35
Copilot AI review requested due to automatic review settings June 17, 2026 15:35
@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 97.30% 97.61% 📈 +0.31%
Statements 97.16% 97.53% 📈 +0.37%
Functions 98.84% 98.84% ➡️ +0.00%
Branches 91.93% 92.96% 📈 +1.03%
📁 Per-file Coverage Changes (4 files)
File Lines (Before → After) Statements (Before → After)
src/workdir-setup.ts 92.7% → 94.5% (+1.82%) 92.7% → 94.5% (+1.82%)
src/logs/audit-enricher.ts 89.4% → 95.7% (+6.38%) 83.6% → 95.1% (+11.48%)
src/services/agent-volumes/docker-host-staging.ts 87.2% → 95.7% (+8.51%) 87.8% → 95.9% (+8.16%)
src/commands/validators/log-and-limits.ts 90.3% → 100.0% (+9.68%) 90.3% → 100.0% (+9.68%)

Coverage comparison generated by scripts/ci/compare-coverage.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Not ready to approve

The new regression test should also assert GH_AW_INFO_MODEL (and a minor lock-file formatting consistency issue should be addressed) to fully prevent configuration drift.

Pull request overview

This PR reduces AI credit consumption for the “Pelis Agent Factory Advisor” scheduled workflow by pinning a lower-cost Copilot model and enforcing a small turn budget, and adds a CI regression test to keep the source and compiled lock workflow in sync.

Changes:

  • Pins the workflow engine model to claude-haiku-4.5 and caps execution to max-turns: 4 in the source workflow frontmatter.
  • Updates the compiled lock workflow to use claude-haiku-4.5 and GH_AW_MAX_TURNS: 4 at runtime.
  • Adds a Jest regression test to assert the model/turn-budget constraints remain enforced.
File summaries
File Description
scripts/ci/pelis-agent-factory-advisor-workflow.test.ts Adds a regression test that verifies the source + lock workflow keep the low-cost model and turn cap.
.github/workflows/pelis-agent-factory-advisor.md Updates workflow frontmatter to cap turns and pin the Copilot model.
.github/workflows/pelis-agent-factory-advisor.lock.yml Aligns the compiled workflow runtime env with the pinned model and turn budget.

Copilot's findings

  • Files reviewed: 3/3 changed files
  • Comments generated: 2

Note

Your feedback helps us improve the quality of this feature.
Please use 👍 or 👎 to tell us whether this assessment is correct.


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

Comment on lines +16 to +20
it('compiles model and turn budget into lock workflow', () => {
const lock = fs.readFileSync(lockPath, 'utf-8');

expect(lock).toContain('COPILOT_MODEL: claude-haiku-4.5');
expect(lock).toContain('GH_AW_MAX_TURNS: 4');
Comment thread .github/workflows/pelis-agent-factory-advisor.lock.yml Outdated
@lpcox

lpcox commented Jun 17, 2026

Copy link
Copy Markdown
Collaborator

@copilot address review feedback

Copilot AI commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

@copilot address review feedback

Addressed in eba012f.

@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Contribution Check failed. Please review the logs for details.

@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

🔑 Smoke Copilot PAT PAT auth validated. All systems operational. ✅

@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK AOAI (api-key) completed. Copilot AOAI BYOK (api-key) mode operational. 🔓

@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Smoke Claude failed

@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK AOAI (Entra) completed. Copilot AOAI BYOK (Entra) mode operational. 🔓

Smoke test summary comment posted and label added: FAIL

@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Security Guard has started processing this pull request

@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Build Test Suite completed successfully!

@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded.

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Copilot BYOK — PASS ✅

  • ✅ GitHub MCP: Connected
  • ✅ HTTP/HTTPS: github.com reachable (200)
  • ✅ File I/O: Read/write working
  • ✅ BYOK Inference: Direct mode via api-proxy → api.githubcopilot.com

Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY via api-proxy sidecar). All tests passed.

🔑 BYOK report filed by Smoke Copilot BYOK

@github-actions

Copy link
Copy Markdown
Contributor

🔬 Smoke Test Results

PR: Reduce Pelis Advisor AI credit burn with fixed low-cost model + turn cap
Author: @Copilot | Assignees: @lpcox, @Copilot

Test Result
GitHub MCP connectivity
GitHub.com HTTP connectivity ❓ (pre-step output not substituted)
File write/read ❓ (pre-step output not substituted)

Overall: FAIL — pre-computed step outputs were not substituted (template variables unresolved).

📰 BREAKING: Report filed by Smoke Copilot

@github-actions

Copy link
Copy Markdown
Contributor

PR titles:

  • [Test Coverage] Add branch coverage for audit-enricher, log-and-limits, docker-host-staging
  • feat(api-proxy): forward COPILOT_INTEGRATION_ID from host env

Results:

  • GitHub reads: ✅
  • GitHub title check: ✅
  • File write/read: ✅
  • Discussion lookup/comment: ✅
  • Build: ❌ (npm ci failed: node not found)

Overall: FAIL

🔮 The oracle has spoken through Smoke Codex

@github-actions

Copy link
Copy Markdown
Contributor

🔍 Smoke Test Results — Auth mode: PAT (COPILOT_GITHUB_TOKEN)

Test Result
GitHub MCP connectivity ✅ Pass
GitHub.com HTTP connectivity ❌ Unknown (pre-step outputs not expanded)
File write/read ❌ Unknown (pre-step outputs not expanded)

Overall: FAIL — pre-step smoke-data outputs were not substituted (template variables unexpanded), so HTTP and file tests cannot be verified.

PR: "Reduce Pelis Advisor AI credit burn with fixed low-cost model + turn cap" · @lpcox @Copilot

🔑 PAT report filed by Smoke Copilot PAT

@github-actions

Copy link
Copy Markdown
Contributor

@lpcox @Copilot
Reduce Pelis Advisor AI credit burn with fixed low-cost model + turn cap
✅ GitHub MCP
✅ GitHub.com HTTP
✅ File I/O
✅ BYOK inference
Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw)
Status: PASS

🔑 BYOK (AOAI api-key) report filed by Smoke Copilot BYOK AOAI (api-key)

@github-actions

Copy link
Copy Markdown
Contributor

🔬 Smoke Test: API Proxy OpenTelemetry Tracing

Scenario Status Notes
1. Module Loading ✅ Pass otel.js loads; exports: startRequestSpan, setTokenAttributes, setBudgetAttributes, endSpan, endSpanError, shutdown, isEnabled
2. Test Suite ✅ Pass 59/59 tests passed across 2 suites (otel.test.js, otel-fanout.test.js)
3. Env Var Forwarding ✅ Pass api-proxy-service-config.ts forwards GH_AW_OTLP_ENDPOINTS, OTEL_EXPORTER_OTLP_ENDPOINT, OTEL_EXPORTER_OTLP_HEADERS, GITHUB_AW_OTEL_TRACE_ID, GITHUB_AW_OTEL_PARENT_SPAN_ID, OTEL_SERVICE_NAME
4. Token Tracker Integration ✅ Pass onUsage callback exists in token-tracker-http.js (line 283/324) as the OTEL hook point
5. OTEL Diagnostics ✅ Pass FileSpanExporter (fallback to /var/log/api-proxy/otel.jsonl) verified working in tests; ProxyAwareOtlpExporter routes through Squid

All 5 scenarios passed. OTEL tracing integration is fully functional in the api-proxy sidecar.

📡 OTel tracing validated by Smoke OTel Tracing

@github-actions

Copy link
Copy Markdown
Contributor

Chroot Smoke Test Results

Runtime Host Version Chroot Version Match?
Python Python 3.12.13 Python 3.12.3 ❌ NO
Node.js v24.16.0 v22.22.3 ❌ NO
Go go1.22.12 go1.22.12 ✅ YES

Overall: ❌ Not all tests passed — Python and Node.js versions differ between host and chroot environments.

Tested by Smoke Chroot

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test Results

Check Result
Redis PING ❌ (no response)
PostgreSQL pg_isready ❌ (no response)
PostgreSQL SELECT 1 ❌ (no response)

Overall: FAILhost.docker.internal is not reachable from this runner. Service containers appear unavailable.

🔌 Service connectivity validated by Smoke Services

@github-actions

Copy link
Copy Markdown
Contributor

@Copilot @lpcox

  • GitHub MCP connectivity: ✅
  • GitHub.com connectivity: ✅
  • File write/read test: ❌
  • Direct BYOK inference: ✅
    Running in direct BYOK mode (AWF_AUTH_TYPE=github-oidc + AWF_AUTH_AZURE_* + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw) authenticated via Microsoft Entra
    Overall: FAIL

🪪 BYOK (AOAI Entra) report filed by Smoke Copilot BYOK AOAI (Entra)

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test Results

  • GitHub MCP Testing: ✅
    • [Test Coverage] Add branch coverage for audit-enricher, log-and-limits, docker-host-staging
    • feat(api-proxy): forward COPILOT_INTEGRATION_ID from host env
  • GitHub.com Connectivity: ✅ (200)
  • File Writing Testing: ✅
  • Bash Tool Testing: ✅

Overall status: PASS

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • localhost

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "localhost"

See Network Configuration for more information.

💎 Faceted by Smoke Gemini

@github-actions

Copy link
Copy Markdown
Contributor

🏗️ Build Test Suite Results

Ecosystem Project Build/Install Tests Status
Bun elysia 1/1 passed ✅ PASS
Bun hono 1/1 passed ✅ PASS
C++ fmt N/A ✅ PASS
C++ json N/A ✅ PASS
Deno oak N/A 1/1 passed ✅ PASS
Deno std N/A 1/1 passed ✅ PASS
.NET hello-world N/A ✅ PASS
.NET json-parse N/A ✅ PASS
Go color passed ✅ PASS
Go env passed ✅ PASS
Go uuid passed ✅ PASS
Java gson 1/1 passed ✅ PASS
Java caffeine 1/1 passed ✅ PASS
Node.js clsx passed ✅ PASS
Node.js execa passed ✅ PASS
Node.js p-limit passed ✅ PASS
Rust fd 1/1 passed ✅ PASS
Rust zoxide 1/1 passed ✅ PASS

Overall: 8/8 ecosystems passed — ✅ PASS

Generated by Build Test Suite for issue #5166 ·

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants