Remove deprecated OpenCode (10004) and align API proxy port/docs surface#3698
Conversation
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (3 files)
Coverage comparison generated by |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
This PR removes the deprecated OpenCode API proxy endpoint (port 10004) and its configuration/CLI surface, while synchronizing schemas, tests, workflows, and documentation to reflect the API proxy provider ports ending at 10003 (OpenAI/Anthropic/Copilot/Gemini).
Changes:
- Removed OpenCode port/flag/config plumbing (
OPENCODE/enableOpenCode/--enable-opencode/AWF_ENABLE_OPENCODE) and updated validations/tests accordingly. - Removed the OpenCode provider adapter and updated api-proxy adapter registry + api-proxy test expectations to a 4-provider world.
- Updated docs/specs/workflows to eliminate
10004references and correct port allocation guidance for contributors.
Show a summary per file
| File | Description |
|---|---|
| src/types/ports.ts | Removes OPENCODE: 10004 and updates port-range docs. |
| src/types/api-proxy-options.ts | Updates API proxy options documentation to 4 endpoints; removes enableOpenCode option. |
| src/squid-config.test.ts | Updates Safe_ports test coverage to exclude 10004. |
| src/services/api-proxy-service.ts | Stops emitting AWF_ENABLE_OPENCODE. |
| src/services/api-proxy-service-rate-limit.test.ts | Removes tests asserting AWF_ENABLE_OPENCODE behavior. |
| src/schema.test.ts | Removes apiProxy.enableOpenCode from schema fixture expectations. |
| src/parsers/rate-limit-parsers.ts | Removes --enable-opencode flag validation helper. |
| src/option-parsers.ts | Removes re-export of validateEnableOpenCodeFlag. |
| src/option-parsers-reexports.test.ts | Updates re-export tests to remove OpenCode validation symbol. |
| src/option-parsers-misc.test.ts | Removes unit tests for OpenCode flag validation. |
| src/host-iptables-rules.ts | Updates comment to reflect ports from API_PROXY_PORTS (no OpenCode). |
| src/config-file.ts | Removes apiProxy.enableOpenCode mapping from file config → CLI options. |
| src/config-file.test.ts | Removes config validation and mapping tests for enableOpenCode. |
| src/commands/validators/config-assembly.ts | Removes OpenCode feature-flag compatibility validation. |
| src/commands/validators/config-assembly.test.ts | Updates mocks/tests to remove OpenCode validation and config fields. |
| src/commands/validate-options.test.ts | Removes OpenCode-related validation expectations. |
| src/commands/build-config.ts | Removes enableOpenCode from assembled WrapperConfig. |
| src/commands/build-config.test.ts | Updates build-config tests to remove OpenCode input fields. |
| src/cli-options.ts | Removes --enable-opencode CLI flag definition. |
| src/awf-config-schema.json | Removes apiProxy.enableOpenCode from generated config schema. |
| scripts/generate-schema.mjs | Removes schema generation for enableOpenCode. |
| docs/usage.md | Removes --enable-opencode from CLI usage docs. |
| docs/gh-cli-proxy-design.md | Updates documented api-proxy port range to 10000-10003. |
| docs/awf-config.schema.json | Removes apiProxy.enableOpenCode from published docs schema. |
| docs/awf-config-spec.md | Removes config↔CLI mapping and all 10004/OpenCode references from spec text. |
| docs/authentication-architecture.md | Removes OpenCode port references and updates port range note. |
| docs/api-proxy-sidecar.md | Removes OpenCode port and reflect example entry; updates injection table text. |
| docs-site/src/content/docs/reference/cli-reference.md | Updates sidecar port table to include Gemini at 10003 (but needs env var table update). |
| containers/api-proxy/token-tracker-http.js | Updates provider list documentation to remove opencode mention. |
| containers/api-proxy/server.routing.test.js | Removes OpenCode routing/adapter tests; updates adapter-method test data. |
| containers/api-proxy/server.proxy.test.js | Removes OpenCode→Copilot x-initiator tests. |
| containers/api-proxy/server.network.test.js | Updates /reflect expectations from 5 endpoints to 4. |
| containers/api-proxy/server.models.test.js | Updates models.json expectations from 5 providers to 4. |
| containers/api-proxy/server.lifecycle.test.js | Removes OpenCode alwaysBind/unconfigured-response tests and imports. |
| containers/api-proxy/README.md | Adds Copilot/Gemini ports + env vars (but currently documents unsupported GOOGLE_API_KEY). |
| containers/api-proxy/providers/opencode.js | Deletes the OpenCode provider adapter implementation. |
| containers/api-proxy/providers/index.js | Removes OpenCode adapter wiring; returns only 4 adapters. |
| containers/api-proxy/providers/ADDING-A-PROVIDER.md | Removes OpenCode routing guidance; replaces hardcoded EXPOSE ports with <NEW_PORT> and adds checklists. |
| containers/api-proxy/Dockerfile | Stops exposing port 10004. |
| containers/api-proxy/body-transform.js | Updates provider-type docs to remove opencode. |
| CLAUDE.md | Updates repo architecture docs to remove OpenCode port references. |
| .github/workflows/smoke-opencode.md | Removes deprecated OpenCode smoke workflow definition. |
| .github/workflows/smoke-opencode.lock.yml | Removes compiled lock workflow for the OpenCode smoke test. |
| .github/workflows/duplicate-code-detector.md | Removes opencode provider file from provider similarity scan list. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 44/44 changed files
- Comments generated: 3
| - `ANTHROPIC_API_KEY` - Anthropic API key for authentication | ||
| - `COPILOT_GITHUB_TOKEN` - GitHub token for Copilot authentication | ||
| - `COPILOT_API_KEY` - Direct Copilot API key for BYOK mode | ||
| - `GOOGLE_API_KEY` / `GEMINI_API_KEY` - Google Gemini API key for authentication |
| | `10000` | OpenAI | | ||
| | `10001` | Anthropic | | ||
| | `10002` | GitHub Copilot | | ||
| | `10004` | OpenCode | | ||
| | `10003` | Google Gemini | | ||
|
|
| ## Ports | ||
|
|
||
| - **10000**: OpenAI API proxy (api.openai.com) | ||
| - **10001**: Anthropic API proxy (api.anthropic.com) | ||
| - **10002**: GitHub Copilot API proxy (api.githubcopilot.com) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@copilot resolve branch conflicts and address review feedback |
Done. I resolved the branch conflict by merging
|
|
@copilot resolve the merge conflicts in this pull request |
Resolved. I merged the latest |
Smoke Test: Copilot BYOK (Offline) — FAIL
Overall: FAIL (file test failed) PR #3698: Remove deprecated OpenCode (10004) and align API proxy port/docs surface
|
|
✅ Smoke Test Results
Overall: PASS
|
Smoke Test ResultsMCP & Engine Validation
Status: PARTIAL (1/3 verified) cc
|
🔍 Smoke Test: API Proxy OTEL Tracing — Results✅ Scenario 1: Module LoadingStatus: PASS
✅ Scenario 2: Test SuiteStatus: PASS
✅ Scenario 3: Env Var ForwardingStatus: PASS
✅ Scenario 4: Token Tracker IntegrationStatus: PASS
i️ Scenario 5: OTEL DiagnosticsStatus: N/A (no OTLP endpoint configured in test)
Summary: All testable scenarios passed. OTEL integration is production-ready for distributed tracing with GenAI semantic conventions and parent context propagation.
|
|
Smoke test results: FAIL Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "localhost"See Network Configuration for more information.
|
|
Smoke Codex: FAIL Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "registry.npmjs.org"See Network Configuration for more information.
|
Smoke Test: Services Connectivity❌ Redis: Connection timeout (no PONG) Overall: FAIL — Cannot reach service containers at
|
Chroot Runtime Version ComparisonTest results from comparing host and chroot runtime versions:
Overall Result: Tests FAILED - Not all runtime versions match between host and chroot environment. Analysis
The version mismatches indicate that the chroot environment is not perfectly mirroring the host runtime versions, which could lead to inconsistent behavior.
|
🏗️ Build Test Suite ResultsAll 8 ecosystems tested successfully!
Overall: 8/8 ecosystems passed — ✅ PASS Summary:
|
This PR removes deprecated OpenCode support (port
10004) across runtime/config/schema/workflow surfaces and resolves port-allocation doc drift found in the audit. It also fixes provider contribution guidance to prevent future hardcoded-port inconsistencies.OpenCode deprecation removal (runtime + config surface)
containers/api-proxy/providers/opencode.js,providers/index.js).src/types/ports.ts(OPENCODEremoved)src/types/api-proxy-options.ts(enableOpenCoderemoved)src/cli-options.ts(--enable-opencoderemoved)src/services/api-proxy-service.ts(AWF_ENABLE_OPENCODEemission removed)src/commands/build-config.ts,src/config-file.ts,src/option-parsers.ts,src/parsers/rate-limit-parsers.ts,src/commands/validators/config-assembly.tsupdated accordingly..github/workflows/smoke-opencode.md.github/workflows/smoke-opencode.lock.ymlSchema and spec synchronization
apiProxy.enableOpenCodefrom generated/checked schemas:src/awf-config-schema.jsondocs/awf-config.schema.jsonscripts/generate-schema.mjs10003.Documentation consistency fixes from audit
containers/api-proxy/README.md:10002(Copilot) and10003(Gemini).COPILOT_GITHUB_TOKEN/COPILOT_API_KEY) and Gemini (GOOGLE_API_KEY/GEMINI_API_KEY).docs/api-proxy-sidecar.mddocs/awf-config-spec.mddocs/authentication-architecture.mddocs/usage.mddocs/gh-cli-proxy-design.mddocs-site/src/content/docs/reference/cli-reference.mdCLAUDE.mdContributor guidance hardening
containers/api-proxy/providers/ADDING-A-PROVIDER.md:10005with<NEW_PORT>in EXPOSE example.src/types/ports.tsandsrc/host-iptables-rules.ts.