Skip to content

Pin Duplicate Code Detector to priced Copilot model to avoid unknown-model AI credit failures#4942

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

Pin Duplicate Code Detector to priced Copilot model to avoid unknown-model AI credit failures#4942
lpcox merged 3 commits into
mainfrom
copilot/increase-ai-credits-limit

Conversation

Copilot AI commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Duplicate Code Detector intermittently failed under max-ai-credits because model selection could resolve to an unpriced/unknown model, which triggers AWF API-proxy rejection. This change hard-pins the workflow to a known priced model so AI credit enforcement remains deterministic.

  • Root-cause containment

    • Set explicit engine config in workflow source:
      • engine.id: copilot
      • engine.model: gpt-5.4-mini
    • Removes dependence on repo/org model vars for this workflow’s runtime model selection.
  • Compiled workflow sync

    • Updated the generated lockfile to reflect the same fixed model at runtime injection points:
      • GH_AW_INFO_MODEL
      • COPILOT_MODEL
      • GH_AW_ENGINE_MODEL
    • Refreshed frontmatter hash metadata accordingly.
  • Resulting behavior

    • Duplicate Code Detector now runs against a model present in pricing tables, preventing unknown_model_ai_credits aborts when max-ai-credits is active.
# .github/workflows/duplicate-code-detector.md
engine:
  id: copilot
  model: gpt-5.4-mini

Copilot AI changed the title [WIP] Update max-ai-credits in Duplicate Code Detector workflow Pin Duplicate Code Detector to priced Copilot model to avoid unknown-model AI credit failures Jun 14, 2026
Copilot finished work on behalf of lpcox June 14, 2026 17:15
Copilot AI requested a review from lpcox June 14, 2026 17:15
@lpcox lpcox marked this pull request as ready for review June 14, 2026 17:18
Copilot AI review requested due to automatic review settings June 14, 2026 17:18
@github-actions

Copy link
Copy Markdown
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 96.60% 96.64% 📈 +0.04%
Statements 96.47% 96.51% 📈 +0.04%
Functions 98.80% 98.80% ➡️ +0.00%
Branches 91.18% 91.21% 📈 +0.03%
📁 Per-file Coverage Changes (1 files)
File Lines (Before → After) Statements (Before → After)
src/workdir-setup.ts 92.6% → 94.4% (+1.85%) 92.6% → 94.4% (+1.85%)

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.

Pull request overview

Pins the Duplicate Code Detector agentic workflow to a known-priced Copilot model (gpt-5.4-mini) so runs remain deterministic and don’t intermittently fail under max-ai-credits due to unknown/unpriced model resolution.

Changes:

  • Add explicit engine.id / engine.model to .github/workflows/duplicate-code-detector.md.
  • Update .github/workflows/duplicate-code-detector.lock.yml runtime injection points (GH_AW_INFO_MODEL, COPILOT_MODEL, GH_AW_ENGINE_MODEL) to the pinned model.
  • Refresh lockfile metadata hash to match updated frontmatter.
Show a summary per file
File Description
.github/workflows/duplicate-code-detector.md Adds an explicit Copilot engine + fixed model to avoid model-selection drift under AI credit enforcement.
.github/workflows/duplicate-code-detector.lock.yml Syncs the compiled workflow’s model-related env vars (and metadata hash) to the pinned model.

Copilot's findings

Tip

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

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

Comment thread .github/workflows/duplicate-code-detector.lock.yml Outdated
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

@Copilot @lpcox

Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw)

  • GitHub MCP connectivity: ✅
  • GitHub.com connectivity: ✅
  • File write/read test: ✅
  • BYOK inference test: ✅

Overall: PASS

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

The compiler now correctly emits agent_model:gpt-5.4-mini in the
metadata header, consistent with other pinned-model workflows.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@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 1/1 passed ✅ PASS
Go env 1/1 passed ✅ PASS
Go uuid 1/1 passed ✅ PASS
Java gson 1/1 passed ✅ PASS
Java caffeine 1/1 passed ✅ PASS
Node.js clsx all passed ✅ PASS
Node.js execa all passed ✅ PASS
Node.js p-limit all passed ✅ PASS
Rust fd 1/1 passed ✅ PASS
Rust zoxide 1/1 passed ✅ PASS

