Skip to content

Support multiple Codex home directories #6

Description

@bemaru

Background

The plugin currently reads Codex usage limits from one Codex home directory:

  • Windows CODEX_HOME, when set
  • otherwise %USERPROFILE%\.codex

This works when Windows Codex and WSL Codex are intentionally configured to share the same Codex home. However, that asks users to change their Codex environment layout for the plugin's convenience.

Problem

In mixed Windows + WSL usage, Codex may write session JSONL files to different home directories. Windows TrafficMonitor can only see the Windows process environment, so it does not automatically know about WSL's CODEX_HOME or Linux-side ~/.codex.

The plugin should not make users unify Windows and WSL CODEX_HOME just to see usage limits.

Proposed behavior

Add support for an optional Windows environment variable such as:

CODEX_EXTRA_HOMES=C:\Users\EST\.codex;\\wsl.localhost\Ubuntu\home\jhkwak\.codex

The Codex reader should scan:

  1. the primary Codex home from Windows CODEX_HOME, or %USERPROFILE%\.codex if unset
  2. each readable path from CODEX_EXTRA_HOMES

Then select/merge the latest valid rate-limit payload using the existing v0.3.11 selection semantics.

Non-goals

  • Do not auto-scan all WSL distributions by default.
  • Do not require users to change WSL CODEX_HOME.
  • Do not add a Codex browser-login helper unless session JSONL becomes insufficient.
  • Do not reintroduce the old SQLite fallback.

Documentation

Update README/runtime/troubleshooting docs to recommend the default setup:

  • keep Codex homes separated unless the user intentionally wants to unify them
  • use CODEX_EXTRA_HOMES when TrafficMonitor should include additional Windows-readable Codex homes

Acceptance criteria

  • Existing single-home behavior keeps working.
  • CODEX_HOME override keeps working.
  • Additional homes can be provided through CODEX_EXTRA_HOMES.
  • Unreadable or missing extra homes do not break the primary home.
  • Tooltip/error text remains understandable when no usable Codex rate-limit payload is found.
  • Docs explain Windows vs WSL environment variable separation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions