Skip to content

Refactor filtered model alias snapshots - #8818

Merged
lpcox merged 2 commits into
mainfrom
copilot/fix-duplicate-code-assembly
Sep 21, 2026
Merged

lpcox merged 2 commits into
mainfrom
copilot/fix-duplicate-code-assembly

Conversation

Copilot AI commented Sep 20, 2026 •

Copy link
Copy Markdown
Contributor

Model alias filtering and models.json assembly were repeated across API-proxy metadata paths, risking drift.

  • Shared snapshot helpers

    • Centralize configured-provider filtering in getFilteredModelAliases().
    • Centralize payload construction in buildModelsSnapshot().
  • Unified consumers

    • Reuse the filtered aliases for management reflection, buildModelsJson(), and writeModelsJson().
const { filteredAliases, modelsJson } = buildModelsSnapshot();
return _writeModelsJson(registeredAdapters, cachedModels, filteredAliases, logDir, modelsJson);
  • Coverage
    • Assert persisted models.json retains the same resolvable aliases as the in-memory model snapshot.

Copilot AI changed the title [WIP] Fix duplicate code in proxy server for model alias assembly Refactor filtered model alias snapshots Sep 20, 2026
Copilot AI requested a review from lpcox September 20, 2026 22:48
@lpcox
lpcox marked this pull request as ready for review September 20, 2026 23:44
Copilot AI balanced review requested due to automatic review settings September 20, 2026 23:44

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.

Copilot review overview

🟢 Approval recommended

The focused refactor removes duplication while preserving behavior and adding targeted coverage.

Review effort: Balanced
Findings: None

What changed in this PR

Centralizes filtered model-alias snapshot construction to keep API-proxy metadata consumers consistent.

Changes:

  • Adds shared alias-filtering and snapshot helpers.
  • Reuses snapshots across reflection, in-memory JSON, and persisted JSON.
  • Tests persisted and in-memory alias consistency.
File Description
containers/​api-proxy/​server.models.test.js Adds snapshot consistency coverage.
containers/​api-proxy/​server.js Centralizes filtered model snapshot assembly.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Copilot review passed with no inline comments.

@copilot 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 93.28% 93.29% 📈 +0.01%
Statements 91.95% 91.97% 📈 +0.02%
Functions 92.00% 92.00% ➡️ +0.00%
Branches 85.78% 85.79% 📈 +0.01%
📁 Per-file Coverage Changes (1 files)
File Lines (Before → After) Statements (Before → After)
src/log-directory-setup.ts 96.2% → 100.0% (+3.78%) 96.3% → 100.0% (+3.71%)

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

@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

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

Tested by Smoke Chroot

@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

📰 DEVELOPING STORY: Smoke Docker Sbx reports failed. Our correspondents are investigating the incident...

📰 BREAKING: Report filed by Smoke Docker Sbx

@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

❌ Smoke Gemini reports failed. Facets need polishing...

💎 Faceted by Smoke Gemini

@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅

📡 OTel tracing validated by Smoke OTel Tracing

@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

🛡️ Smoke Copilot Network Isolation confirmed the egress allowlist is enforced. ✅

Warning

Firewall blocked 1 domain

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

  • example.com

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

network:
  allowed:
    - defaults
    - "example.com"

See Network Configuration for more information.

🛡️ Egress verdict from Smoke Copilot Network Isolation

@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

🔌 Smoke Services — All services reachable! ✅

🔌 Service connectivity validated by Smoke Services

@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

✅ Security Guard completed successfully!

Security review complete: PR #8818 refactors API proxy model alias filtering logic. No security-weakening changes detected. Code deduplication preserves existing access controls, credential handling, and filtering behavior. Changes are isolated to containers/api-proxy/server.js (function extraction only). Passes security review.

Generated by Security Guard for #8818

@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

✅ Build Test Suite completed successfully!

Generated by Build Test Suite for #8818

@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

✅ Smoke Claude passed

Warning

Firewall blocked 1 domain

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

  • api.anthropic.com

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

network:
  allowed:
    - defaults
    - "api.anthropic.com"

See Network Configuration for more information.

Generated by Smoke Claude for #8818

@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

✅ Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓

🔑 BYOK report filed by Smoke Copilot BYOK

@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

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

Warning

Firewall blocked 7 domains

The following domains were blocked by the firewall during workflow execution:

  • accounts.google.com
  • clients2.google.com
  • contentautofill.googleapis.com
  • msfeed25.pkgs.visualstudio.com
  • update.googleapis.com
  • www.google.com
  • www.gstatic.com

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

network:
  allowed:
    - defaults
    - "accounts.google.com"
    - "clients2.google.com"
    - "contentautofill.googleapis.com"
    - "msfeed25.pkgs.visualstudio.com"
    - "update.googleapis.com"
    - "www.google.com"
    - "www.gstatic.com"

See Network Configuration for more information.

🔮 The oracle has spoken through Smoke Codex

@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

❌ Smoke Copilot BYOK AOAI (Entra) reports failed. AOAI BYOK (Entra) mode investigation needed...

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

@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

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

📰 BREAKING: Report filed by Smoke Copilot

@github-actions

github-actions Bot commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

❌ Smoke Copilot BYOK AOAI (api-key) reports failed. AOAI BYOK (api-key) mode investigation needed...

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

@github-actions

Copy link
Copy Markdown
Contributor

EGRESS_RESULT allow=pass deny=pass

✅ Allowed domain (github.com) reachable: allowed=200
✅ Blocked domain (example.com) denied: proxy CONNECT 403

Overall: PASS

@lpcox

Warning

Firewall blocked 1 domain

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

  • example.com

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

