Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions containers/api-proxy/provider-env-constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@
/**
* Environment variable name constants for the API proxy provider adapters.
*
* This is the single source of truth for env var names on the container JS side.
* The TypeScript equivalent lives in src/api-proxy-env-constants.ts.
*
* Both files must be kept in sync when adding or renaming env vars.
* Keep both files in sync; src/api-proxy-env-constants-sync.test.ts enforces parity.
*/

/** Environment variable names for the OpenAI provider adapter. */
Expand Down
18 changes: 18 additions & 0 deletions src/api-proxy-env-constants-sync.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { ANTHROPIC_ENV, COPILOT_ENV, GEMINI_ENV, OPENAI_ENV } from './api-proxy-env-constants';

// eslint-disable-next-line @typescript-eslint/no-require-imports
const providerEnvConstants = require('../containers/api-proxy/provider-env-constants.js') as {
OPENAI_ENV: typeof OPENAI_ENV;
ANTHROPIC_ENV: typeof ANTHROPIC_ENV;
GEMINI_ENV: typeof GEMINI_ENV;
COPILOT_ENV: typeof COPILOT_ENV;
};

describe('API proxy provider env constants', () => {
it('stays in sync between TypeScript host code and JS sidecar code', () => {
expect(providerEnvConstants.OPENAI_ENV).toEqual(OPENAI_ENV);
expect(providerEnvConstants.ANTHROPIC_ENV).toEqual(ANTHROPIC_ENV);
expect(providerEnvConstants.GEMINI_ENV).toEqual(GEMINI_ENV);
expect(providerEnvConstants.COPILOT_ENV).toEqual(COPILOT_ENV);
});
});
4 changes: 1 addition & 3 deletions src/api-proxy-env-constants.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
/**
* Environment variable name constants for the API proxy provider adapters.
*
* This is the single source of truth for env var names on the TypeScript host side.
* The CommonJS equivalent lives in containers/api-proxy/provider-env-constants.js.
*
* Both files must be kept in sync when adding or renaming env vars.
* Keep both files in sync; src/api-proxy-env-constants-sync.test.ts enforces parity.
*/

/** Environment variable names for the OpenAI provider adapter. */
Expand Down
Loading