{"record":{"id":"ab5da76584770270","repo":"jackwener/OpenCLI","slug":"opencli-daemon-port-is-no-longer-supported-suffix","errorCode":null,"errorMessage":"OPENCLI_DAEMON_PORT is no longer supported${suffix}. The OpenCLI Chrome extension can only connect to localhost:${DEFAULT_DAEMON_PORT}. Unset OPENCLI_DAEMON_PORT and rerun opencli.","messagePattern":"OPENCLI_DAEMON_PORT is no longer supported(.+?)\\. The OpenCLI Chrome extension can only connect to localhost:(.+?)\\. Unset OPENCLI_DAEMON_PORT and rerun opencli\\.","errorType":"exception","errorClass":"UnsupportedDaemonPortEnvError","httpStatus":null,"severity":"error","filePath":"src/browser/daemon-transport.ts","lineNumber":16,"sourceCode":"import { DEFAULT_DAEMON_PORT, isIgnorableDaemonPortEnv, unsupportedDaemonPortEnvMessage } from '../constants.js';\n\nconst DAEMON_PORT = DEFAULT_DAEMON_PORT;\nconst DAEMON_URL = `http://127.0.0.1:${DAEMON_PORT}`;\nconst OPENCLI_HEADERS = { 'X-OpenCLI': '1' };\n\nclass UnsupportedDaemonPortEnvError extends Error {\n  constructor(value: string) {\n    super(unsupportedDaemonPortEnvMessage(value));\n    this.name = 'UnsupportedDaemonPortEnvError';\n  }\n}\n\nfunction assertSupportedDaemonPortEnv(): void {\n  const value = process.env.OPENCLI_DAEMON_PORT;\n  if (!isIgnorableDaemonPortEnv(value)) throw new UnsupportedDaemonPortEnvError(value!);\n}\n\nexport interface DaemonStatus {\n  ok: boolean;\n  pid: number;\n  uptime: number;\n  daemonVersion?: string;\n  extensionConnected: boolean;\n  extensionVersion?: string;\n  extensionCompatRange?: string;\n  contextId?: string;\n  profileRequired?: boolean;\n  profileDisconnected?: boolean;\n  profiles?: BrowserProfileStatus[];\n  pending: number;\n  commandResultUnknown?: number;\n  memoryMB: number;\n  port: number;","sourceCodeStart":1,"sourceCodeEnd":34,"githubUrl":"https://github.com/jackwener/OpenCLI/blob/49907e53dc3ade5c223ff0c4c2c2785687cec4e6/src/browser/daemon-transport.ts#L1-L34","documentation":"OpenCLI's daemon transport no longer supports overriding the daemon port via the OPENCLI_DAEMON_PORT environment variable. The Chrome extension hard-codes its connection to the default daemon port, so any non-empty OPENCLI_DAEMON_PORT value makes assertSupportedDaemonPortEnv throw UnsupportedDaemonPortEnvError before a daemon request is made.","triggerScenarios":"Calling any daemon-backed operation (e.g. requestDaemon) while the OPENCLI_DAEMON_PORT environment variable is set to a value not considered ignorable (empty/undefined).","commonSituations":"Developers upgrading from an older OpenCLI version that allowed custom daemon ports and still export OPENCLI_DAEMON_PORT=9222 in shell rc files, CI configs, or .env files loaded into the Node process.","solutions":["Unset the variable: `unset OPENCLI_DAEMON_PORT` in the current shell","Remove `export OPENCLI_DAEMON_PORT=...` from ~/.bashrc, ~/.zshrc, .env files, or CI configuration","Restart the terminal/CI job so the environment is clean and rerun `opencli`","Verify the extension is pointed at localhost on the default daemon port"],"exampleFix":"// before (shell)\nexport OPENCLI_DAEMON_PORT=9333\nopencli ...\n// after (shell)\nunset OPENCLI_DAEMON_PORT\nopencli ...","handlingStrategy":"validation","validationCode":"if (process.env.OPENCLI_DAEMON_PORT) {\n  console.warn('OPENCLI_DAEMON_PORT is unsupported; unsetting it');\n  delete process.env.OPENCLI_DAEMON_PORT;\n}\nawait opencli.requestDaemon();","typeGuard":"function hasNoDaemonPortEnv(): boolean { return !process.env.OPENCLI_DAEMON_PORT; }","tryCatchPattern":"try { await requestDaemon(); }\ncatch (e) {\n  if (e instanceof UnsupportedDaemonPortEnvError) {\n    delete process.env.OPENCLI_DAEMON_PORT;\n    await requestDaemon();\n  } else throw e;\n}","preventionTips":["Never export OPENCLI_DAEMON_PORT in shell rc files or .env","Grep CI configs for OPENCLI_DAEMON_PORT after upgrading","Document the port is fixed to the extension's default"],"tags":["environment","configuration","daemon","breaking-change"],"backgroundTag":"unsupported-env-var","analyzedSha":"49907e53dc3ade5c223ff0c4c2c2785687cec4e6","analyzedAt":"2026-08-29T08:14:47.543Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}