Skip to content

fix: normalize model name separators in AWF CLI validation#4908

Merged
lpcox merged 4 commits into
mainfrom
copilot/normalize-model-name-separators
Jun 13, 2026
Merged

fix: normalize model name separators in AWF CLI validation#4908
lpcox merged 4 commits into
mainfrom
copilot/normalize-model-name-separators

Conversation

Copilot AI commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

The AWF CLI rejected hyphenated model names (e.g. claude-haiku-4-5) at startup—before containers even start—while the api-proxy already handles this normalization transparently. This caused CI failures when switching engines without updating model name formatting.

Changes

  • src/copilot-model.ts

    • Adds normalizeSeparators() — replaces . and _ with -, mirroring containers/api-proxy/model-utils.js
    • Pre-builds NORMALIZED_TO_CANONICAL map (separator-normalized → canonical) and NORMALIZED_RETIRED_ALIASES map at module load
    • validateCopilotModel now falls through to a separator-normalized lookup when exact match fails, returning the canonical form as resolvedModel
  • src/copilot-model.test.ts — adds 7 tests covering hyphen, underscore, and uppercase variants; confirms retired aliases still reject correctly

validateCopilotModel('claude-haiku-4-5')  // → { valid: true, resolvedModel: 'claude-haiku-4.5' }
validateCopilotModel('claude_haiku_4_5')  // → { valid: true, resolvedModel: 'claude-haiku-4.5' }
validateCopilotModel('claude-haiku-4.5')  // → { valid: true, resolvedModel: 'claude-haiku-4.5' } (unchanged)

The existing normalization log in config-assembly.ts will surface the rewrite (e.g. Normalized COPILOT_MODEL value 'claude-haiku-4-5' -> 'claude-haiku-4.5') so users get visibility without a hard failure.

Apply separator normalization (. and _ -> -) to the AWF CLI model
validation path so both 'claude-haiku-4-5' and 'claude-haiku-4.5'
are accepted and resolved to the canonical form 'claude-haiku-4.5'.

This mirrors the existing tolerant behavior in the api-proxy's
model-utils.js / model-resolver.js. The fix also extends to
retired-alias lookups for consistency.

Closes #4907
Copilot AI changed the title [WIP] Normalize model name separators in AWF CLI fix: normalize model name separators in AWF CLI validation Jun 13, 2026
Copilot finished work on behalf of lpcox June 13, 2026 20:40
Copilot AI requested a review from lpcox June 13, 2026 20:40
@lpcox lpcox marked this pull request as ready for review June 13, 2026 20:43
Copilot AI review requested due to automatic review settings June 13, 2026 20:43
@github-actions

github-actions Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 96.62% 96.67% 📈 +0.05%
Statements 96.50% 96.54% 📈 +0.04%
Functions 98.79% 98.80% ➡️ +0.01%
Branches 91.22% 91.26% 📈 +0.04%
📁 Per-file Coverage Changes (1 files)
File Lines (Before → After) Statements (Before → After)
src/config-writer.ts 89.9% → 91.1% (+1.19%) 89.9% → 91.1% (+1.19%)

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

This PR updates AWF CLI Copilot model validation to accept model names where version/segment separators are provided as - or _, matching how the api-proxy already canonicalizes model identifiers. This prevents early CLI startup failures when users (or CI) supply hyphenated/underscored variants of otherwise-supported models.

Changes:

  • Add normalizeSeparators() and precomputed lookup maps to resolve separator-normalized inputs to canonical model names.
  • Extend validateCopilotModel() to fall back to separator-normalized matching after exact-match checks (while still rejecting retired aliases).
  • Add unit tests covering hyphen/underscore/uppercase variants and cross-model behavior.
Show a summary per file
File Description
src/copilot-model.ts Adds separator-normalized canonical lookup to accept hyphen/underscore variants and resolve to canonical model IDs.
src/copilot-model.test.ts Adds tests for the new normalization behavior and ensures retired aliases remain rejected.

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: 2

Comment thread src/copilot-model.ts
Comment thread src/copilot-model.test.ts Outdated
lpcox and others added 2 commits June 13, 2026 13:46
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Copilot BYOK (Direct Mode) — PASS ✅

  • ✅ GitHub MCP connectivity (PR data verified)
  • ✅ GitHub.com HTTP 200
  • ✅ File write/read test
  • ✅ BYOK inference path operational

Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY) via api-proxy → api.githubcopilot.com

CC: @lpcox @Copilot

🔑 BYOK report filed by Smoke Copilot BYOK

@github-actions

Copy link
Copy Markdown
Contributor

🔬 Smoke Test Results — PASS

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

PR: fix: normalize model name separators in AWF CLI validation
Author: @Copilot | Assignees: @lpcox @Copilot

Overall: PASS

📰 BREAKING: Report filed by Smoke Copilot

@github-actions

Copy link
Copy Markdown
Contributor

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 (Add interactive workflow designer agent): ✅
  • GitHub.com connectivity: ✅
  • File I/O in sandbox: ✅
  • BYOK inference: ✅

Overall: PASS

cc @lpcox @Copilot

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

@github-actions

Copy link
Copy Markdown
Contributor

Chroot Version Comparison Results

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

Overall: ❌ Not all versions match. Go matches, but Python and Node.js differ between host and chroot environments.

Tested by Smoke Chroot

@github-actions

Copy link
Copy Markdown
Contributor

Reviewed merged PRs: chore: recompile all workflows with gh-aw v0.79.6 build-test smoke-codex smoke-copilot smoke-copilot-byok smoke-copilot-byok-aoai-apikey smoke-copilot-byok-aoai-entra smoke-copilot-pat smoke-gemini
refactor: decompose writeConfigs into workdir-setup.ts + focused orchestrator
refactor: extract adapter-factory.js from proxy-utils.js
GitHub read ✅
Playwright ✅
File write ✅
Discussion ✅
Build ❌
Overall: FAIL

🔮 The oracle has spoken through Smoke Codex

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test Results

Check Result
Redis PING ❌ timeout
PostgreSQL pg_isready ❌ no response
PostgreSQL SELECT 1 ❌ unreachable

Overall: FAIL

host.docker.internal resolves to 172.17.0.1 but connections to both port 6379 (Redis) and 5432 (PostgreSQL) time out from inside the AWF sandbox — blocked by the agent container's iptables rules that drop traffic to database/cache ports.

🔌 Service connectivity validated by Smoke Services

@github-actions

Copy link
Copy Markdown
Contributor

🔬 Smoke Test: PAT Auth — FAIL

Test Result
GitHub MCP ✅ Connected (PR list fetched)
GitHub.com HTTP ⚠️ Pre-step data unavailable (template unresolved)
File Write/Read ⚠️ Pre-step data unavailable (template unresolved)

Overall: FAIL — pre-step outputs were not substituted (steps.smoke-data.outputs.* unexpanded)

Auth mode: PAT (COPILOT_GITHUB_TOKEN) | PR: "fix: normalize model name separators in AWF CLI validation" | Author: @Copilot | Assignees: @lpcox @Copilot

🔑 PAT report filed by Smoke Copilot PAT

@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

Generated by Build Test Suite for issue #4908 ·

@github-actions

Copy link
Copy Markdown
Contributor

@lpcox

Add interactive workflow designer agent

MCP: ✅ github.com: ✅ file I/O: ❌ BYOK: ✅

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)

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