Overall: 8/8 ecosystems passed — ✅ PASS

Environment Details
  • Bun 1.3.14
  • C++ GCC 13.3.0 / CMake
  • Deno 2.8.3
  • .NET 8.0 (net8.0)
  • Go 1.22.12
  • Java OpenJDK 21.0.11 (Temurin) / Maven 3.9.16
  • Node.js v22.22.3 / npm 10.9.8
  • Rust 1.96.0 / Cargo 1.96.0

Generated by Build Test Suite for issue #4942 ·

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test Results: Copilot BYOK (Direct Mode)

MCP Connectivity - GitHub API working
GitHub.com Connectivity - HTTP 200
File Write/Read - Verified
BYOK Inference Path - Active (agent → api-proxy → api.githubcopilot.com)

Status: PASS — Running in direct BYOK mode via COPILOT_PROVIDER_API_KEY

🔑 BYOK report filed by Smoke Copilot BYOK

@github-actions

Copy link
Copy Markdown
Contributor

🔬 Smoke Test Results — PR #4942

"Pin Duplicate Code Detector to priced Copilot model..."
Author: @Copilot | Assignees: @lpcox @Copilot

Test Result
GitHub MCP connectivity
GitHub.com HTTP connectivity ❌ (pre-step data unavailable — template vars unresolved)
File write/read ❌ (pre-step data unavailable — template vars unresolved)

Overall: FAIL — Pre-computed step outputs were not injected (raw ${{ }} expressions in task input).

📰 BREAKING: Report filed by Smoke Copilot

@github-actions

Copy link
Copy Markdown
Contributor

🔥 Smoke Test: Copilot PAT — PASS

Test Result
GitHub MCP connectivity
GitHub.com HTTP ✅ 200
File write/read

PR: Pin Duplicate Code Detector to priced Copilot model to avoid unknown-model AI credit failures
Author: @Copilot | Assignees: @lpcox @Copilot
Auth mode: PAT (COPILOT_GITHUB_TOKEN)

🔑 PAT report filed by Smoke Copilot PAT

@github-actions

Copy link
Copy Markdown
Contributor

PRs: Refactor OpenAI BYOK base URL parsing to reuse shared proxy URL normalization
PRs: refactor(api-proxy): split proxy-request.js into http-client.js and body-handler.js
GitHub MCP: ✅
SafeInputs GH CLI: ✅
Playwright: ✅
File write: ✅
Build: ✅
Overall: PASS

Warning

Firewall blocked 1 domain

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

  • registry.npmjs.org

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

network:
  allowed:
    - defaults
    - "registry.npmjs.org"

See Network Configuration for more information.

🔮 The oracle has spoken through Smoke Codex

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: GitHub Actions Services Connectivity

Check Result
Redis PING (host.docker.internal:6379) ❌ timeout
PostgreSQL pg_isready (host.docker.internal:5432) ❌ no response
PostgreSQL SELECT 1 (smoketest db) ❌ timeout

Overall: FAIL — Service containers are not reachable from this environment. Neither host.docker.internal (172.17.0.1) nor localhost responded on ports 6379 or 5432. Services may not be configured as job-level service containers in the workflow.

🔌 Service connectivity validated by Smoke Services

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Gemini Engine Validation

  • GitHub MCP Testing: ❌ (Tool not found)
  • GitHub.com Connectivity: ❌ (Blocked by Squid)
  • File Writing Testing: ✅
  • Bash Tool Testing: ✅

Overall Status: FAIL

Note: Only one PR found in shallow log:

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

@lpcox lpcox merged commit 069a247 into main Jun 14, 2026
100 of 124 checks passed
@lpcox lpcox deleted the copilot/increase-ai-credits-limit branch June 14, 2026 19:50
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