Skip to content

Conversation

@mike1858
Copy link
Member

@mike1858 mike1858 commented Jan 15, 2026

Summary by CodeRabbit

  • New Features
    • Added support for the "gpt-5.2-codex" model with corresponding pricing information.
    • Users are now notified about pricing changes and data handling procedures when using this model.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 15, 2026

📝 Walkthrough

Walkthrough

This pull request introduces support for a new model variant "gpt-5.2-codex" with associated pricing information and displays a yellow warning notification when users explicitly select this model, informing them about pricing changes and required data re-upload procedures.

Changes

Cohort / File(s) Summary
Model Registry
src/models.rs
Added new model entry "gpt-5.2-codex" to MODEL_INDEX with pricing (input: 1.75, output: 14.0 per 1M tokens) and OpenAI caching support (0.175 cached input). Added corresponding alias mapping.
Warning Utility
src/utils.rs
Introduced pub fn warn_once_yellow() that outputs yellow-colored warning messages with emoji using the existing WARNED_MESSAGES cache for deduplication.
CLI Integration
src/analyzers/codex_cli.rs
Added import and conditional warning logic in SessionModel::explicit to emit yellow warning when "gpt-5.2-codex" is selected, notifying users of pricing changes and re-upload requirements.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A codex hops into the code,
With yellow warnings brightly showed,
Pricing changes, clear and bright,
We guide our users right!
New models join, old rabbits know,
The warnings help the whole team grow.

🚥 Pre-merge checks | ✅ 1 | ❌ 2
❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'GPT-5-2-Codex' is too vague and lacks context about the actual changes; it appears to be just a model name rather than a clear description of what the PR accomplishes. Revise the title to be more descriptive, such as 'Add GPT-5.2-Codex model support with pricing and warning' to clarify the changes being made.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

🧹 Recent nitpick comments
src/utils.rs (1)

25-33: Consider skipping ANSI codes when stderr isn’t a TTY (Line 31).

This avoids raw escape sequences in non‑interactive logs while keeping color in terminals.

♻️ Suggested tweak
+use std::io::IsTerminal;
...
 pub fn warn_once_yellow(message: impl Into<String>) {
     let message = message.into();
     let cache = WARNED_MESSAGES.get_or_init(|| Mutex::new(HashSet::new()));

     if cache.lock().insert(message.clone()) {
-        // ANSI escape codes: \x1b[33m = yellow, \x1b[0m = reset
-        eprintln!("\x1b[33m⚠️  {message}\x1b[0m");
+        if std::io::stderr().is_terminal() {
+            // ANSI escape codes: \x1b[33m = yellow, \x1b[0m = reset
+            eprintln!("\x1b[33m⚠️  {message}\x1b[0m");
+        } else {
+            eprintln!("⚠️  {message}");
+        }
     }
 }

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4a41ed6 and 385a240.

📒 Files selected for processing (3)
  • src/analyzers/codex_cli.rs
  • src/models.rs
  • src/utils.rs
🧰 Additional context used
📓 Path-based instructions (2)
**/*.rs

📄 CodeRabbit inference engine (AGENTS.md)

**/*.rs: Follow Rust 2024 edition conventions
Use anyhow::Result for error handling in Rust code
Prefer async/await over raw futures in Rust code
Use parking_lot locks over std::sync for performance in Rust code

Files:

  • src/analyzers/codex_cli.rs
  • src/utils.rs
  • src/models.rs
src/analyzers/*.rs

📄 CodeRabbit inference engine (AGENTS.md)

src/analyzers/*.rs: Implement the Analyzer trait for new analyzers in the pluggable architecture system
Place individual analyzer implementations in src/analyzers/ directory with Analyzer trait implementation
Analyzers should discover data files using platform-specific paths in their implementation

Files:

  • src/analyzers/codex_cli.rs
🧠 Learnings (1)
📚 Learning: 2026-01-02T01:09:18.967Z
Learnt from: Sewer56
Repo: Piebald-AI/splitrail PR: 99
File: src/watcher.rs:0-0
Timestamp: 2026-01-02T01:09:18.967Z
Learning: In Rust code related to the TUI (e.g., src/tui.rs, src/watcher.rs, and related modules), avoid using Tokio in background I/O paths. Prefer blocking I/O on a dedicated thread or a small thread pool spawned specifically for that work, rather than performing async/await with a Tokio runtime. Use std::thread::spawn or a local threadpool (e.g., threadpool, rayon) for tasks like server uploads; ensure non-blocking UI by offloading blocking work and minimize await points on the main UI thread.

Applied to files:

  • src/analyzers/codex_cli.rs
  • src/utils.rs
  • src/models.rs
🧬 Code graph analysis (1)
src/analyzers/codex_cli.rs (1)
src/utils.rs (2)
  • warn_once (16-23)
  • warn_once_yellow (26-34)
🔇 Additional comments (4)
src/models.rs (2)

713-713: LGTM — alias entry is consistent with the canonical mapping style.


318-327: Clarify whether gpt-5.2-codex is officially available; pricing rates are currently accurate.

The pricing rates (input $1.75/1M, output $14.00/1M, cached input $0.175/1M) match current official OpenAI documentation. However, gpt-5.2-codex appears to be a Codex-optimized variant that is currently expected but may not yet be officially released on the platform. Confirm this model identifier is intended for inclusion or whether it should reference the standard gpt-5.2 model instead.

src/analyzers/codex_cli.rs (2)

16-16: LGTM — import aligns with the new warning helper.


190-199: LGTM — explicit warning is clear and deduped via warn_once_yellow.

✏️ Tip: You can disable this entire section by setting review_details to false in your review settings.


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 and usage tips.

@mike1858 mike1858 merged commit 0101c1a into main Jan 15, 2026
6 checks passed
@mike1858 mike1858 deleted the feat/gpt-5-2-codex branch January 15, 2026 22:24
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.

2 participants