Skip to content

feat: manage Codex config and localize usage resets - #12

Merged
ygpark80 merged 2 commits into
mainfrom
feat/codex-config-toggle
Aug 7, 2026
Merged

feat: manage Codex config and localize usage resets#12
ygpark80 merged 2 commits into
mainfrom
feat/codex-config-toggle

Conversation

@ygpark80

@ygpark80 ygpark80 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Changes

  • Add prism codex enable, disable, and status to switch the shared Codex App and CLI configuration between Prism and the previous provider settings.
  • Select gpt-5.6-sol, use its default reasoning effort, preserve unrelated Codex configuration, retain symlinked config files, and refuse to overwrite managed settings after drift.
  • Show ChatGPT usage reset timestamps in the local timezone with friendly remaining time such as in 16h 13m.
  • Keep prism claude as a Claude Code CLI launcher and simplify the README guidance accordingly.

Testing

  • go test -mod=vendor -race ./...
  • go vet -mod=vendor ./...
  • test -z "$(gofmt -l .)"
  • GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -mod=vendor -trimpath ...
  • Built the CLI, enabled Prism in an isolated CODEX_HOME, confirmed codex features list accepted the generated configuration, then disabled Prism and confirmed direct status.
  • Ran go run -mod=vendor . chatgpt usage and confirmed local KST reset timestamps and friendly remaining durations against live usage data.
  • git diff --check

Notes

  • Configuration changes apply to newly opened Codex tasks.
  • disable restores only managed values that still match what enable applied; otherwise status reports drift.

Summary by CodeRabbit

  • New Features

    • Added Codex CLI integration with enable, disable, and status commands.
    • Codex configuration changes preserve unrelated settings and detect unexpected modifications.
    • Usage reset times now display in local time with readable remaining or elapsed durations.
  • Documentation

    • Simplified Codex setup instructions and documented configuration behavior.
    • Clarified that Claude Code launches the installed CLI and forwards arguments unchanged.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: fd41cb56-346f-4d98-ad99-569fceb60973

📥 Commits

Reviewing files that changed from the base of the PR and between ed121e7 and 51e1713.

📒 Files selected for processing (5)
  • README.md
  • internal/cli/codex.go
  • internal/cli/codex_test.go
  • internal/cli/run.go
  • internal/cli/run_test.go

📝 Walkthrough

Walkthrough

The CLI adds prism codex enable, disable, and status. It manages Codex TOML configuration and JSON state, detects drift, preserves unrelated settings, and supports symlinks. Usage resets now show local time and relative duration. Documentation and tests cover the new behavior.

Changes

Codex CLI integration

Layer / File(s) Summary
CLI command and usage surface
internal/cli/run.go, internal/cli/run_test.go, internal/cli/codex.go
The CLI dispatches Codex subcommands, updates help text, and formats usage reset times in the local timezone with relative durations.
Codex configuration and document engine
internal/cli/codex.go
The implementation defines managed Codex values and state, resolves configuration paths, parses TOML, preserves file details, and performs atomic updates.
Codex lifecycle and validation
internal/cli/codex.go, internal/cli/codex_test.go, README.md
Enable, disable, and status manage Prism settings, restore saved values, detect drift, classify configuration states, and preserve unrelated changes. Tests and documentation cover the command behavior.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant CLI
  participant CodexConfiguration
  participant ConfigFiles
  User->>CLI: prism codex enable|disable|status
  CLI->>CodexConfiguration: dispatch subcommand
  CodexConfiguration->>ConfigFiles: read TOML and JSON state
  CodexConfiguration->>ConfigFiles: update or restore configuration
  CodexConfiguration-->>User: return status or operation result
Loading

Possibly related PRs

Suggested labels: size:L

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/codex-config-toggle

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ygpark80 ygpark80 changed the title feat: manage Codex Prism configuration feat: manage Codex config and localize usage resets Aug 7, 2026
@ygpark80
ygpark80 marked this pull request as ready for review August 7, 2026 11:26
@ygpark80
ygpark80 merged commit 78570b2 into main Aug 7, 2026
1 check passed
@ygpark80
ygpark80 deleted the feat/codex-config-toggle branch August 7, 2026 11:33
@coderabbitai coderabbitai Bot mentioned this pull request Aug 9, 2026
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant