You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pattern: API proxy provider environment variable names are duplicated verbatim between the TypeScript host code and the CommonJS sidecar code, with comments explicitly warning that the files must be kept in sync.
Locations: src/api-proxy-env-constants.ts lines 1-41 and containers/api-proxy/provider-env-constants.js lines 1-43, consumed by host env assembly in src/services/api-proxy-env-config.ts lines 5 and 20-35/72-82.
Use one generated or shared source of truth for provider env names. Options:
Keep a JSON manifest such as shared/api-proxy-env.json and generate both src/api-proxy-env-constants.ts and containers/api-proxy/provider-env-constants.js during build/test.
Or move to a .json file consumable by both TypeScript and CommonJS, with typed wrappers on the TS side.
Add a test that imports/loads both surfaces and fails if any provider key differs, if generation is not introduced immediately.
Duplicate Code Opportunity
Summary
src/api-proxy-env-constants.tslines 1-41 andcontainers/api-proxy/provider-env-constants.jslines 1-43, consumed by host env assembly insrc/services/api-proxy-env-config.tslines 5 and 20-35/72-82.Evidence
TypeScript host-side constants:
CommonJS sidecar constants duplicate the same matrix:
The host-side env builder relies on those names when forwarding credentials and target config into the sidecar:
Suggested Refactoring
Use one generated or shared source of truth for provider env names. Options:
shared/api-proxy-env.jsonand generate bothsrc/api-proxy-env-constants.tsandcontainers/api-proxy/provider-env-constants.jsduring build/test..jsonfile consumable by both TypeScript and CommonJS, with typed wrappers on the TS side.Affected Files
src/api-proxy-env-constants.ts— lines 1-41containers/api-proxy/provider-env-constants.js— lines 1-43src/services/api-proxy-env-config.ts— lines 5, 20-35, 72-82Effort Estimate
Medium
Detected by Duplicate Code Detector workflow. Run date: 2026-07-02
Warning
Firewall blocked 1 domain
The following domain was blocked by the firewall during workflow execution:
awmgmcpgSee Network Configuration for more information.