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
@@ -86,7 +86,7 @@ export async function createReportBundle(options: ReportBundleOptions): Promise<
files.push("system.json");
// Sanitized environment
data["env.json"] = JSON.stringify(sanitizeEnv(process.env as Record<string, string>), null, 2);
data["env.json"] = JSON.stringify(sanitizeEnv(Bun.env as Record<string, string>), null, 2);
files.push("env.json");
// Settings/config
@@ -28,8 +28,8 @@ export async function collectSystemInfo(): Promise<SystemInfo> {
const cpuModel = cpus[0]?.model ?? "Unknown CPU";
// Try to get shell from environment
const shell = process.env.SHELL ?? process.env.ComSpec ?? "unknown";
const terminal = process.env.TERM_PROGRAM ?? process.env.TERM ?? undefined;
const shell = Bun.env.SHELL ?? Bun.env.ComSpec ?? "unknown";
const terminal = Bun.env.TERM_PROGRAM ?? Bun.env.TERM ?? undefined;
return {
os: `${os.type()} ${os.release()} (${os.platform()})`,