Skip to content

fix: wait for healthy Squid before starting API proxy - #10495

Merged
lpcox merged 3 commits into
mainfrom
copilot/fix-anthropic-oidc-token-issue
Oct 24, 2026
Merged

lpcox merged 3 commits into
mainfrom
copilot/fix-anthropic-oidc-token-issue

Conversation

Copilot AI commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Anthropic OIDC initialization could race Squid startup, leaving the API proxy without a token until its 30-second retry. Agents could start during this gap and exhaust their retries on 503 responses.

  • Startup ordering: Require healthy Squid before starting the primary API proxy:
    depends_on:
      squid-proxy:
        condition: service_healthy
  • Regression coverage: Assert ordering for Anthropic OIDC and API-key configurations, and preserve the Squid dependency when model routing adds its own.

Copilot AI changed the title [WIP] Fix Anthropic OIDC token unavailability after start fix: wait for healthy Squid before starting API proxy Oct 23, 2026
Copilot AI requested a review from lpcox October 23, 2026 21:25
@lpcox
lpcox marked this pull request as ready for review October 23, 2026 21:42
Copilot AI max review requested due to automatic review settings October 23, 2026 21:42

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

Squid is already required for startup, and the focused dependency change preserves routing order without a blocking regression.

No open issues 🎉

What changed in this PR

Updates AWF’s Docker Compose startup ordering to prevent Anthropic OIDC initialization from racing Squid readiness, addressing #10486.

Changes:

  • Adds a healthy-Squid dependency in the shared API proxy service builder.
  • Adds regression assertions for API-key and Anthropic OIDC configurations.
  • Verifies that model routing preserves both Squid and router dependencies.
File Description
src/​services/​api-proxy-service-config.ts Gates API proxy startup on Squid health.
src/​services/​api-proxy-service-config.test.ts Checks startup ordering for API-key and OIDC configurations.
src/​compose-generator.test.ts Confirms routed proxies retain the Squid dependency.

Review effort: Max

@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 Regression Detected

This PR decreases test coverage. Please add tests to maintain coverage levels.

Overall Coverage

Metric Base PR Delta
Lines 93.46% 93.46% ➡️ +0.00%
Statements 91.90% 91.90% ➡️ +0.00%
Functions 91.04% 91.04% ➡️ +0.00%
Branches 85.97% 85.96% 📉 -0.01%

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

@lpcox

lpcox commented Oct 24, 2026

Copy link
Copy Markdown
Collaborator

@copilot merge main and resolve conflicts

Copilot AI commented Oct 24, 2026

Copy link
Copy Markdown
Contributor Author

@copilot merge main and resolve conflicts

Merged main cleanly; merge commit: 298ad4b.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 93.48% 93.49% ➡️ +0.01%
Statements 91.93% 91.93% ➡️ +0.00%
Functions 91.09% 91.09% ➡️ +0.00%
Branches 86.02% 86.02% ➡️ +0.00%
📁 Per-file Coverage Changes (1 files)
File Lines (Before → After) Statements (Before → After)
src/nvx/one-shot-adapter.ts 82.9% → 83.4% (+0.56%) 80.2% → 80.7% (+0.52%)

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

@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

✅ Smoke Claude passed

Generated by Smoke Claude for #10495

@github-actions

github-actions Bot commented Oct 24, 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 Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

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

Smoke Codex

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated from Smoke Codex · gpt54 · 13.6 AIC · ⊞ 22.7K · ◷

🔮 The oracle has spoken through Smoke Codex

@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

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

🛡️ Egress verdict from Smoke Copilot Network Isolation

@github-actions

github-actions Bot commented Oct 24, 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 Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

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

💎 Faceted by Smoke Gemini

@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

🔌 Smoke Services — All services reachable! ✅

🔌 Service connectivity validated by Smoke Services

@github-actions

github-actions Bot commented Oct 24, 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 Oct 24, 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 Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Smoke Cloud Hypervisor completed. Cloud Hypervisor + Copilot passed.

Cloud Hypervisor + Copilot smoke test by Smoke Cloud Hypervisor

@github-actions

github-actions Bot commented Oct 24, 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

Copy link
Copy Markdown
Contributor

🚀 Security Guard has started processing this pull request

@github-actions

Copy link
Copy Markdown
Contributor

Services smoke test: PASS

  • ✅ Redis PING → PONG
  • ✅ pg_isready → accepting connections
  • ✅ psql SELECT 1 → 1

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

@github-actions

Copy link
Copy Markdown
Contributor

