refactor: migrated environment variable access from process.env to Bun.env across 71 files

- Migrated all environment variable access from Node.js `process.env` to Bun runtime `Bun.env` API across the entire codebase.
- Updated 71 files including source code, tests, documentation, and configuration to use Bun's native environment variable API.
- Added comprehensive environment variables documentation in `packages/coding-agent/docs/environment-variables.md` covering 100+ environment variables organized by category.
- Updated CHANGELOG entries to reflect migration from `process.env` to `Bun.env` and environment variable prefix changes (PI_* vs OMP_*).
- Maintained identical behavior and logic across all changes - only the environment variable access method was updated.
This commit is contained in:
can1357
2026-02-05 04:51:18 +01:00
parent be9357694f
commit 89e6479661
71 changed files with 494 additions and 196 deletions
@@ -145,24 +145,24 @@ class FakeWebSocket {
}
describe("PythonKernel (external gateway)", () => {
const originalEnv = { ...process.env };
const originalEnv = { ...Bun.env };
const originalFetch = globalThis.fetch;
const originalWebSocket = globalThis.WebSocket;
beforeEach(() => {
process.env.PI_PYTHON_GATEWAY_URL = "http://gateway.test";
process.env.PI_PYTHON_SKIP_CHECK = "1";
Bun.env.PI_PYTHON_GATEWAY_URL = "http://gateway.test";
Bun.env.PI_PYTHON_SKIP_CHECK = "1";
globalThis.WebSocket = FakeWebSocket as unknown as typeof WebSocket;
});
afterEach(() => {
for (const key of Object.keys(process.env)) {
for (const key of Object.keys(Bun.env)) {
if (!(key in originalEnv)) {
delete process.env[key];
delete Bun.env[key];
}
}
for (const [key, value] of Object.entries(originalEnv)) {
process.env[key] = value;
Bun.env[key] = value;
}
globalThis.fetch = originalFetch;
globalThis.WebSocket = originalWebSocket;