Skip to content

Forward daemon-related CBM environment variables in generated Codex configuration #1664

Open

Description

@anton-matosov

Context

Follow-up to #1562

Version 0.10.3 fixed forwarding CBM_CACHE_DIR to the Codex MCP subprocess. However, other CBM environment variables may also affect the daemon started or used by that subprocess. Codex sanitizes the subprocess environment unless variables are explicitly included in env_vars.

Proposed change

Include all supported daemon-relevant CBM variables in the generated Codex MCP configuration:

[mcp_servers.codebase-memory-mcp]
env_vars = [
  "CBM_ALLOWED_ROOT",
  "CBM_CACHE_DIR",
  "CBM_DIAGNOSTICS",
  "CBM_LOG_LEVEL",
  "CBM_WORKERS",
  "CBM_MEM_BUDGET_MB",
  "CBM_DUMP_VERIFY_MIN_RATIO",
]

As with CBM_CACHE_DIR, these names can be listed unconditionally: Codex forwards each variable only when it is present in the parent environment.

Before implementation, confirm that this is the complete set of supported environment variables that must reach the daemon.

Acceptance criteria

  • Generated Codex configuration forwards every supported daemon-relevant CBM environment variable.
  • Existing unrelated env_vars entries are preserved.
  • Repeated installation remains idempotent and does not duplicate entries.
  • Installer-generated Codex agent profiles use the same forwarding behavior where applicable.
  • Regression tests cover generation, preservation of existing entries, and repeated installation.
  • Documentation identifies which CBM variables are forwarded to Codex subprocesses.

Activity

  1. DeusData commented on Aug 17, 2026

    @DeusData
    Owner

    The rendezvous-critical half of this is in PR #1683: CBM_RUNTIME_DIR (which exists since #1645) is now forwarded alongside CBM_CACHE_DIR — without it a relocated-runtime setup gets a Codex subprocess that looks for the daemon in the default location and never finds it, the same silent split as #1562. Both names decide WHICH daemon a process talks to, so they are listed unconditionally. The broader list you proposed (LOG_LEVEL, WORKERS, MEM_BUDGET, DIAGNOSTICS, ALLOWED_ROOT, DUMP_VERIFY_MIN_RATIO) is a real enhancement question we are deliberately not deciding in a bugfix: forwarding behavioural knobs means a shell-scoped experiment variable silently reconfigures the agent's long-lived daemon, which cuts both ways. Leaving this open for that decision.

  2. anton-matosov commented on Aug 17, 2026

    @anton-matosov
    Author
  3. added
    enhancementNew feature or request
    priority/normalStandard review queue; useful PR with ordinary maintainer urgency.
    on Aug 18, 2026
  4. DeusData commented on Oct 19, 2026

    @DeusData
    Owner

    Thank you, Anton — the inability to pass diagnostic settings for troubleshooting is a useful distinction from changing normal daemon behavior. Your point about consistency with other clients is also noted. The broader forwarding policy still needs a maintainer decision; I do not have a new implementation outcome to report here.

  5. DeusData commented on Oct 25, 2026

    @DeusData
    Owner

    Thank you for explaining how missing diagnostic environment settings affect troubleshooting in Codex. The supported forwarding policy remains a maintainer decision. Sorry for the delay; this is waiting on maintainer follow-up, and I’ll follow up soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    editor/integrationEditor compatibility and CLI integrationenhancementNew feature or requestpriority/normalStandard review queue; useful PR with ordinary maintainer urgency.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions