Skip to content

Split model resolver into focused modules - #11789

Merged
lpcox merged 4 commits into
mainfrom
copilot/refactor-split-model-resolver
Nov 19, 2026
Merged

lpcox merged 4 commits into
mainfrom
copilot/refactor-split-model-resolver

Conversation

@lpcox

@lpcox lpcox commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Model resolution mixed alias parsing, policy enforcement, parameter handling, and provider filtering, obscuring security-sensitive routing checks.

  • Module boundaries: Extract model-alias-config, model-policy, model-parameters, and model-provider-filter; retain resolution algorithms and recursive state in model-resolver.
  • Compatibility: Preserve existing exports and behavior. Inject resolution into provider filtering to avoid circular dependencies.
  • Packaging: Include the extracted modules in the API-proxy image.

…, and provider modules

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
@lpcox lpcox changed the title [WIP] Refactor model resolver into focused modules Split model resolver into focused modules Nov 18, 2026
@lpcox
lpcox marked this pull request as ready for review November 18, 2026 19:04
Copilot AI adaptive review requested due to automatic review settings November 18, 2026 19:04

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.

🟢 Approval recommended

No active review issues are recorded for the model-resolver refactor.

No open issues 🎉

What changed in this PR

Refactors the API proxy’s model resolver into focused modules, making routing policy easier to inspect while preserving existing exports and keeping recursive resolution state in model-resolver.

Changes:

  • Extracts alias configuration, policy checks, parameter handling, and provider filtering.
  • Injects resolution into provider filtering to avoid circular dependencies.
  • Adds focused unit tests and packages the extracted modules in the API-proxy image.
File Description
containers/​api-proxy/​model-resolver.js Delegates extracted responsibilities while retaining resolution algorithms and compatibility exports.
containers/​api-proxy/​model-provider-filter.test.js Tests resolver injection, catalogue filtering, and module-load compatibility.
containers/​api-proxy/​model-provider-filter.js Houses provider and resolvable-alias filtering.
containers/​api-proxy/​model-policy.test.js Tests allow/deny rules, retired models, and harness rejection tracking.
containers/​api-proxy/​model-policy.js Isolates policy and harness admission checks.
containers/​api-proxy/​model-parameters.test.js Tests suffix handling and non-mutating resolution updates.
containers/​api-proxy/​model-parameters.js Houses model parameter split, append, and apply helpers.
containers/​api-proxy/​model-fallback.js Imports and re-exports alias normalization from its new module.
containers/​api-proxy/​model-alias-config.test.js Tests alias parsing, normalization, and collision errors.
containers/​api-proxy/​model-alias-config.js Houses alias configuration parsing and normalization.
containers/​api-proxy/​Dockerfile Copies the four extracted modules into the image.

Review effort: Max (adaptive)

@github-actions

Copy link
Copy Markdown
Contributor

✅ Copilot review passed with no inline comments.

@lpcox Add the ready-for-aw label to this PR to trigger agentic CI smoke tests.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 94.33% 94.33% ➡️ +0.00%
Statements 92.94% 92.94% ➡️ +0.00%
Functions 93.53% 93.53% ➡️ +0.00%
Branches 87.20% 87.20% ➡️ +0.00%
📁 Per-file Coverage Changes (1 files)
File Lines (Before → After) Statements (Before → After)
src/commands/main-action-cleanup.ts 96.9% → 97.9% (+1.03%) 97.0% → 98.0% (+0.99%)

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

@lpcox

lpcox commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator Author

Copilot AI commented Nov 19, 2026

Copy link
Copy Markdown
Contributor

@copilot fix this failing ci check https://github.com/github/gh-aw-firewall/actions/runs/44375590118/job/135230726558?pr=11789

Updated .grype.yaml with exact-version exceptions for the Alpine OpenSSL 3.5.9-r1 findings reported by the scan. YAML/rule validation passed. Commit: 120bbc3. The new Supply Chain Scan run is action_required and has no jobs, so its scan result is still pending approval.

@lpcox
lpcox merged commit 7ff54ef into main Nov 19, 2026
37 of 39 checks passed
@lpcox
lpcox deleted the copilot/refactor-split-model-resolver branch November 19, 2026 14:47
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.

[Refactoring] Split containers/api-proxy/model-resolver.js into focused modules

3 participants