fix(ci): pin dispatcher Copilot CLI release and checksum
Pin Duplicate Code Detector to checksum-reviewed Copilot CLI
MCP connectivity: ✅ GitHub.com connectivity: ✅ File write/read: ✅ BYOK inference: ✅
Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw)
Overall status: PASS
cc: @Copilot @lpcox

🔑 BYOK (AOAI api-key) report filed by Smoke Copilot BYOK AOAI (api-key)
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke test (Copilot)

  • ✅ GitHub MCP: "Pin Dependency Security Monitor’s Copilot CLI version and checksum"
  • ✅ github.com connectivity (200)
  • ✅ File write/read
    Overall: PASS — @Copilot @lpcox

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

@lpcox
lpcox enabled auto-merge (squash) October 24, 2026 15:40
@github-actions

Copy link
Copy Markdown
Contributor

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

Test Result
GitHub MCP Connectivity ✅
GitHub.com HTTP (200) ✅
File Write/Read ✅
BYOK Inference Path ✅

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

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

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Claude Engine Validation

  • API status: ✅ PASS
  • GitHub check: ✅ PASS
  • File status: ✅ PASS

Overall result: PASS

Generated by Smoke Claude for #10495 · claude · haiku45 · 34 AIC · ⊞ 6.1K · ◷
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

Cloud Hypervisor + Copilot smoke test

  1. Merged PR lookup: PASS
  2. github.com connectivity: PASS (HTTP 200)
  3. File write/read: PASS
  4. example.com blocked: PASS (HTTP 000)
    Overall: PASS

Cloud Hypervisor + Copilot smoke test by Smoke Cloud Hypervisor
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

EGRESS_RESULT allow=pass deny=pass

  • ✅ Allowed (api.github.com): HTTP 200
  • ✅ Blocked (example.com): blocked (TLS cert error from proxy denial)

Overall: PASS — cc @lpcox

🛡️ 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 Oct 24, 2026
@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 ✅ ok ✅ PASS
Go env ✅ ok ✅ PASS
Go uuid ✅ ok ✅ PASS
Java gson ❌ 0/? ❌ FAIL
Java caffeine ❌ 0/? ❌ FAIL
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: 7/8 ecosystems passed — FAIL

Java failure: Maven could not resolve maven-resources-plugin:3.5.0 from Maven Central. The error was java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty, so the JVM truststore is empty. This is an environment problem, not a problem in the test projects. The default ~/.m2 repository also reported LocalRepositoryNotAccessibleException. A custom -Dmaven.repo.local did not help.

Notes: .NET needed DOTNET_CLI_HOME and XDG_RUNTIME_DIR set, because /run/user/1001 does not exist. Without them it crashed on first-run setup. The build-test label was not added because of the Java failures.

Generated by Build Test Suite for #10495 · copilot · auto · 24.2 AIC · ⊞ 5.7K · ◷
Add label ready-for-aw to run again

@github-actions

Copy link
Copy Markdown
Contributor

OTEL smoke test

  • ✅ S1 Module loads; exports startRequestSpan, setTokenAttributes, endSpan, shutdown, isEnabled, etc.
  • ✅ S2 Tests: 75/75 passed (3 suites)
  • ✅ S3 Env forwarding: GITHUB_AW_OTEL_TRACE_ID/PARENT_SPAN_ID in env-passthrough.ts; OTEL vars in api-proxy-env-config.ts
  • ✅ S4 onUsage hook present in token-tracker-http.js
  • ✅ S5 Diagnostics: otel.jsonl present (1 line)

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

@github-actions

Copy link
Copy Markdown
Contributor

Smoke test: FAIL

  • Last merged PRs: "fix(ci): pin dispatcher Copilot CLI release and checksum", "Pin Duplicate Code Detector to checksum-reviewed Copilot CLI" ✅
  • PR details fetched ✅
  • Playwright title check ❌
  • Temp file write/read ✅
  • AWF build ✅

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

@github-actions

Copy link
Copy Markdown
Contributor

Chroot Version Comparison

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

Result: failed. The Node.js versions differ between host and chroot, so the smoke-chroot label was not added.

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

@lpcox
lpcox merged commit 97cc24c into main Oct 24, 2026
138 of 141 checks passed
@lpcox
lpcox deleted the copilot/fix-anthropic-oidc-token-issue branch October 24, 2026 16:06

This branch was previously deployed

1 inactive deployment
aoai-model — 298ad4b3 Deployed Oct 24, 2026 by lpcox via conclusion #2137
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.

api-proxy: Anthropic OIDC token unavailable for ~30s after start; first init attempt races squid startup

3 participants