network:
  allowed:
    - defaults
    - "example.com"

See Network Configuration for more information.

🛡️ Egress verdict from Smoke Copilot Network Isolation
Add label ready-for-aw to run again

@github-actions github-actions Bot added the smoke-copilot-network-isolation Copilot network-isolation egress smoke test label Sep 21, 2026
@lpcox
lpcox deployed to aoai-model September 21, 2026 15:47 — with GitHub Actions Active
@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Claude Engine Validation

Check Result
API status ✅ PASS
gh check ✅ PASS
File status ✅ PASS

Overall result: PASS

Warning

Firewall blocked 1 domain

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

  • api.anthropic.com

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

network:
  allowed:
    - defaults
    - "api.anthropic.com"

See Network Configuration for more information.

Generated by Smoke Claude for #8818 · claude · haiku45 · 55.8 AIC · ⊞ 4.7K · ◷
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Copilot Engine — Overall: PASS

cc @lpcox

📰 BREAKING: Report filed by Smoke Copilot
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Copilot BYOK (Direct) Mode ✅

Test Results:

  • ✅ GitHub MCP connectivity (PR list verified)
  • ✅ GitHub.com connectivity (HTTP 200)
  • ✅ File write/read test passed
  • ✅ BYOK inference path active (agent → api-proxy → api.githubcopilot.com)

Mode: Direct BYOK (COPILOT_PROVIDER_API_KEY via api-proxy sidecar)
Status: PASS

🔑 BYOK report filed by Smoke Copilot BYOK
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: API Proxy OpenTelemetry Tracing

Scenario Result
1. Module Loading ✅ otel.js loaded successfully, isEnabled: true, exports: startRequestSpan, setTokenAttributes, setBudgetAttributes, endSpan, endSpanError, shutdown, isEnabled, ...
2. Test Suite ✅ 3 suites, 68/68 tests passed (0 failed)
3. Env Var Forwarding ✅ env-passthrough.ts forwards GITHUB_AW_OTEL_TRACE_ID/GITHUB_AW_OTEL_PARENT_SPAN_ID; api-proxy-env-config.ts forwards GH_AW_OTLP_ENDPOINTS, OTEL_EXPORTER_OTLP_ENDPOINT, and trace context
4. Token Tracker Integration ✅ token-tracker-http.js contains onUsage callback (OTEL hook point)
5. OTEL Diagnostics ✅ /tmp/gh-aw/otel.jsonl present with 1 exported span record (gh-aw.agent.setup, workflow-level trace); no api-proxy request spans this run since no proxied LLM calls occurred in this smoke job

Overall: ✅ All 5 scenarios passed. No regressions detected in OTEL tracing integration for the api-proxy sidecar.

📡 OTel tracing validated by Smoke OTel Tracing
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Services Connectivity — PASS

  • ✅ Redis: PONG
  • ✅ PostgreSQL pg_isready: accepting connections
  • ✅ PostgreSQL SELECT 1: 1

Overall: PASS

🔌 Service connectivity validated by Smoke Services
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Chroot Version Comparison Results

Runtime Host Version Chroot Version Match?
Python Python 3.12.14 Python 3.12.14 ✅ YES
Node.js v24.21.0 v2.98.0 ❌ NO
Go go1.22.12 go1.22.12 ✅ YES

Overall: FAILED — Node.js version inside the chroot (v2.98.0) does not match the host (v24.21.0). Python and Go versions match correctly.

Since not all tests passed, the smoke-chroot label was not added.

Tested by Smoke Chroot
Add label ready-for-aw to run again

@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 (ran, "Hello, World!") ✅ PASS
.NET json-parse ✅ N/A (ran, output valid JSON) ✅ PASS
Go color ✅ 1/1 packages ok ✅ PASS
Go env ✅ 1/1 packages ok ✅ PASS
Go uuid ✅ 1/1 packages ok ✅ 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

Notes:

  • Java initially failed with Could not create local repository at /home/runner/.m2/repository — an environment/permissions issue (root-owned .m2 dir with no sudo access), unrelated to firewall/network egress. Worked around by pointing Maven at an alternate writable local repo (-Dmaven.repo.local); all Java builds/tests then passed cleanly through the Squid proxy.
  • All other ecosystems built, installed, and tested successfully on the first attempt with no firewall-related network errors.

Generated by Build Test Suite for #8818 · copilot · auto · 41.2 AIC · ⊞ 11.8K · ◷
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

test(nvx): gate Linux-specific cases ✅
feat(nvx): bind Phase 3 resources to one run identity ✅
GitHub merged PRs ✅
PR details ✅
Playwright ✅
File write + cat ✅
Discussion comment ✅
Build ✅
Overall: PASS

Warning

Firewall blocked 7 domains

The following domains were blocked by the firewall during workflow execution:

  • accounts.google.com
  • clients2.google.com
  • contentautofill.googleapis.com
  • msfeed25.pkgs.visualstudio.com
  • update.googleapis.com
  • www.google.com
  • www.gstatic.com

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

network:
  allowed:
    - defaults
    - "accounts.google.com"
    - "clients2.google.com"
    - "contentautofill.googleapis.com"
    - "msfeed25.pkgs.visualstudio.com"
    - "update.googleapis.com"
    - "www.google.com"
    - "www.gstatic.com"

See Network Configuration for more information.

🔮 The oracle has spoken through Smoke Codex
Add label ready-for-aw to run again

This branch was successfully deployed

1 active deployment
aoai-model — 0a99efc4 Deployed Sep 21, 2026 by lpcox via conclusion #1708
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.

[Duplicate Code] Repeated filtered model-alias assembly in proxy server

3 participants