2025-08-23 23:23:15 -07:00
|
|
|
use crate::app_backtrack::BacktrackState;
|
feat: initial import of Rust implementation of Codex CLI in codex-rs/ (#629)
As stated in `codex-rs/README.md`:
Today, Codex CLI is written in TypeScript and requires Node.js 22+ to
run it. For a number of users, this runtime requirement inhibits
adoption: they would be better served by a standalone executable. As
maintainers, we want Codex to run efficiently in a wide range of
environments with minimal overhead. We also want to take advantage of
operating system-specific APIs to provide better sandboxing, where
possible.
To that end, we are moving forward with a Rust implementation of Codex
CLI contained in this folder, which has the following benefits:
- The CLI compiles to small, standalone, platform-specific binaries.
- Can make direct, native calls to
[seccomp](https://man7.org/linux/man-pages/man2/seccomp.2.html) and
[landlock](https://man7.org/linux/man-pages/man7/landlock.7.html) in
order to support sandboxing on Linux.
- No runtime garbage collection, resulting in lower memory consumption
and better, more predictable performance.
Currently, the Rust implementation is materially behind the TypeScript
implementation in functionality, so continue to use the TypeScript
implmentation for the time being. We will publish native executables via
GitHub Releases as soon as we feel the Rust version is usable.
2025-04-24 13:31:40 -07:00
|
|
|
use crate::app_event::AppEvent;
|
2025-05-15 14:50:30 -07:00
|
|
|
use crate::app_event_sender::AppEventSender;
|
2025-10-01 14:29:05 -07:00
|
|
|
use crate::bottom_pane::ApprovalRequest;
|
feat: initial import of Rust implementation of Codex CLI in codex-rs/ (#629)
As stated in `codex-rs/README.md`:
Today, Codex CLI is written in TypeScript and requires Node.js 22+ to
run it. For a number of users, this runtime requirement inhibits
adoption: they would be better served by a standalone executable. As
maintainers, we want Codex to run efficiently in a wide range of
environments with minimal overhead. We also want to take advantage of
operating system-specific APIs to provide better sandboxing, where
possible.
To that end, we are moving forward with a Rust implementation of Codex
CLI contained in this folder, which has the following benefits:
- The CLI compiles to small, standalone, platform-specific binaries.
- Can make direct, native calls to
[seccomp](https://man7.org/linux/man-pages/man2/seccomp.2.html) and
[landlock](https://man7.org/linux/man-pages/man7/landlock.7.html) in
order to support sandboxing on Linux.
- No runtime garbage collection, resulting in lower memory consumption
and better, more predictable performance.
Currently, the Rust implementation is materially behind the TypeScript
implementation in functionality, so continue to use the TypeScript
implmentation for the time being. We will publish native executables via
GitHub Releases as soon as we feel the Rust version is usable.
2025-04-24 13:31:40 -07:00
|
|
|
use crate::chatwidget::ChatWidget;
|
2025-10-01 14:29:05 -07:00
|
|
|
use crate::diff_render::DiffSummary;
|
|
|
|
|
use crate::exec_command::strip_bash_lc_and_escape;
|
feat: add support for @ to do file search (#1401)
Introduces support for `@` to trigger a fuzzy-filename search in the
composer. Under the hood, this leverages
https://crates.io/crates/nucleo-matcher to do the fuzzy matching and
https://crates.io/crates/ignore to build up the list of file candidates
(so that it respects `.gitignore`).
For simplicity (at least for now), we do not do any caching between
searches like VS Code does for its file search:
https://github.com/microsoft/vscode/blob/1d89ed699b2e924d418c856318a3e12bca67ff3a/src/vs/workbench/services/search/node/rawSearchService.ts#L212-L218
Because we do not do any caching, I saw queries take up to three seconds
on large repositories with hundreds of thousands of files. To that end,
we do not perform searches synchronously on each keystroke, but instead
dispatch an event to do the search on a background thread that
asynchronously reports back to the UI when the results are available.
This is largely handled by the `FileSearchManager` introduced in this
PR, which also has logic for debouncing requests so there is at most one
search in flight at a time.
While we could potentially polish and tune this feature further, it may
already be overengineered for how it will be used, in practice, so we
can improve things going forward if it turns out that this is not "good
enough" in the wild.
Note this feature does not work like `@` in the TypeScript CLI, which
was more like directory-based tab completion. In the Rust CLI, `@`
triggers a full-repo fuzzy-filename search.
Fixes https://github.com/openai/codex/issues/1261.
2025-06-28 13:47:42 -07:00
|
|
|
use crate::file_search::FileSearchManager;
|
2025-09-18 13:55:53 -07:00
|
|
|
use crate::history_cell::HistoryCell;
|
2025-08-26 17:03:11 -07:00
|
|
|
use crate::pager_overlay::Overlay;
|
2025-10-01 14:29:05 -07:00
|
|
|
use crate::render::highlight::highlight_bash_to_lines;
|
2025-11-05 09:50:40 -08:00
|
|
|
use crate::render::renderable::Renderable;
|
2025-09-03 23:20:40 -07:00
|
|
|
use crate::resume_picker::ResumeSelection;
|
feat: initial import of Rust implementation of Codex CLI in codex-rs/ (#629)
As stated in `codex-rs/README.md`:
Today, Codex CLI is written in TypeScript and requires Node.js 22+ to
run it. For a number of users, this runtime requirement inhibits
adoption: they would be better served by a standalone executable. As
maintainers, we want Codex to run efficiently in a wide range of
environments with minimal overhead. We also want to take advantage of
operating system-specific APIs to provide better sandboxing, where
possible.
To that end, we are moving forward with a Rust implementation of Codex
CLI contained in this folder, which has the following benefits:
- The CLI compiles to small, standalone, platform-specific binaries.
- Can make direct, native calls to
[seccomp](https://man7.org/linux/man-pages/man2/seccomp.2.html) and
[landlock](https://man7.org/linux/man-pages/man7/landlock.7.html) in
order to support sandboxing on Linux.
- No runtime garbage collection, resulting in lower memory consumption
and better, more predictable performance.
Currently, the Rust implementation is materially behind the TypeScript
implementation in functionality, so continue to use the TypeScript
implmentation for the time being. We will publish native executables via
GitHub Releases as soon as we feel the Rust version is usable.
2025-04-24 13:31:40 -07:00
|
|
|
use crate::tui;
|
2025-08-20 13:47:24 -07:00
|
|
|
use crate::tui::TuiEvent;
|
2025-11-10 09:05:00 -08:00
|
|
|
use crate::update_action::UpdateAction;
|
feat: initial import of Rust implementation of Codex CLI in codex-rs/ (#629)
As stated in `codex-rs/README.md`:
Today, Codex CLI is written in TypeScript and requires Node.js 22+ to
run it. For a number of users, this runtime requirement inhibits
adoption: they would be better served by a standalone executable. As
maintainers, we want Codex to run efficiently in a wide range of
environments with minimal overhead. We also want to take advantage of
operating system-specific APIs to provide better sandboxing, where
possible.
To that end, we are moving forward with a Rust implementation of Codex
CLI contained in this folder, which has the following benefits:
- The CLI compiles to small, standalone, platform-specific binaries.
- Can make direct, native calls to
[seccomp](https://man7.org/linux/man-pages/man2/seccomp.2.html) and
[landlock](https://man7.org/linux/man-pages/man7/landlock.7.html) in
order to support sandboxing on Linux.
- No runtime garbage collection, resulting in lower memory consumption
and better, more predictable performance.
Currently, the Rust implementation is materially behind the TypeScript
implementation in functionality, so continue to use the TypeScript
implmentation for the time being. We will publish native executables via
GitHub Releases as soon as we feel the Rust version is usable.
2025-04-24 13:31:40 -07:00
|
|
|
use color_eyre::eyre::Result;
|
2025-09-03 23:20:40 -07:00
|
|
|
use color_eyre::eyre::WrapErr;
|
feat: initial import of Rust implementation of Codex CLI in codex-rs/ (#629)
As stated in `codex-rs/README.md`:
Today, Codex CLI is written in TypeScript and requires Node.js 22+ to
run it. For a number of users, this runtime requirement inhibits
adoption: they would be better served by a standalone executable. As
maintainers, we want Codex to run efficiently in a wide range of
environments with minimal overhead. We also want to take advantage of
operating system-specific APIs to provide better sandboxing, where
possible.
To that end, we are moving forward with a Rust implementation of Codex
CLI contained in this folder, which has the following benefits:
- The CLI compiles to small, standalone, platform-specific binaries.
- Can make direct, native calls to
[seccomp](https://man7.org/linux/man-pages/man2/seccomp.2.html) and
[landlock](https://man7.org/linux/man-pages/man7/landlock.7.html) in
order to support sandboxing on Linux.
- No runtime garbage collection, resulting in lower memory consumption
and better, more predictable performance.
Currently, the Rust implementation is materially behind the TypeScript
implementation in functionality, so continue to use the TypeScript
implmentation for the time being. We will publish native executables via
GitHub Releases as soon as we feel the Rust version is usable.
2025-04-24 13:31:40 -07:00
|
|
|
use crossterm::event::KeyCode;
|
|
|
|
|
use crossterm::event::KeyEvent;
|
2025-07-31 17:00:48 -07:00
|
|
|
use crossterm::event::KeyEventKind;
|
feat: Complete LLMX v0.1.0 - Rebrand from Codex with LiteLLM Integration
This release represents a comprehensive transformation of the codebase from Codex to LLMX,
enhanced with LiteLLM integration to support 100+ LLM providers through a unified API.
## Major Changes
### Phase 1: Repository & Infrastructure Setup
- Established new repository structure and branching strategy
- Created comprehensive project documentation (CLAUDE.md, LITELLM-SETUP.md)
- Set up development environment and tooling configuration
### Phase 2: Rust Workspace Transformation
- Renamed all Rust crates from `codex-*` to `llmx-*` (30+ crates)
- Updated package names, binary names, and workspace members
- Renamed core modules: codex.rs → llmx.rs, codex_delegate.rs → llmx_delegate.rs
- Updated all internal references, imports, and type names
- Renamed directories: codex-rs/ → llmx-rs/, codex-backend-openapi-models/ → llmx-backend-openapi-models/
- Fixed all Rust compilation errors after mass rename
### Phase 3: LiteLLM Integration
- Integrated LiteLLM for multi-provider LLM support (Anthropic, OpenAI, Azure, Google AI, AWS Bedrock, etc.)
- Implemented OpenAI-compatible Chat Completions API support
- Added model family detection and provider-specific handling
- Updated authentication to support LiteLLM API keys
- Renamed environment variables: OPENAI_BASE_URL → LLMX_BASE_URL
- Added LLMX_API_KEY for unified authentication
- Enhanced error handling for Chat Completions API responses
- Implemented fallback mechanisms between Responses API and Chat Completions API
### Phase 4: TypeScript/Node.js Components
- Renamed npm package: @codex/codex-cli → @valknar/llmx
- Updated TypeScript SDK to use new LLMX APIs and endpoints
- Fixed all TypeScript compilation and linting errors
- Updated SDK tests to support both API backends
- Enhanced mock server to handle multiple API formats
- Updated build scripts for cross-platform packaging
### Phase 5: Configuration & Documentation
- Updated all configuration files to use LLMX naming
- Rewrote README and documentation for LLMX branding
- Updated config paths: ~/.codex/ → ~/.llmx/
- Added comprehensive LiteLLM setup guide
- Updated all user-facing strings and help text
- Created release plan and migration documentation
### Phase 6: Testing & Validation
- Fixed all Rust tests for new naming scheme
- Updated snapshot tests in TUI (36 frame files)
- Fixed authentication storage tests
- Updated Chat Completions payload and SSE tests
- Fixed SDK tests for new API endpoints
- Ensured compatibility with Claude Sonnet 4.5 model
- Fixed test environment variables (LLMX_API_KEY, LLMX_BASE_URL)
### Phase 7: Build & Release Pipeline
- Updated GitHub Actions workflows for LLMX binary names
- Fixed rust-release.yml to reference llmx-rs/ instead of codex-rs/
- Updated CI/CD pipelines for new package names
- Made Apple code signing optional in release workflow
- Enhanced npm packaging resilience for partial platform builds
- Added Windows sandbox support to workspace
- Updated dotslash configuration for new binary names
### Phase 8: Final Polish
- Renamed all assets (.github images, labels, templates)
- Updated VSCode and DevContainer configurations
- Fixed all clippy warnings and formatting issues
- Applied cargo fmt and prettier formatting across codebase
- Updated issue templates and pull request templates
- Fixed all remaining UI text references
## Technical Details
**Breaking Changes:**
- Binary name changed from `codex` to `llmx`
- Config directory changed from `~/.codex/` to `~/.llmx/`
- Environment variables renamed (CODEX_* → LLMX_*)
- npm package renamed to `@valknar/llmx`
**New Features:**
- Support for 100+ LLM providers via LiteLLM
- Unified authentication with LLMX_API_KEY
- Enhanced model provider detection and handling
- Improved error handling and fallback mechanisms
**Files Changed:**
- 578 files modified across Rust, TypeScript, and documentation
- 30+ Rust crates renamed and updated
- Complete rebrand of UI, CLI, and documentation
- All tests updated and passing
**Dependencies:**
- Updated Cargo.lock with new package names
- Updated npm dependencies in llmx-cli
- Enhanced OpenAPI models for LLMX backend
This release establishes LLMX as a standalone project with comprehensive LiteLLM
integration, maintaining full backward compatibility with existing functionality
while opening support for a wide ecosystem of LLM providers.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Sebastian Krüger <support@pivoine.art>
2025-11-12 20:40:44 +01:00
|
|
|
use llmx_ansi_escape::ansi_escape_line;
|
|
|
|
|
use llmx_core::AuthManager;
|
|
|
|
|
use llmx_core::ConversationManager;
|
|
|
|
|
use llmx_core::config::Config;
|
|
|
|
|
use llmx_core::config::edit::ConfigEditsBuilder;
|
|
|
|
|
use llmx_core::model_family::find_family_for_model;
|
|
|
|
|
use llmx_core::protocol::SessionSource;
|
|
|
|
|
use llmx_core::protocol::TokenUsage;
|
|
|
|
|
use llmx_core::protocol_config_types::ReasoningEffort as ReasoningEffortConfig;
|
|
|
|
|
use llmx_protocol::ConversationId;
|
2025-08-22 08:24:13 -07:00
|
|
|
use ratatui::style::Stylize;
|
2025-08-20 16:57:35 -07:00
|
|
|
use ratatui::text::Line;
|
2025-05-24 08:33:49 -07:00
|
|
|
use std::path::PathBuf;
|
2025-07-17 12:54:55 -07:00
|
|
|
use std::sync::Arc;
|
2025-07-18 11:13:34 -07:00
|
|
|
use std::sync::atomic::AtomicBool;
|
|
|
|
|
use std::sync::atomic::Ordering;
|
2025-07-17 12:54:55 -07:00
|
|
|
use std::thread;
|
|
|
|
|
use std::time::Duration;
|
2025-08-20 10:11:09 -07:00
|
|
|
use tokio::select;
|
|
|
|
|
use tokio::sync::mpsc::unbounded_channel;
|
2025-10-20 14:40:14 -07:00
|
|
|
|
|
|
|
|
#[cfg(not(debug_assertions))]
|
|
|
|
|
use crate::history_cell::UpdateAvailableHistoryCell;
|
2025-07-17 12:54:55 -07:00
|
|
|
|
2025-09-18 09:28:32 -07:00
|
|
|
#[derive(Debug, Clone)]
|
|
|
|
|
pub struct AppExitInfo {
|
|
|
|
|
pub token_usage: TokenUsage,
|
|
|
|
|
pub conversation_id: Option<ConversationId>,
|
2025-10-15 16:11:20 -07:00
|
|
|
pub update_action: Option<UpdateAction>,
|
2025-09-18 09:28:32 -07:00
|
|
|
}
|
|
|
|
|
|
2025-08-20 13:47:24 -07:00
|
|
|
pub(crate) struct App {
|
2025-08-23 23:23:15 -07:00
|
|
|
pub(crate) server: Arc<ConversationManager>,
|
|
|
|
|
pub(crate) app_event_tx: AppEventSender,
|
|
|
|
|
pub(crate) chat_widget: ChatWidget,
|
2025-09-14 21:32:18 -04:00
|
|
|
pub(crate) auth_manager: Arc<AuthManager>,
|
2025-05-24 08:33:49 -07:00
|
|
|
|
2025-06-06 16:29:37 -07:00
|
|
|
/// Config is stored here so we can recreate ChatWidgets as needed.
|
2025-08-23 23:23:15 -07:00
|
|
|
pub(crate) config: Config,
|
2025-09-11 15:04:29 -07:00
|
|
|
pub(crate) active_profile: Option<String>,
|
2025-06-06 16:29:37 -07:00
|
|
|
|
2025-08-23 23:23:15 -07:00
|
|
|
pub(crate) file_search: FileSearchManager,
|
feat: add support for @ to do file search (#1401)
Introduces support for `@` to trigger a fuzzy-filename search in the
composer. Under the hood, this leverages
https://crates.io/crates/nucleo-matcher to do the fuzzy matching and
https://crates.io/crates/ignore to build up the list of file candidates
(so that it respects `.gitignore`).
For simplicity (at least for now), we do not do any caching between
searches like VS Code does for its file search:
https://github.com/microsoft/vscode/blob/1d89ed699b2e924d418c856318a3e12bca67ff3a/src/vs/workbench/services/search/node/rawSearchService.ts#L212-L218
Because we do not do any caching, I saw queries take up to three seconds
on large repositories with hundreds of thousands of files. To that end,
we do not perform searches synchronously on each keystroke, but instead
dispatch an event to do the search on a background thread that
asynchronously reports back to the UI when the results are available.
This is largely handled by the `FileSearchManager` introduced in this
PR, which also has logic for debouncing requests so there is at most one
search in flight at a time.
While we could potentially polish and tune this feature further, it may
already be overengineered for how it will be used, in practice, so we
can improve things going forward if it turns out that this is not "good
enough" in the wild.
Note this feature does not work like `@` in the TypeScript CLI, which
was more like directory-based tab completion. In the Rust CLI, `@`
triggers a full-repo fuzzy-filename search.
Fixes https://github.com/openai/codex/issues/1261.
2025-06-28 13:47:42 -07:00
|
|
|
|
2025-09-18 13:55:53 -07:00
|
|
|
pub(crate) transcript_cells: Vec<Arc<dyn HistoryCell>>,
|
2025-08-20 16:57:35 -07:00
|
|
|
|
2025-08-26 17:03:11 -07:00
|
|
|
// Pager overlay state (Transcript or Static like Diff)
|
|
|
|
|
pub(crate) overlay: Option<Overlay>,
|
2025-08-23 23:23:15 -07:00
|
|
|
pub(crate) deferred_history_lines: Vec<Line<'static>>,
|
2025-09-02 10:29:58 -07:00
|
|
|
has_emitted_history_lines: bool,
|
2025-08-21 11:17:29 -07:00
|
|
|
|
2025-08-23 23:23:15 -07:00
|
|
|
pub(crate) enhanced_keys_supported: bool,
|
2025-08-12 17:37:28 -07:00
|
|
|
|
|
|
|
|
/// Controls the animation thread that sends CommitTick events.
|
2025-08-23 23:23:15 -07:00
|
|
|
pub(crate) commit_anim_running: Arc<AtomicBool>,
|
|
|
|
|
|
|
|
|
|
// Esc-backtracking state grouped
|
|
|
|
|
pub(crate) backtrack: crate::app_backtrack::BacktrackState,
|
feat: Complete LLMX v0.1.0 - Rebrand from Codex with LiteLLM Integration
This release represents a comprehensive transformation of the codebase from Codex to LLMX,
enhanced with LiteLLM integration to support 100+ LLM providers through a unified API.
## Major Changes
### Phase 1: Repository & Infrastructure Setup
- Established new repository structure and branching strategy
- Created comprehensive project documentation (CLAUDE.md, LITELLM-SETUP.md)
- Set up development environment and tooling configuration
### Phase 2: Rust Workspace Transformation
- Renamed all Rust crates from `codex-*` to `llmx-*` (30+ crates)
- Updated package names, binary names, and workspace members
- Renamed core modules: codex.rs → llmx.rs, codex_delegate.rs → llmx_delegate.rs
- Updated all internal references, imports, and type names
- Renamed directories: codex-rs/ → llmx-rs/, codex-backend-openapi-models/ → llmx-backend-openapi-models/
- Fixed all Rust compilation errors after mass rename
### Phase 3: LiteLLM Integration
- Integrated LiteLLM for multi-provider LLM support (Anthropic, OpenAI, Azure, Google AI, AWS Bedrock, etc.)
- Implemented OpenAI-compatible Chat Completions API support
- Added model family detection and provider-specific handling
- Updated authentication to support LiteLLM API keys
- Renamed environment variables: OPENAI_BASE_URL → LLMX_BASE_URL
- Added LLMX_API_KEY for unified authentication
- Enhanced error handling for Chat Completions API responses
- Implemented fallback mechanisms between Responses API and Chat Completions API
### Phase 4: TypeScript/Node.js Components
- Renamed npm package: @codex/codex-cli → @valknar/llmx
- Updated TypeScript SDK to use new LLMX APIs and endpoints
- Fixed all TypeScript compilation and linting errors
- Updated SDK tests to support both API backends
- Enhanced mock server to handle multiple API formats
- Updated build scripts for cross-platform packaging
### Phase 5: Configuration & Documentation
- Updated all configuration files to use LLMX naming
- Rewrote README and documentation for LLMX branding
- Updated config paths: ~/.codex/ → ~/.llmx/
- Added comprehensive LiteLLM setup guide
- Updated all user-facing strings and help text
- Created release plan and migration documentation
### Phase 6: Testing & Validation
- Fixed all Rust tests for new naming scheme
- Updated snapshot tests in TUI (36 frame files)
- Fixed authentication storage tests
- Updated Chat Completions payload and SSE tests
- Fixed SDK tests for new API endpoints
- Ensured compatibility with Claude Sonnet 4.5 model
- Fixed test environment variables (LLMX_API_KEY, LLMX_BASE_URL)
### Phase 7: Build & Release Pipeline
- Updated GitHub Actions workflows for LLMX binary names
- Fixed rust-release.yml to reference llmx-rs/ instead of codex-rs/
- Updated CI/CD pipelines for new package names
- Made Apple code signing optional in release workflow
- Enhanced npm packaging resilience for partial platform builds
- Added Windows sandbox support to workspace
- Updated dotslash configuration for new binary names
### Phase 8: Final Polish
- Renamed all assets (.github images, labels, templates)
- Updated VSCode and DevContainer configurations
- Fixed all clippy warnings and formatting issues
- Applied cargo fmt and prettier formatting across codebase
- Updated issue templates and pull request templates
- Fixed all remaining UI text references
## Technical Details
**Breaking Changes:**
- Binary name changed from `codex` to `llmx`
- Config directory changed from `~/.codex/` to `~/.llmx/`
- Environment variables renamed (CODEX_* → LLMX_*)
- npm package renamed to `@valknar/llmx`
**New Features:**
- Support for 100+ LLM providers via LiteLLM
- Unified authentication with LLMX_API_KEY
- Enhanced model provider detection and handling
- Improved error handling and fallback mechanisms
**Files Changed:**
- 578 files modified across Rust, TypeScript, and documentation
- 30+ Rust crates renamed and updated
- Complete rebrand of UI, CLI, and documentation
- All tests updated and passing
**Dependencies:**
- Updated Cargo.lock with new package names
- Updated npm dependencies in llmx-cli
- Enhanced OpenAPI models for LLMX backend
This release establishes LLMX as a standalone project with comprehensive LiteLLM
integration, maintaining full backward compatibility with existing functionality
while opening support for a wide ecosystem of LLM providers.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Sebastian Krüger <support@pivoine.art>
2025-11-12 20:40:44 +01:00
|
|
|
pub(crate) feedback: llmx_feedback::LlmxFeedback,
|
2025-10-15 16:11:20 -07:00
|
|
|
/// Set when the user confirms an update; propagated on exit.
|
|
|
|
|
pub(crate) pending_update_action: Option<UpdateAction>,
|
2025-11-06 10:44:42 -08:00
|
|
|
|
|
|
|
|
// One-shot suppression of the next world-writable scan after user confirmation.
|
|
|
|
|
skip_world_writable_scan_once: bool,
|
2025-05-24 08:33:49 -07:00
|
|
|
}
|
|
|
|
|
|
2025-08-20 13:47:24 -07:00
|
|
|
impl App {
|
2025-10-16 21:03:23 -07:00
|
|
|
#[allow(clippy::too_many_arguments)]
|
2025-08-20 13:47:24 -07:00
|
|
|
pub async fn run(
|
|
|
|
|
tui: &mut tui::Tui,
|
2025-08-22 13:10:11 -07:00
|
|
|
auth_manager: Arc<AuthManager>,
|
2025-04-27 21:47:50 -07:00
|
|
|
config: Config,
|
2025-09-11 15:04:29 -07:00
|
|
|
active_profile: Option<String>,
|
feat: initial import of Rust implementation of Codex CLI in codex-rs/ (#629)
As stated in `codex-rs/README.md`:
Today, Codex CLI is written in TypeScript and requires Node.js 22+ to
run it. For a number of users, this runtime requirement inhibits
adoption: they would be better served by a standalone executable. As
maintainers, we want Codex to run efficiently in a wide range of
environments with minimal overhead. We also want to take advantage of
operating system-specific APIs to provide better sandboxing, where
possible.
To that end, we are moving forward with a Rust implementation of Codex
CLI contained in this folder, which has the following benefits:
- The CLI compiles to small, standalone, platform-specific binaries.
- Can make direct, native calls to
[seccomp](https://man7.org/linux/man-pages/man2/seccomp.2.html) and
[landlock](https://man7.org/linux/man-pages/man7/landlock.7.html) in
order to support sandboxing on Linux.
- No runtime garbage collection, resulting in lower memory consumption
and better, more predictable performance.
Currently, the Rust implementation is materially behind the TypeScript
implementation in functionality, so continue to use the TypeScript
implmentation for the time being. We will publish native executables via
GitHub Releases as soon as we feel the Rust version is usable.
2025-04-24 13:31:40 -07:00
|
|
|
initial_prompt: Option<String>,
|
2025-08-20 13:47:24 -07:00
|
|
|
initial_images: Vec<PathBuf>,
|
2025-09-03 23:20:40 -07:00
|
|
|
resume_selection: ResumeSelection,
|
feat: Complete LLMX v0.1.0 - Rebrand from Codex with LiteLLM Integration
This release represents a comprehensive transformation of the codebase from Codex to LLMX,
enhanced with LiteLLM integration to support 100+ LLM providers through a unified API.
## Major Changes
### Phase 1: Repository & Infrastructure Setup
- Established new repository structure and branching strategy
- Created comprehensive project documentation (CLAUDE.md, LITELLM-SETUP.md)
- Set up development environment and tooling configuration
### Phase 2: Rust Workspace Transformation
- Renamed all Rust crates from `codex-*` to `llmx-*` (30+ crates)
- Updated package names, binary names, and workspace members
- Renamed core modules: codex.rs → llmx.rs, codex_delegate.rs → llmx_delegate.rs
- Updated all internal references, imports, and type names
- Renamed directories: codex-rs/ → llmx-rs/, codex-backend-openapi-models/ → llmx-backend-openapi-models/
- Fixed all Rust compilation errors after mass rename
### Phase 3: LiteLLM Integration
- Integrated LiteLLM for multi-provider LLM support (Anthropic, OpenAI, Azure, Google AI, AWS Bedrock, etc.)
- Implemented OpenAI-compatible Chat Completions API support
- Added model family detection and provider-specific handling
- Updated authentication to support LiteLLM API keys
- Renamed environment variables: OPENAI_BASE_URL → LLMX_BASE_URL
- Added LLMX_API_KEY for unified authentication
- Enhanced error handling for Chat Completions API responses
- Implemented fallback mechanisms between Responses API and Chat Completions API
### Phase 4: TypeScript/Node.js Components
- Renamed npm package: @codex/codex-cli → @valknar/llmx
- Updated TypeScript SDK to use new LLMX APIs and endpoints
- Fixed all TypeScript compilation and linting errors
- Updated SDK tests to support both API backends
- Enhanced mock server to handle multiple API formats
- Updated build scripts for cross-platform packaging
### Phase 5: Configuration & Documentation
- Updated all configuration files to use LLMX naming
- Rewrote README and documentation for LLMX branding
- Updated config paths: ~/.codex/ → ~/.llmx/
- Added comprehensive LiteLLM setup guide
- Updated all user-facing strings and help text
- Created release plan and migration documentation
### Phase 6: Testing & Validation
- Fixed all Rust tests for new naming scheme
- Updated snapshot tests in TUI (36 frame files)
- Fixed authentication storage tests
- Updated Chat Completions payload and SSE tests
- Fixed SDK tests for new API endpoints
- Ensured compatibility with Claude Sonnet 4.5 model
- Fixed test environment variables (LLMX_API_KEY, LLMX_BASE_URL)
### Phase 7: Build & Release Pipeline
- Updated GitHub Actions workflows for LLMX binary names
- Fixed rust-release.yml to reference llmx-rs/ instead of codex-rs/
- Updated CI/CD pipelines for new package names
- Made Apple code signing optional in release workflow
- Enhanced npm packaging resilience for partial platform builds
- Added Windows sandbox support to workspace
- Updated dotslash configuration for new binary names
### Phase 8: Final Polish
- Renamed all assets (.github images, labels, templates)
- Updated VSCode and DevContainer configurations
- Fixed all clippy warnings and formatting issues
- Applied cargo fmt and prettier formatting across codebase
- Updated issue templates and pull request templates
- Fixed all remaining UI text references
## Technical Details
**Breaking Changes:**
- Binary name changed from `codex` to `llmx`
- Config directory changed from `~/.codex/` to `~/.llmx/`
- Environment variables renamed (CODEX_* → LLMX_*)
- npm package renamed to `@valknar/llmx`
**New Features:**
- Support for 100+ LLM providers via LiteLLM
- Unified authentication with LLMX_API_KEY
- Enhanced model provider detection and handling
- Improved error handling and fallback mechanisms
**Files Changed:**
- 578 files modified across Rust, TypeScript, and documentation
- 30+ Rust crates renamed and updated
- Complete rebrand of UI, CLI, and documentation
- All tests updated and passing
**Dependencies:**
- Updated Cargo.lock with new package names
- Updated npm dependencies in llmx-cli
- Enhanced OpenAPI models for LLMX backend
This release establishes LLMX as a standalone project with comprehensive LiteLLM
integration, maintaining full backward compatibility with existing functionality
while opening support for a wide ecosystem of LLM providers.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Sebastian Krüger <support@pivoine.art>
2025-11-12 20:40:44 +01:00
|
|
|
feedback: llmx_feedback::LlmxFeedback,
|
2025-09-18 09:28:32 -07:00
|
|
|
) -> Result<AppExitInfo> {
|
2025-08-20 13:47:24 -07:00
|
|
|
use tokio_stream::StreamExt;
|
|
|
|
|
let (app_event_tx, mut app_event_rx) = unbounded_channel();
|
2025-05-15 14:50:30 -07:00
|
|
|
let app_event_tx = AppEventSender::new(app_event_tx);
|
feat: initial import of Rust implementation of Codex CLI in codex-rs/ (#629)
As stated in `codex-rs/README.md`:
Today, Codex CLI is written in TypeScript and requires Node.js 22+ to
run it. For a number of users, this runtime requirement inhibits
adoption: they would be better served by a standalone executable. As
maintainers, we want Codex to run efficiently in a wide range of
environments with minimal overhead. We also want to take advantage of
operating system-specific APIs to provide better sandboxing, where
possible.
To that end, we are moving forward with a Rust implementation of Codex
CLI contained in this folder, which has the following benefits:
- The CLI compiles to small, standalone, platform-specific binaries.
- Can make direct, native calls to
[seccomp](https://man7.org/linux/man-pages/man2/seccomp.2.html) and
[landlock](https://man7.org/linux/man-pages/man7/landlock.7.html) in
order to support sandboxing on Linux.
- No runtime garbage collection, resulting in lower memory consumption
and better, more predictable performance.
Currently, the Rust implementation is materially behind the TypeScript
implementation in functionality, so continue to use the TypeScript
implmentation for the time being. We will publish native executables via
GitHub Releases as soon as we feel the Rust version is usable.
2025-04-24 13:31:40 -07:00
|
|
|
|
2025-10-02 13:06:21 -07:00
|
|
|
let conversation_manager = Arc::new(ConversationManager::new(
|
|
|
|
|
auth_manager.clone(),
|
|
|
|
|
SessionSource::Cli,
|
|
|
|
|
));
|
2025-08-20 13:47:24 -07:00
|
|
|
|
2025-09-19 14:38:36 -07:00
|
|
|
let enhanced_keys_supported = tui.enhanced_keys_supported();
|
2025-07-31 17:30:44 -07:00
|
|
|
|
2025-09-03 23:20:40 -07:00
|
|
|
let chat_widget = match resume_selection {
|
|
|
|
|
ResumeSelection::StartFresh | ResumeSelection::Exit => {
|
|
|
|
|
let init = crate::chatwidget::ChatWidgetInit {
|
|
|
|
|
config: config.clone(),
|
|
|
|
|
frame_requester: tui.frame_requester(),
|
|
|
|
|
app_event_tx: app_event_tx.clone(),
|
|
|
|
|
initial_prompt: initial_prompt.clone(),
|
|
|
|
|
initial_images: initial_images.clone(),
|
|
|
|
|
enhanced_keys_supported,
|
2025-09-14 21:32:18 -04:00
|
|
|
auth_manager: auth_manager.clone(),
|
2025-10-16 21:03:23 -07:00
|
|
|
feedback: feedback.clone(),
|
2025-09-03 23:20:40 -07:00
|
|
|
};
|
|
|
|
|
ChatWidget::new(init, conversation_manager.clone())
|
|
|
|
|
}
|
|
|
|
|
ResumeSelection::Resume(path) => {
|
|
|
|
|
let resumed = conversation_manager
|
|
|
|
|
.resume_conversation_from_rollout(
|
|
|
|
|
config.clone(),
|
|
|
|
|
path.clone(),
|
|
|
|
|
auth_manager.clone(),
|
|
|
|
|
)
|
|
|
|
|
.await
|
|
|
|
|
.wrap_err_with(|| {
|
|
|
|
|
format!("Failed to resume session from {}", path.display())
|
|
|
|
|
})?;
|
|
|
|
|
let init = crate::chatwidget::ChatWidgetInit {
|
|
|
|
|
config: config.clone(),
|
|
|
|
|
frame_requester: tui.frame_requester(),
|
|
|
|
|
app_event_tx: app_event_tx.clone(),
|
|
|
|
|
initial_prompt: initial_prompt.clone(),
|
|
|
|
|
initial_images: initial_images.clone(),
|
|
|
|
|
enhanced_keys_supported,
|
2025-09-14 21:32:18 -04:00
|
|
|
auth_manager: auth_manager.clone(),
|
2025-10-16 21:03:23 -07:00
|
|
|
feedback: feedback.clone(),
|
2025-09-03 23:20:40 -07:00
|
|
|
};
|
|
|
|
|
ChatWidget::new_from_existing(
|
|
|
|
|
init,
|
|
|
|
|
resumed.conversation,
|
|
|
|
|
resumed.session_configured,
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
};
|
feat: initial import of Rust implementation of Codex CLI in codex-rs/ (#629)
As stated in `codex-rs/README.md`:
Today, Codex CLI is written in TypeScript and requires Node.js 22+ to
run it. For a number of users, this runtime requirement inhibits
adoption: they would be better served by a standalone executable. As
maintainers, we want Codex to run efficiently in a wide range of
environments with minimal overhead. We also want to take advantage of
operating system-specific APIs to provide better sandboxing, where
possible.
To that end, we are moving forward with a Rust implementation of Codex
CLI contained in this folder, which has the following benefits:
- The CLI compiles to small, standalone, platform-specific binaries.
- Can make direct, native calls to
[seccomp](https://man7.org/linux/man-pages/man2/seccomp.2.html) and
[landlock](https://man7.org/linux/man-pages/man7/landlock.7.html) in
order to support sandboxing on Linux.
- No runtime garbage collection, resulting in lower memory consumption
and better, more predictable performance.
Currently, the Rust implementation is materially behind the TypeScript
implementation in functionality, so continue to use the TypeScript
implmentation for the time being. We will publish native executables via
GitHub Releases as soon as we feel the Rust version is usable.
2025-04-24 13:31:40 -07:00
|
|
|
|
feat: add support for @ to do file search (#1401)
Introduces support for `@` to trigger a fuzzy-filename search in the
composer. Under the hood, this leverages
https://crates.io/crates/nucleo-matcher to do the fuzzy matching and
https://crates.io/crates/ignore to build up the list of file candidates
(so that it respects `.gitignore`).
For simplicity (at least for now), we do not do any caching between
searches like VS Code does for its file search:
https://github.com/microsoft/vscode/blob/1d89ed699b2e924d418c856318a3e12bca67ff3a/src/vs/workbench/services/search/node/rawSearchService.ts#L212-L218
Because we do not do any caching, I saw queries take up to three seconds
on large repositories with hundreds of thousands of files. To that end,
we do not perform searches synchronously on each keystroke, but instead
dispatch an event to do the search on a background thread that
asynchronously reports back to the UI when the results are available.
This is largely handled by the `FileSearchManager` introduced in this
PR, which also has logic for debouncing requests so there is at most one
search in flight at a time.
While we could potentially polish and tune this feature further, it may
already be overengineered for how it will be used, in practice, so we
can improve things going forward if it turns out that this is not "good
enough" in the wild.
Note this feature does not work like `@` in the TypeScript CLI, which
was more like directory-based tab completion. In the Rust CLI, `@`
triggers a full-repo fuzzy-filename search.
Fixes https://github.com/openai/codex/issues/1261.
2025-06-28 13:47:42 -07:00
|
|
|
let file_search = FileSearchManager::new(config.cwd.clone(), app_event_tx.clone());
|
2025-10-20 14:40:14 -07:00
|
|
|
#[cfg(not(debug_assertions))]
|
|
|
|
|
let upgrade_version = crate::updates::get_upgrade_version(&config);
|
2025-08-14 16:59:47 -04:00
|
|
|
|
2025-08-20 13:47:24 -07:00
|
|
|
let mut app = Self {
|
chore: introduce ConversationManager as a clearinghouse for all conversations (#2240)
This PR does two things because after I got deep into the first one I
started pulling on the thread to the second:
- Makes `ConversationManager` the place where all in-memory
conversations are created and stored. Previously, `MessageProcessor` in
the `codex-mcp-server` crate was doing this via its `session_map`, but
this is something that should be done in `codex-core`.
- It unwinds the `ctrl_c: tokio::sync::Notify` that was threaded
throughout our code. I think this made sense at one time, but now that
we handle Ctrl-C within the TUI and have a proper `Op::Interrupt` event,
I don't think this was quite right, so I removed it. For `codex exec`
and `codex proto`, we now use `tokio::signal::ctrl_c()` directly, but we
no longer make `Notify` a field of `Codex` or `CodexConversation`.
Changes of note:
- Adds the files `conversation_manager.rs` and `codex_conversation.rs`
to `codex-core`.
- `Codex` and `CodexSpawnOk` are no longer exported from `codex-core`:
other crates must use `CodexConversation` instead (which is created via
`ConversationManager`).
- `core/src/codex_wrapper.rs` has been deleted in favor of
`ConversationManager`.
- `ConversationManager::new_conversation()` returns `NewConversation`,
which is in line with the `new_conversation` tool we want to add to the
MCP server. Note `NewConversation` includes `SessionConfiguredEvent`, so
we eliminate checks in cases like `codex-rs/core/tests/client.rs` to
verify `SessionConfiguredEvent` is the first event because that is now
internal to `ConversationManager`.
- Quite a bit of code was deleted from
`codex-rs/mcp-server/src/message_processor.rs` since it no longer has to
manage multiple conversations itself: it goes through
`ConversationManager` instead.
- `core/tests/live_agent.rs` has been deleted because I had to update a
bunch of tests and all the tests in here were ignored, and I don't think
anyone ever ran them, so this was just technical debt, at this point.
- Removed `notify_on_sigint()` from `util.rs` (and in a follow-up, I
hope to refactor the blandly-named `util.rs` into more descriptive
files).
- In general, I started replacing local variables named `codex` as
`conversation`, where appropriate, though admittedly I didn't do it
through all the integration tests because that would have added a lot of
noise to this PR.
---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/openai/codex/pull/2240).
* #2264
* #2263
* __->__ #2240
2025-08-13 13:38:18 -07:00
|
|
|
server: conversation_manager,
|
feat: initial import of Rust implementation of Codex CLI in codex-rs/ (#629)
As stated in `codex-rs/README.md`:
Today, Codex CLI is written in TypeScript and requires Node.js 22+ to
run it. For a number of users, this runtime requirement inhibits
adoption: they would be better served by a standalone executable. As
maintainers, we want Codex to run efficiently in a wide range of
environments with minimal overhead. We also want to take advantage of
operating system-specific APIs to provide better sandboxing, where
possible.
To that end, we are moving forward with a Rust implementation of Codex
CLI contained in this folder, which has the following benefits:
- The CLI compiles to small, standalone, platform-specific binaries.
- Can make direct, native calls to
[seccomp](https://man7.org/linux/man-pages/man2/seccomp.2.html) and
[landlock](https://man7.org/linux/man-pages/man7/landlock.7.html) in
order to support sandboxing on Linux.
- No runtime garbage collection, resulting in lower memory consumption
and better, more predictable performance.
Currently, the Rust implementation is materially behind the TypeScript
implementation in functionality, so continue to use the TypeScript
implmentation for the time being. We will publish native executables via
GitHub Releases as soon as we feel the Rust version is usable.
2025-04-24 13:31:40 -07:00
|
|
|
app_event_tx,
|
2025-08-20 13:47:24 -07:00
|
|
|
chat_widget,
|
2025-09-14 21:32:18 -04:00
|
|
|
auth_manager: auth_manager.clone(),
|
2025-06-06 16:29:37 -07:00
|
|
|
config,
|
2025-09-11 15:04:29 -07:00
|
|
|
active_profile,
|
feat: add support for @ to do file search (#1401)
Introduces support for `@` to trigger a fuzzy-filename search in the
composer. Under the hood, this leverages
https://crates.io/crates/nucleo-matcher to do the fuzzy matching and
https://crates.io/crates/ignore to build up the list of file candidates
(so that it respects `.gitignore`).
For simplicity (at least for now), we do not do any caching between
searches like VS Code does for its file search:
https://github.com/microsoft/vscode/blob/1d89ed699b2e924d418c856318a3e12bca67ff3a/src/vs/workbench/services/search/node/rawSearchService.ts#L212-L218
Because we do not do any caching, I saw queries take up to three seconds
on large repositories with hundreds of thousands of files. To that end,
we do not perform searches synchronously on each keystroke, but instead
dispatch an event to do the search on a background thread that
asynchronously reports back to the UI when the results are available.
This is largely handled by the `FileSearchManager` introduced in this
PR, which also has logic for debouncing requests so there is at most one
search in flight at a time.
While we could potentially polish and tune this feature further, it may
already be overengineered for how it will be used, in practice, so we
can improve things going forward if it turns out that this is not "good
enough" in the wild.
Note this feature does not work like `@` in the TypeScript CLI, which
was more like directory-based tab completion. In the Rust CLI, `@`
triggers a full-repo fuzzy-filename search.
Fixes https://github.com/openai/codex/issues/1261.
2025-06-28 13:47:42 -07:00
|
|
|
file_search,
|
2025-07-31 17:30:44 -07:00
|
|
|
enhanced_keys_supported,
|
2025-09-18 13:55:53 -07:00
|
|
|
transcript_cells: Vec::new(),
|
2025-08-26 17:03:11 -07:00
|
|
|
overlay: None,
|
2025-08-21 11:17:29 -07:00
|
|
|
deferred_history_lines: Vec::new(),
|
2025-09-02 10:29:58 -07:00
|
|
|
has_emitted_history_lines: false,
|
2025-08-12 17:37:28 -07:00
|
|
|
commit_anim_running: Arc::new(AtomicBool::new(false)),
|
2025-08-23 23:23:15 -07:00
|
|
|
backtrack: BacktrackState::default(),
|
2025-10-16 21:03:23 -07:00
|
|
|
feedback: feedback.clone(),
|
2025-10-15 16:11:20 -07:00
|
|
|
pending_update_action: None,
|
2025-11-06 10:44:42 -08:00
|
|
|
skip_world_writable_scan_once: false,
|
2025-08-20 13:47:24 -07:00
|
|
|
};
|
feat: initial import of Rust implementation of Codex CLI in codex-rs/ (#629)
As stated in `codex-rs/README.md`:
Today, Codex CLI is written in TypeScript and requires Node.js 22+ to
run it. For a number of users, this runtime requirement inhibits
adoption: they would be better served by a standalone executable. As
maintainers, we want Codex to run efficiently in a wide range of
environments with minimal overhead. We also want to take advantage of
operating system-specific APIs to provide better sandboxing, where
possible.
To that end, we are moving forward with a Rust implementation of Codex
CLI contained in this folder, which has the following benefits:
- The CLI compiles to small, standalone, platform-specific binaries.
- Can make direct, native calls to
[seccomp](https://man7.org/linux/man-pages/man2/seccomp.2.html) and
[landlock](https://man7.org/linux/man-pages/man7/landlock.7.html) in
order to support sandboxing on Linux.
- No runtime garbage collection, resulting in lower memory consumption
and better, more predictable performance.
Currently, the Rust implementation is materially behind the TypeScript
implementation in functionality, so continue to use the TypeScript
implmentation for the time being. We will publish native executables via
GitHub Releases as soon as we feel the Rust version is usable.
2025-04-24 13:31:40 -07:00
|
|
|
|
2025-11-08 11:35:43 -08:00
|
|
|
// On startup, if Auto mode (workspace-write) or ReadOnly is active, warn about world-writable dirs on Windows.
|
2025-11-06 10:44:42 -08:00
|
|
|
#[cfg(target_os = "windows")]
|
|
|
|
|
{
|
feat: Complete LLMX v0.1.0 - Rebrand from Codex with LiteLLM Integration
This release represents a comprehensive transformation of the codebase from Codex to LLMX,
enhanced with LiteLLM integration to support 100+ LLM providers through a unified API.
## Major Changes
### Phase 1: Repository & Infrastructure Setup
- Established new repository structure and branching strategy
- Created comprehensive project documentation (CLAUDE.md, LITELLM-SETUP.md)
- Set up development environment and tooling configuration
### Phase 2: Rust Workspace Transformation
- Renamed all Rust crates from `codex-*` to `llmx-*` (30+ crates)
- Updated package names, binary names, and workspace members
- Renamed core modules: codex.rs → llmx.rs, codex_delegate.rs → llmx_delegate.rs
- Updated all internal references, imports, and type names
- Renamed directories: codex-rs/ → llmx-rs/, codex-backend-openapi-models/ → llmx-backend-openapi-models/
- Fixed all Rust compilation errors after mass rename
### Phase 3: LiteLLM Integration
- Integrated LiteLLM for multi-provider LLM support (Anthropic, OpenAI, Azure, Google AI, AWS Bedrock, etc.)
- Implemented OpenAI-compatible Chat Completions API support
- Added model family detection and provider-specific handling
- Updated authentication to support LiteLLM API keys
- Renamed environment variables: OPENAI_BASE_URL → LLMX_BASE_URL
- Added LLMX_API_KEY for unified authentication
- Enhanced error handling for Chat Completions API responses
- Implemented fallback mechanisms between Responses API and Chat Completions API
### Phase 4: TypeScript/Node.js Components
- Renamed npm package: @codex/codex-cli → @valknar/llmx
- Updated TypeScript SDK to use new LLMX APIs and endpoints
- Fixed all TypeScript compilation and linting errors
- Updated SDK tests to support both API backends
- Enhanced mock server to handle multiple API formats
- Updated build scripts for cross-platform packaging
### Phase 5: Configuration & Documentation
- Updated all configuration files to use LLMX naming
- Rewrote README and documentation for LLMX branding
- Updated config paths: ~/.codex/ → ~/.llmx/
- Added comprehensive LiteLLM setup guide
- Updated all user-facing strings and help text
- Created release plan and migration documentation
### Phase 6: Testing & Validation
- Fixed all Rust tests for new naming scheme
- Updated snapshot tests in TUI (36 frame files)
- Fixed authentication storage tests
- Updated Chat Completions payload and SSE tests
- Fixed SDK tests for new API endpoints
- Ensured compatibility with Claude Sonnet 4.5 model
- Fixed test environment variables (LLMX_API_KEY, LLMX_BASE_URL)
### Phase 7: Build & Release Pipeline
- Updated GitHub Actions workflows for LLMX binary names
- Fixed rust-release.yml to reference llmx-rs/ instead of codex-rs/
- Updated CI/CD pipelines for new package names
- Made Apple code signing optional in release workflow
- Enhanced npm packaging resilience for partial platform builds
- Added Windows sandbox support to workspace
- Updated dotslash configuration for new binary names
### Phase 8: Final Polish
- Renamed all assets (.github images, labels, templates)
- Updated VSCode and DevContainer configurations
- Fixed all clippy warnings and formatting issues
- Applied cargo fmt and prettier formatting across codebase
- Updated issue templates and pull request templates
- Fixed all remaining UI text references
## Technical Details
**Breaking Changes:**
- Binary name changed from `codex` to `llmx`
- Config directory changed from `~/.codex/` to `~/.llmx/`
- Environment variables renamed (CODEX_* → LLMX_*)
- npm package renamed to `@valknar/llmx`
**New Features:**
- Support for 100+ LLM providers via LiteLLM
- Unified authentication with LLMX_API_KEY
- Enhanced model provider detection and handling
- Improved error handling and fallback mechanisms
**Files Changed:**
- 578 files modified across Rust, TypeScript, and documentation
- 30+ Rust crates renamed and updated
- Complete rebrand of UI, CLI, and documentation
- All tests updated and passing
**Dependencies:**
- Updated Cargo.lock with new package names
- Updated npm dependencies in llmx-cli
- Enhanced OpenAPI models for LLMX backend
This release establishes LLMX as a standalone project with comprehensive LiteLLM
integration, maintaining full backward compatibility with existing functionality
while opening support for a wide ecosystem of LLM providers.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Sebastian Krüger <support@pivoine.art>
2025-11-12 20:40:44 +01:00
|
|
|
let should_check = llmx_core::get_platform_sandbox().is_some()
|
2025-11-06 10:44:42 -08:00
|
|
|
&& matches!(
|
|
|
|
|
app.config.sandbox_policy,
|
feat: Complete LLMX v0.1.0 - Rebrand from Codex with LiteLLM Integration
This release represents a comprehensive transformation of the codebase from Codex to LLMX,
enhanced with LiteLLM integration to support 100+ LLM providers through a unified API.
## Major Changes
### Phase 1: Repository & Infrastructure Setup
- Established new repository structure and branching strategy
- Created comprehensive project documentation (CLAUDE.md, LITELLM-SETUP.md)
- Set up development environment and tooling configuration
### Phase 2: Rust Workspace Transformation
- Renamed all Rust crates from `codex-*` to `llmx-*` (30+ crates)
- Updated package names, binary names, and workspace members
- Renamed core modules: codex.rs → llmx.rs, codex_delegate.rs → llmx_delegate.rs
- Updated all internal references, imports, and type names
- Renamed directories: codex-rs/ → llmx-rs/, codex-backend-openapi-models/ → llmx-backend-openapi-models/
- Fixed all Rust compilation errors after mass rename
### Phase 3: LiteLLM Integration
- Integrated LiteLLM for multi-provider LLM support (Anthropic, OpenAI, Azure, Google AI, AWS Bedrock, etc.)
- Implemented OpenAI-compatible Chat Completions API support
- Added model family detection and provider-specific handling
- Updated authentication to support LiteLLM API keys
- Renamed environment variables: OPENAI_BASE_URL → LLMX_BASE_URL
- Added LLMX_API_KEY for unified authentication
- Enhanced error handling for Chat Completions API responses
- Implemented fallback mechanisms between Responses API and Chat Completions API
### Phase 4: TypeScript/Node.js Components
- Renamed npm package: @codex/codex-cli → @valknar/llmx
- Updated TypeScript SDK to use new LLMX APIs and endpoints
- Fixed all TypeScript compilation and linting errors
- Updated SDK tests to support both API backends
- Enhanced mock server to handle multiple API formats
- Updated build scripts for cross-platform packaging
### Phase 5: Configuration & Documentation
- Updated all configuration files to use LLMX naming
- Rewrote README and documentation for LLMX branding
- Updated config paths: ~/.codex/ → ~/.llmx/
- Added comprehensive LiteLLM setup guide
- Updated all user-facing strings and help text
- Created release plan and migration documentation
### Phase 6: Testing & Validation
- Fixed all Rust tests for new naming scheme
- Updated snapshot tests in TUI (36 frame files)
- Fixed authentication storage tests
- Updated Chat Completions payload and SSE tests
- Fixed SDK tests for new API endpoints
- Ensured compatibility with Claude Sonnet 4.5 model
- Fixed test environment variables (LLMX_API_KEY, LLMX_BASE_URL)
### Phase 7: Build & Release Pipeline
- Updated GitHub Actions workflows for LLMX binary names
- Fixed rust-release.yml to reference llmx-rs/ instead of codex-rs/
- Updated CI/CD pipelines for new package names
- Made Apple code signing optional in release workflow
- Enhanced npm packaging resilience for partial platform builds
- Added Windows sandbox support to workspace
- Updated dotslash configuration for new binary names
### Phase 8: Final Polish
- Renamed all assets (.github images, labels, templates)
- Updated VSCode and DevContainer configurations
- Fixed all clippy warnings and formatting issues
- Applied cargo fmt and prettier formatting across codebase
- Updated issue templates and pull request templates
- Fixed all remaining UI text references
## Technical Details
**Breaking Changes:**
- Binary name changed from `codex` to `llmx`
- Config directory changed from `~/.codex/` to `~/.llmx/`
- Environment variables renamed (CODEX_* → LLMX_*)
- npm package renamed to `@valknar/llmx`
**New Features:**
- Support for 100+ LLM providers via LiteLLM
- Unified authentication with LLMX_API_KEY
- Enhanced model provider detection and handling
- Improved error handling and fallback mechanisms
**Files Changed:**
- 578 files modified across Rust, TypeScript, and documentation
- 30+ Rust crates renamed and updated
- Complete rebrand of UI, CLI, and documentation
- All tests updated and passing
**Dependencies:**
- Updated Cargo.lock with new package names
- Updated npm dependencies in llmx-cli
- Enhanced OpenAPI models for LLMX backend
This release establishes LLMX as a standalone project with comprehensive LiteLLM
integration, maintaining full backward compatibility with existing functionality
while opening support for a wide ecosystem of LLM providers.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Sebastian Krüger <support@pivoine.art>
2025-11-12 20:40:44 +01:00
|
|
|
llmx_core::protocol::SandboxPolicy::WorkspaceWrite { .. }
|
|
|
|
|
| llmx_core::protocol::SandboxPolicy::ReadOnly
|
2025-11-06 10:44:42 -08:00
|
|
|
)
|
|
|
|
|
&& !app
|
|
|
|
|
.config
|
|
|
|
|
.notices
|
|
|
|
|
.hide_world_writable_warning
|
|
|
|
|
.unwrap_or(false);
|
|
|
|
|
if should_check {
|
|
|
|
|
let cwd = app.config.cwd.clone();
|
|
|
|
|
let env_map: std::collections::HashMap<String, String> = std::env::vars().collect();
|
|
|
|
|
let tx = app.app_event_tx.clone();
|
feat: Complete LLMX v0.1.0 - Rebrand from Codex with LiteLLM Integration
This release represents a comprehensive transformation of the codebase from Codex to LLMX,
enhanced with LiteLLM integration to support 100+ LLM providers through a unified API.
## Major Changes
### Phase 1: Repository & Infrastructure Setup
- Established new repository structure and branching strategy
- Created comprehensive project documentation (CLAUDE.md, LITELLM-SETUP.md)
- Set up development environment and tooling configuration
### Phase 2: Rust Workspace Transformation
- Renamed all Rust crates from `codex-*` to `llmx-*` (30+ crates)
- Updated package names, binary names, and workspace members
- Renamed core modules: codex.rs → llmx.rs, codex_delegate.rs → llmx_delegate.rs
- Updated all internal references, imports, and type names
- Renamed directories: codex-rs/ → llmx-rs/, codex-backend-openapi-models/ → llmx-backend-openapi-models/
- Fixed all Rust compilation errors after mass rename
### Phase 3: LiteLLM Integration
- Integrated LiteLLM for multi-provider LLM support (Anthropic, OpenAI, Azure, Google AI, AWS Bedrock, etc.)
- Implemented OpenAI-compatible Chat Completions API support
- Added model family detection and provider-specific handling
- Updated authentication to support LiteLLM API keys
- Renamed environment variables: OPENAI_BASE_URL → LLMX_BASE_URL
- Added LLMX_API_KEY for unified authentication
- Enhanced error handling for Chat Completions API responses
- Implemented fallback mechanisms between Responses API and Chat Completions API
### Phase 4: TypeScript/Node.js Components
- Renamed npm package: @codex/codex-cli → @valknar/llmx
- Updated TypeScript SDK to use new LLMX APIs and endpoints
- Fixed all TypeScript compilation and linting errors
- Updated SDK tests to support both API backends
- Enhanced mock server to handle multiple API formats
- Updated build scripts for cross-platform packaging
### Phase 5: Configuration & Documentation
- Updated all configuration files to use LLMX naming
- Rewrote README and documentation for LLMX branding
- Updated config paths: ~/.codex/ → ~/.llmx/
- Added comprehensive LiteLLM setup guide
- Updated all user-facing strings and help text
- Created release plan and migration documentation
### Phase 6: Testing & Validation
- Fixed all Rust tests for new naming scheme
- Updated snapshot tests in TUI (36 frame files)
- Fixed authentication storage tests
- Updated Chat Completions payload and SSE tests
- Fixed SDK tests for new API endpoints
- Ensured compatibility with Claude Sonnet 4.5 model
- Fixed test environment variables (LLMX_API_KEY, LLMX_BASE_URL)
### Phase 7: Build & Release Pipeline
- Updated GitHub Actions workflows for LLMX binary names
- Fixed rust-release.yml to reference llmx-rs/ instead of codex-rs/
- Updated CI/CD pipelines for new package names
- Made Apple code signing optional in release workflow
- Enhanced npm packaging resilience for partial platform builds
- Added Windows sandbox support to workspace
- Updated dotslash configuration for new binary names
### Phase 8: Final Polish
- Renamed all assets (.github images, labels, templates)
- Updated VSCode and DevContainer configurations
- Fixed all clippy warnings and formatting issues
- Applied cargo fmt and prettier formatting across codebase
- Updated issue templates and pull request templates
- Fixed all remaining UI text references
## Technical Details
**Breaking Changes:**
- Binary name changed from `codex` to `llmx`
- Config directory changed from `~/.codex/` to `~/.llmx/`
- Environment variables renamed (CODEX_* → LLMX_*)
- npm package renamed to `@valknar/llmx`
**New Features:**
- Support for 100+ LLM providers via LiteLLM
- Unified authentication with LLMX_API_KEY
- Enhanced model provider detection and handling
- Improved error handling and fallback mechanisms
**Files Changed:**
- 578 files modified across Rust, TypeScript, and documentation
- 30+ Rust crates renamed and updated
- Complete rebrand of UI, CLI, and documentation
- All tests updated and passing
**Dependencies:**
- Updated Cargo.lock with new package names
- Updated npm dependencies in llmx-cli
- Enhanced OpenAPI models for LLMX backend
This release establishes LLMX as a standalone project with comprehensive LiteLLM
integration, maintaining full backward compatibility with existing functionality
while opening support for a wide ecosystem of LLM providers.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Sebastian Krüger <support@pivoine.art>
2025-11-12 20:40:44 +01:00
|
|
|
let logs_base_dir = app.config.llmx_home.clone();
|
2025-11-08 11:35:43 -08:00
|
|
|
Self::spawn_world_writable_scan(cwd, env_map, logs_base_dir, tx);
|
2025-11-06 10:44:42 -08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-20 14:40:14 -07:00
|
|
|
#[cfg(not(debug_assertions))]
|
|
|
|
|
if let Some(latest_version) = upgrade_version {
|
|
|
|
|
app.handle_event(
|
|
|
|
|
tui,
|
|
|
|
|
AppEvent::InsertHistoryCell(Box::new(UpdateAvailableHistoryCell::new(
|
|
|
|
|
latest_version,
|
2025-11-10 09:05:00 -08:00
|
|
|
crate::update_action::get_update_action(),
|
2025-10-20 14:40:14 -07:00
|
|
|
))),
|
|
|
|
|
)
|
|
|
|
|
.await?;
|
|
|
|
|
}
|
|
|
|
|
|
2025-08-20 13:47:24 -07:00
|
|
|
let tui_events = tui.event_stream();
|
|
|
|
|
tokio::pin!(tui_events);
|
2025-08-20 10:11:09 -07:00
|
|
|
|
2025-08-20 13:47:24 -07:00
|
|
|
tui.frame_requester().schedule_frame();
|
2025-08-20 10:11:09 -07:00
|
|
|
|
2025-08-20 13:47:24 -07:00
|
|
|
while select! {
|
|
|
|
|
Some(event) = app_event_rx.recv() => {
|
2025-08-23 23:23:15 -07:00
|
|
|
app.handle_event(tui, event).await?
|
2025-08-20 13:47:24 -07:00
|
|
|
}
|
|
|
|
|
Some(event) = tui_events.next() => {
|
|
|
|
|
app.handle_tui_event(tui, event).await?
|
2025-08-20 10:11:09 -07:00
|
|
|
}
|
2025-08-20 13:47:24 -07:00
|
|
|
} {}
|
|
|
|
|
tui.terminal.clear()?;
|
2025-09-18 09:28:32 -07:00
|
|
|
Ok(AppExitInfo {
|
|
|
|
|
token_usage: app.token_usage(),
|
|
|
|
|
conversation_id: app.chat_widget.conversation_id(),
|
2025-10-15 16:11:20 -07:00
|
|
|
update_action: app.pending_update_action,
|
2025-09-18 09:28:32 -07:00
|
|
|
})
|
2025-08-20 10:11:09 -07:00
|
|
|
}
|
|
|
|
|
|
2025-08-20 13:47:24 -07:00
|
|
|
pub(crate) async fn handle_tui_event(
|
|
|
|
|
&mut self,
|
|
|
|
|
tui: &mut tui::Tui,
|
|
|
|
|
event: TuiEvent,
|
|
|
|
|
) -> Result<bool> {
|
2025-08-26 17:03:11 -07:00
|
|
|
if self.overlay.is_some() {
|
2025-08-23 23:23:15 -07:00
|
|
|
let _ = self.handle_backtrack_overlay_event(tui, event).await?;
|
2025-08-21 11:17:29 -07:00
|
|
|
} else {
|
|
|
|
|
match event {
|
|
|
|
|
TuiEvent::Key(key_event) => {
|
|
|
|
|
self.handle_key_event(tui, key_event).await;
|
|
|
|
|
}
|
|
|
|
|
TuiEvent::Paste(pasted) => {
|
|
|
|
|
// Many terminals convert newlines to \r when pasting (e.g., iTerm2),
|
|
|
|
|
// but tui-textarea expects \n. Normalize CR to LF.
|
|
|
|
|
// [tui-textarea]: https://github.com/rhysd/tui-textarea/blob/4d18622eeac13b309e0ff6a55a46ac6706da68cf/src/textarea.rs#L782-L783
|
|
|
|
|
// [iTerm2]: https://github.com/gnachman/iTerm2/blob/5d0c0d9f68523cbd0494dad5422998964a2ecd8d/sources/iTermPasteHelper.m#L206-L216
|
|
|
|
|
let pasted = pasted.replace("\r", "\n");
|
|
|
|
|
self.chat_widget.handle_paste(pasted);
|
|
|
|
|
}
|
|
|
|
|
TuiEvent::Draw => {
|
2025-09-15 10:22:02 -07:00
|
|
|
self.chat_widget.maybe_post_pending_notification(tui);
|
2025-08-28 12:54:12 -07:00
|
|
|
if self
|
|
|
|
|
.chat_widget
|
|
|
|
|
.handle_paste_burst_tick(tui.frame_requester())
|
|
|
|
|
{
|
|
|
|
|
return Ok(true);
|
|
|
|
|
}
|
2025-08-21 11:17:29 -07:00
|
|
|
tui.draw(
|
|
|
|
|
self.chat_widget.desired_height(tui.terminal.size()?.width),
|
|
|
|
|
|frame| {
|
2025-11-05 09:50:40 -08:00
|
|
|
self.chat_widget.render(frame.area(), frame.buffer);
|
2025-08-21 11:17:29 -07:00
|
|
|
if let Some((x, y)) = self.chat_widget.cursor_pos(frame.area()) {
|
|
|
|
|
frame.set_cursor_position((x, y));
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
)?;
|
|
|
|
|
}
|
2025-08-20 13:47:24 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Ok(true)
|
|
|
|
|
}
|
|
|
|
|
|
2025-08-23 23:23:15 -07:00
|
|
|
async fn handle_event(&mut self, tui: &mut tui::Tui, event: AppEvent) -> Result<bool> {
|
2025-08-20 13:47:24 -07:00
|
|
|
match event {
|
2025-08-21 10:36:58 -07:00
|
|
|
AppEvent::NewSession => {
|
2025-09-03 23:20:40 -07:00
|
|
|
let init = crate::chatwidget::ChatWidgetInit {
|
|
|
|
|
config: self.config.clone(),
|
|
|
|
|
frame_requester: tui.frame_requester(),
|
|
|
|
|
app_event_tx: self.app_event_tx.clone(),
|
|
|
|
|
initial_prompt: None,
|
|
|
|
|
initial_images: Vec::new(),
|
|
|
|
|
enhanced_keys_supported: self.enhanced_keys_supported,
|
2025-09-14 21:32:18 -04:00
|
|
|
auth_manager: self.auth_manager.clone(),
|
2025-10-16 21:03:23 -07:00
|
|
|
feedback: self.feedback.clone(),
|
2025-09-03 23:20:40 -07:00
|
|
|
};
|
|
|
|
|
self.chat_widget = ChatWidget::new(init, self.server.clone());
|
2025-08-21 10:36:58 -07:00
|
|
|
tui.frame_requester().schedule_frame();
|
|
|
|
|
}
|
2025-08-20 17:09:46 -07:00
|
|
|
AppEvent::InsertHistoryCell(cell) => {
|
2025-09-18 13:55:53 -07:00
|
|
|
let cell: Arc<dyn HistoryCell> = cell.into();
|
2025-08-26 17:03:11 -07:00
|
|
|
if let Some(Overlay::Transcript(t)) = &mut self.overlay {
|
2025-09-18 13:55:53 -07:00
|
|
|
t.insert_cell(cell.clone());
|
2025-08-21 11:17:29 -07:00
|
|
|
tui.frame_requester().schedule_frame();
|
|
|
|
|
}
|
2025-09-18 13:55:53 -07:00
|
|
|
self.transcript_cells.push(cell.clone());
|
2025-09-02 10:29:58 -07:00
|
|
|
let mut display = cell.display_lines(tui.terminal.last_known_screen_size.width);
|
2025-08-20 17:09:46 -07:00
|
|
|
if !display.is_empty() {
|
2025-09-02 13:45:51 -07:00
|
|
|
// Only insert a separating blank line for new cells that are not
|
|
|
|
|
// part of an ongoing stream. Streaming continuations should not
|
|
|
|
|
// accrue extra blank lines between chunks.
|
|
|
|
|
if !cell.is_stream_continuation() {
|
|
|
|
|
if self.has_emitted_history_lines {
|
|
|
|
|
display.insert(0, Line::from(""));
|
|
|
|
|
} else {
|
|
|
|
|
self.has_emitted_history_lines = true;
|
|
|
|
|
}
|
2025-09-02 10:29:58 -07:00
|
|
|
}
|
2025-08-26 17:03:11 -07:00
|
|
|
if self.overlay.is_some() {
|
2025-08-21 11:17:29 -07:00
|
|
|
self.deferred_history_lines.extend(display);
|
|
|
|
|
} else {
|
|
|
|
|
tui.insert_history_lines(display);
|
|
|
|
|
}
|
2025-08-20 17:09:46 -07:00
|
|
|
}
|
|
|
|
|
}
|
2025-08-20 10:11:09 -07:00
|
|
|
AppEvent::StartCommitAnimation => {
|
|
|
|
|
if self
|
|
|
|
|
.commit_anim_running
|
|
|
|
|
.compare_exchange(false, true, Ordering::Acquire, Ordering::Relaxed)
|
|
|
|
|
.is_ok()
|
|
|
|
|
{
|
|
|
|
|
let tx = self.app_event_tx.clone();
|
|
|
|
|
let running = self.commit_anim_running.clone();
|
|
|
|
|
thread::spawn(move || {
|
|
|
|
|
while running.load(Ordering::Relaxed) {
|
|
|
|
|
thread::sleep(Duration::from_millis(50));
|
|
|
|
|
tx.send(AppEvent::CommitTick);
|
2025-07-31 21:34:32 -07:00
|
|
|
}
|
2025-08-20 10:11:09 -07:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
AppEvent::StopCommitAnimation => {
|
|
|
|
|
self.commit_anim_running.store(false, Ordering::Release);
|
|
|
|
|
}
|
|
|
|
|
AppEvent::CommitTick => {
|
2025-08-20 13:47:24 -07:00
|
|
|
self.chat_widget.on_commit_tick();
|
2025-08-20 10:11:09 -07:00
|
|
|
}
|
feat: Complete LLMX v0.1.0 - Rebrand from Codex with LiteLLM Integration
This release represents a comprehensive transformation of the codebase from Codex to LLMX,
enhanced with LiteLLM integration to support 100+ LLM providers through a unified API.
## Major Changes
### Phase 1: Repository & Infrastructure Setup
- Established new repository structure and branching strategy
- Created comprehensive project documentation (CLAUDE.md, LITELLM-SETUP.md)
- Set up development environment and tooling configuration
### Phase 2: Rust Workspace Transformation
- Renamed all Rust crates from `codex-*` to `llmx-*` (30+ crates)
- Updated package names, binary names, and workspace members
- Renamed core modules: codex.rs → llmx.rs, codex_delegate.rs → llmx_delegate.rs
- Updated all internal references, imports, and type names
- Renamed directories: codex-rs/ → llmx-rs/, codex-backend-openapi-models/ → llmx-backend-openapi-models/
- Fixed all Rust compilation errors after mass rename
### Phase 3: LiteLLM Integration
- Integrated LiteLLM for multi-provider LLM support (Anthropic, OpenAI, Azure, Google AI, AWS Bedrock, etc.)
- Implemented OpenAI-compatible Chat Completions API support
- Added model family detection and provider-specific handling
- Updated authentication to support LiteLLM API keys
- Renamed environment variables: OPENAI_BASE_URL → LLMX_BASE_URL
- Added LLMX_API_KEY for unified authentication
- Enhanced error handling for Chat Completions API responses
- Implemented fallback mechanisms between Responses API and Chat Completions API
### Phase 4: TypeScript/Node.js Components
- Renamed npm package: @codex/codex-cli → @valknar/llmx
- Updated TypeScript SDK to use new LLMX APIs and endpoints
- Fixed all TypeScript compilation and linting errors
- Updated SDK tests to support both API backends
- Enhanced mock server to handle multiple API formats
- Updated build scripts for cross-platform packaging
### Phase 5: Configuration & Documentation
- Updated all configuration files to use LLMX naming
- Rewrote README and documentation for LLMX branding
- Updated config paths: ~/.codex/ → ~/.llmx/
- Added comprehensive LiteLLM setup guide
- Updated all user-facing strings and help text
- Created release plan and migration documentation
### Phase 6: Testing & Validation
- Fixed all Rust tests for new naming scheme
- Updated snapshot tests in TUI (36 frame files)
- Fixed authentication storage tests
- Updated Chat Completions payload and SSE tests
- Fixed SDK tests for new API endpoints
- Ensured compatibility with Claude Sonnet 4.5 model
- Fixed test environment variables (LLMX_API_KEY, LLMX_BASE_URL)
### Phase 7: Build & Release Pipeline
- Updated GitHub Actions workflows for LLMX binary names
- Fixed rust-release.yml to reference llmx-rs/ instead of codex-rs/
- Updated CI/CD pipelines for new package names
- Made Apple code signing optional in release workflow
- Enhanced npm packaging resilience for partial platform builds
- Added Windows sandbox support to workspace
- Updated dotslash configuration for new binary names
### Phase 8: Final Polish
- Renamed all assets (.github images, labels, templates)
- Updated VSCode and DevContainer configurations
- Fixed all clippy warnings and formatting issues
- Applied cargo fmt and prettier formatting across codebase
- Updated issue templates and pull request templates
- Fixed all remaining UI text references
## Technical Details
**Breaking Changes:**
- Binary name changed from `codex` to `llmx`
- Config directory changed from `~/.codex/` to `~/.llmx/`
- Environment variables renamed (CODEX_* → LLMX_*)
- npm package renamed to `@valknar/llmx`
**New Features:**
- Support for 100+ LLM providers via LiteLLM
- Unified authentication with LLMX_API_KEY
- Enhanced model provider detection and handling
- Improved error handling and fallback mechanisms
**Files Changed:**
- 578 files modified across Rust, TypeScript, and documentation
- 30+ Rust crates renamed and updated
- Complete rebrand of UI, CLI, and documentation
- All tests updated and passing
**Dependencies:**
- Updated Cargo.lock with new package names
- Updated npm dependencies in llmx-cli
- Enhanced OpenAPI models for LLMX backend
This release establishes LLMX as a standalone project with comprehensive LiteLLM
integration, maintaining full backward compatibility with existing functionality
while opening support for a wide ecosystem of LLM providers.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Sebastian Krüger <support@pivoine.art>
2025-11-12 20:40:44 +01:00
|
|
|
AppEvent::LlmxEvent(event) => {
|
|
|
|
|
self.chat_widget.handle_llmx_event(event);
|
2025-08-20 10:11:09 -07:00
|
|
|
}
|
2025-08-23 23:23:15 -07:00
|
|
|
AppEvent::ConversationHistory(ev) => {
|
|
|
|
|
self.on_conversation_history_for_backtrack(tui, ev).await?;
|
|
|
|
|
}
|
2025-08-20 10:11:09 -07:00
|
|
|
AppEvent::ExitRequest => {
|
|
|
|
|
return Ok(false);
|
|
|
|
|
}
|
feat: Complete LLMX v0.1.0 - Rebrand from Codex with LiteLLM Integration
This release represents a comprehensive transformation of the codebase from Codex to LLMX,
enhanced with LiteLLM integration to support 100+ LLM providers through a unified API.
## Major Changes
### Phase 1: Repository & Infrastructure Setup
- Established new repository structure and branching strategy
- Created comprehensive project documentation (CLAUDE.md, LITELLM-SETUP.md)
- Set up development environment and tooling configuration
### Phase 2: Rust Workspace Transformation
- Renamed all Rust crates from `codex-*` to `llmx-*` (30+ crates)
- Updated package names, binary names, and workspace members
- Renamed core modules: codex.rs → llmx.rs, codex_delegate.rs → llmx_delegate.rs
- Updated all internal references, imports, and type names
- Renamed directories: codex-rs/ → llmx-rs/, codex-backend-openapi-models/ → llmx-backend-openapi-models/
- Fixed all Rust compilation errors after mass rename
### Phase 3: LiteLLM Integration
- Integrated LiteLLM for multi-provider LLM support (Anthropic, OpenAI, Azure, Google AI, AWS Bedrock, etc.)
- Implemented OpenAI-compatible Chat Completions API support
- Added model family detection and provider-specific handling
- Updated authentication to support LiteLLM API keys
- Renamed environment variables: OPENAI_BASE_URL → LLMX_BASE_URL
- Added LLMX_API_KEY for unified authentication
- Enhanced error handling for Chat Completions API responses
- Implemented fallback mechanisms between Responses API and Chat Completions API
### Phase 4: TypeScript/Node.js Components
- Renamed npm package: @codex/codex-cli → @valknar/llmx
- Updated TypeScript SDK to use new LLMX APIs and endpoints
- Fixed all TypeScript compilation and linting errors
- Updated SDK tests to support both API backends
- Enhanced mock server to handle multiple API formats
- Updated build scripts for cross-platform packaging
### Phase 5: Configuration & Documentation
- Updated all configuration files to use LLMX naming
- Rewrote README and documentation for LLMX branding
- Updated config paths: ~/.codex/ → ~/.llmx/
- Added comprehensive LiteLLM setup guide
- Updated all user-facing strings and help text
- Created release plan and migration documentation
### Phase 6: Testing & Validation
- Fixed all Rust tests for new naming scheme
- Updated snapshot tests in TUI (36 frame files)
- Fixed authentication storage tests
- Updated Chat Completions payload and SSE tests
- Fixed SDK tests for new API endpoints
- Ensured compatibility with Claude Sonnet 4.5 model
- Fixed test environment variables (LLMX_API_KEY, LLMX_BASE_URL)
### Phase 7: Build & Release Pipeline
- Updated GitHub Actions workflows for LLMX binary names
- Fixed rust-release.yml to reference llmx-rs/ instead of codex-rs/
- Updated CI/CD pipelines for new package names
- Made Apple code signing optional in release workflow
- Enhanced npm packaging resilience for partial platform builds
- Added Windows sandbox support to workspace
- Updated dotslash configuration for new binary names
### Phase 8: Final Polish
- Renamed all assets (.github images, labels, templates)
- Updated VSCode and DevContainer configurations
- Fixed all clippy warnings and formatting issues
- Applied cargo fmt and prettier formatting across codebase
- Updated issue templates and pull request templates
- Fixed all remaining UI text references
## Technical Details
**Breaking Changes:**
- Binary name changed from `codex` to `llmx`
- Config directory changed from `~/.codex/` to `~/.llmx/`
- Environment variables renamed (CODEX_* → LLMX_*)
- npm package renamed to `@valknar/llmx`
**New Features:**
- Support for 100+ LLM providers via LiteLLM
- Unified authentication with LLMX_API_KEY
- Enhanced model provider detection and handling
- Improved error handling and fallback mechanisms
**Files Changed:**
- 578 files modified across Rust, TypeScript, and documentation
- 30+ Rust crates renamed and updated
- Complete rebrand of UI, CLI, and documentation
- All tests updated and passing
**Dependencies:**
- Updated Cargo.lock with new package names
- Updated npm dependencies in llmx-cli
- Enhanced OpenAPI models for LLMX backend
This release establishes LLMX as a standalone project with comprehensive LiteLLM
integration, maintaining full backward compatibility with existing functionality
while opening support for a wide ecosystem of LLM providers.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Sebastian Krüger <support@pivoine.art>
2025-11-12 20:40:44 +01:00
|
|
|
AppEvent::LlmxOp(op) => self.chat_widget.submit_op(op),
|
2025-08-20 10:11:09 -07:00
|
|
|
AppEvent::DiffResult(text) => {
|
2025-08-22 08:24:13 -07:00
|
|
|
// Clear the in-progress state in the bottom pane
|
|
|
|
|
self.chat_widget.on_diff_complete();
|
2025-08-22 09:41:15 -07:00
|
|
|
// Enter alternate screen using TUI helper and build pager lines
|
|
|
|
|
let _ = tui.enter_alt_screen();
|
2025-08-22 08:24:13 -07:00
|
|
|
let pager_lines: Vec<ratatui::text::Line<'static>> = if text.trim().is_empty() {
|
|
|
|
|
vec!["No changes detected.".italic().into()]
|
|
|
|
|
} else {
|
|
|
|
|
text.lines().map(ansi_escape_line).collect()
|
|
|
|
|
};
|
2025-10-01 14:29:05 -07:00
|
|
|
self.overlay = Some(Overlay::new_static_with_lines(
|
2025-08-22 08:24:13 -07:00
|
|
|
pager_lines,
|
|
|
|
|
"D I F F".to_string(),
|
|
|
|
|
));
|
|
|
|
|
tui.frame_requester().schedule_frame();
|
2025-08-20 10:11:09 -07:00
|
|
|
}
|
|
|
|
|
AppEvent::StartFileSearch(query) => {
|
|
|
|
|
if !query.is_empty() {
|
|
|
|
|
self.file_search.on_user_query(query);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
AppEvent::FileSearchResult { query, matches } => {
|
2025-08-20 13:47:24 -07:00
|
|
|
self.chat_widget.apply_file_search_result(query, matches);
|
2025-08-20 10:11:09 -07:00
|
|
|
}
|
|
|
|
|
AppEvent::UpdateReasoningEffort(effort) => {
|
2025-09-12 10:38:12 -07:00
|
|
|
self.on_update_reasoning_effort(effort);
|
2025-08-20 10:11:09 -07:00
|
|
|
}
|
|
|
|
|
AppEvent::UpdateModel(model) => {
|
2025-09-14 20:53:50 -04:00
|
|
|
self.chat_widget.set_model(&model);
|
2025-09-11 15:04:29 -07:00
|
|
|
self.config.model = model.clone();
|
|
|
|
|
if let Some(family) = find_family_for_model(&model) {
|
|
|
|
|
self.config.model_family = family;
|
|
|
|
|
}
|
2025-09-15 00:25:43 +01:00
|
|
|
}
|
2025-10-21 11:15:17 -07:00
|
|
|
AppEvent::OpenReasoningPopup { model } => {
|
|
|
|
|
self.chat_widget.open_reasoning_popup(model);
|
2025-10-02 12:38:24 -07:00
|
|
|
}
|
2025-10-16 17:31:46 -07:00
|
|
|
AppEvent::OpenFullAccessConfirmation { preset } => {
|
|
|
|
|
self.chat_widget.open_full_access_confirmation(preset);
|
|
|
|
|
}
|
2025-11-08 11:35:43 -08:00
|
|
|
AppEvent::OpenWorldWritableWarningConfirmation {
|
|
|
|
|
preset,
|
|
|
|
|
sample_paths,
|
|
|
|
|
extra_count,
|
|
|
|
|
failed_scan,
|
|
|
|
|
} => {
|
|
|
|
|
self.chat_widget.open_world_writable_warning_confirmation(
|
|
|
|
|
preset,
|
|
|
|
|
sample_paths,
|
|
|
|
|
extra_count,
|
|
|
|
|
failed_scan,
|
|
|
|
|
);
|
2025-11-06 10:44:42 -08:00
|
|
|
}
|
2025-10-24 22:28:14 -07:00
|
|
|
AppEvent::OpenFeedbackNote {
|
|
|
|
|
category,
|
|
|
|
|
include_logs,
|
|
|
|
|
} => {
|
|
|
|
|
self.chat_widget.open_feedback_note(category, include_logs);
|
|
|
|
|
}
|
|
|
|
|
AppEvent::OpenFeedbackConsent { category } => {
|
|
|
|
|
self.chat_widget.open_feedback_consent(category);
|
|
|
|
|
}
|
2025-10-27 18:19:32 -07:00
|
|
|
AppEvent::ShowWindowsAutoModeInstructions => {
|
|
|
|
|
self.chat_widget.open_windows_auto_mode_instructions();
|
|
|
|
|
}
|
2025-09-15 00:25:43 +01:00
|
|
|
AppEvent::PersistModelSelection { model, effort } => {
|
|
|
|
|
let profile = self.active_profile.as_deref();
|
feat: Complete LLMX v0.1.0 - Rebrand from Codex with LiteLLM Integration
This release represents a comprehensive transformation of the codebase from Codex to LLMX,
enhanced with LiteLLM integration to support 100+ LLM providers through a unified API.
## Major Changes
### Phase 1: Repository & Infrastructure Setup
- Established new repository structure and branching strategy
- Created comprehensive project documentation (CLAUDE.md, LITELLM-SETUP.md)
- Set up development environment and tooling configuration
### Phase 2: Rust Workspace Transformation
- Renamed all Rust crates from `codex-*` to `llmx-*` (30+ crates)
- Updated package names, binary names, and workspace members
- Renamed core modules: codex.rs → llmx.rs, codex_delegate.rs → llmx_delegate.rs
- Updated all internal references, imports, and type names
- Renamed directories: codex-rs/ → llmx-rs/, codex-backend-openapi-models/ → llmx-backend-openapi-models/
- Fixed all Rust compilation errors after mass rename
### Phase 3: LiteLLM Integration
- Integrated LiteLLM for multi-provider LLM support (Anthropic, OpenAI, Azure, Google AI, AWS Bedrock, etc.)
- Implemented OpenAI-compatible Chat Completions API support
- Added model family detection and provider-specific handling
- Updated authentication to support LiteLLM API keys
- Renamed environment variables: OPENAI_BASE_URL → LLMX_BASE_URL
- Added LLMX_API_KEY for unified authentication
- Enhanced error handling for Chat Completions API responses
- Implemented fallback mechanisms between Responses API and Chat Completions API
### Phase 4: TypeScript/Node.js Components
- Renamed npm package: @codex/codex-cli → @valknar/llmx
- Updated TypeScript SDK to use new LLMX APIs and endpoints
- Fixed all TypeScript compilation and linting errors
- Updated SDK tests to support both API backends
- Enhanced mock server to handle multiple API formats
- Updated build scripts for cross-platform packaging
### Phase 5: Configuration & Documentation
- Updated all configuration files to use LLMX naming
- Rewrote README and documentation for LLMX branding
- Updated config paths: ~/.codex/ → ~/.llmx/
- Added comprehensive LiteLLM setup guide
- Updated all user-facing strings and help text
- Created release plan and migration documentation
### Phase 6: Testing & Validation
- Fixed all Rust tests for new naming scheme
- Updated snapshot tests in TUI (36 frame files)
- Fixed authentication storage tests
- Updated Chat Completions payload and SSE tests
- Fixed SDK tests for new API endpoints
- Ensured compatibility with Claude Sonnet 4.5 model
- Fixed test environment variables (LLMX_API_KEY, LLMX_BASE_URL)
### Phase 7: Build & Release Pipeline
- Updated GitHub Actions workflows for LLMX binary names
- Fixed rust-release.yml to reference llmx-rs/ instead of codex-rs/
- Updated CI/CD pipelines for new package names
- Made Apple code signing optional in release workflow
- Enhanced npm packaging resilience for partial platform builds
- Added Windows sandbox support to workspace
- Updated dotslash configuration for new binary names
### Phase 8: Final Polish
- Renamed all assets (.github images, labels, templates)
- Updated VSCode and DevContainer configurations
- Fixed all clippy warnings and formatting issues
- Applied cargo fmt and prettier formatting across codebase
- Updated issue templates and pull request templates
- Fixed all remaining UI text references
## Technical Details
**Breaking Changes:**
- Binary name changed from `codex` to `llmx`
- Config directory changed from `~/.codex/` to `~/.llmx/`
- Environment variables renamed (CODEX_* → LLMX_*)
- npm package renamed to `@valknar/llmx`
**New Features:**
- Support for 100+ LLM providers via LiteLLM
- Unified authentication with LLMX_API_KEY
- Enhanced model provider detection and handling
- Improved error handling and fallback mechanisms
**Files Changed:**
- 578 files modified across Rust, TypeScript, and documentation
- 30+ Rust crates renamed and updated
- Complete rebrand of UI, CLI, and documentation
- All tests updated and passing
**Dependencies:**
- Updated Cargo.lock with new package names
- Updated npm dependencies in llmx-cli
- Enhanced OpenAPI models for LLMX backend
This release establishes LLMX as a standalone project with comprehensive LiteLLM
integration, maintaining full backward compatibility with existing functionality
while opening support for a wide ecosystem of LLM providers.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Sebastian Krüger <support@pivoine.art>
2025-11-12 20:40:44 +01:00
|
|
|
match ConfigEditsBuilder::new(&self.config.llmx_home)
|
2025-10-29 20:52:46 +00:00
|
|
|
.with_profile(profile)
|
|
|
|
|
.set_model(Some(model.as_str()), effort)
|
|
|
|
|
.apply()
|
2025-09-15 00:25:43 +01:00
|
|
|
.await
|
|
|
|
|
{
|
|
|
|
|
Ok(()) => {
|
2025-10-02 12:38:24 -07:00
|
|
|
let effort_label = effort
|
|
|
|
|
.map(|eff| format!(" with {eff} reasoning"))
|
|
|
|
|
.unwrap_or_else(|| " with default reasoning".to_string());
|
2025-09-15 00:25:43 +01:00
|
|
|
if let Some(profile) = profile {
|
|
|
|
|
self.chat_widget.add_info_message(
|
2025-10-02 12:38:24 -07:00
|
|
|
format!(
|
|
|
|
|
"Model changed to {model}{effort_label} for {profile} profile"
|
|
|
|
|
),
|
2025-09-15 00:25:43 +01:00
|
|
|
None,
|
|
|
|
|
);
|
|
|
|
|
} else {
|
2025-10-01 14:29:05 -07:00
|
|
|
self.chat_widget.add_info_message(
|
2025-10-02 12:38:24 -07:00
|
|
|
format!("Model changed to {model}{effort_label}"),
|
2025-10-01 14:29:05 -07:00
|
|
|
None,
|
|
|
|
|
);
|
2025-09-15 00:25:43 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
Err(err) => {
|
|
|
|
|
tracing::error!(
|
|
|
|
|
error = %err,
|
|
|
|
|
"failed to persist model selection"
|
|
|
|
|
);
|
|
|
|
|
if let Some(profile) = profile {
|
|
|
|
|
self.chat_widget.add_error_message(format!(
|
|
|
|
|
"Failed to save model for profile `{profile}`: {err}"
|
|
|
|
|
));
|
|
|
|
|
} else {
|
|
|
|
|
self.chat_widget
|
|
|
|
|
.add_error_message(format!("Failed to save default model: {err}"));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-08-20 10:11:09 -07:00
|
|
|
}
|
|
|
|
|
AppEvent::UpdateAskForApprovalPolicy(policy) => {
|
2025-08-20 13:47:24 -07:00
|
|
|
self.chat_widget.set_approval_policy(policy);
|
2025-08-20 10:11:09 -07:00
|
|
|
}
|
|
|
|
|
AppEvent::UpdateSandboxPolicy(policy) => {
|
2025-11-06 10:44:42 -08:00
|
|
|
#[cfg(target_os = "windows")]
|
2025-11-08 11:35:43 -08:00
|
|
|
let policy_is_workspace_write_or_ro = matches!(
|
2025-11-06 10:44:42 -08:00
|
|
|
policy,
|
feat: Complete LLMX v0.1.0 - Rebrand from Codex with LiteLLM Integration
This release represents a comprehensive transformation of the codebase from Codex to LLMX,
enhanced with LiteLLM integration to support 100+ LLM providers through a unified API.
## Major Changes
### Phase 1: Repository & Infrastructure Setup
- Established new repository structure and branching strategy
- Created comprehensive project documentation (CLAUDE.md, LITELLM-SETUP.md)
- Set up development environment and tooling configuration
### Phase 2: Rust Workspace Transformation
- Renamed all Rust crates from `codex-*` to `llmx-*` (30+ crates)
- Updated package names, binary names, and workspace members
- Renamed core modules: codex.rs → llmx.rs, codex_delegate.rs → llmx_delegate.rs
- Updated all internal references, imports, and type names
- Renamed directories: codex-rs/ → llmx-rs/, codex-backend-openapi-models/ → llmx-backend-openapi-models/
- Fixed all Rust compilation errors after mass rename
### Phase 3: LiteLLM Integration
- Integrated LiteLLM for multi-provider LLM support (Anthropic, OpenAI, Azure, Google AI, AWS Bedrock, etc.)
- Implemented OpenAI-compatible Chat Completions API support
- Added model family detection and provider-specific handling
- Updated authentication to support LiteLLM API keys
- Renamed environment variables: OPENAI_BASE_URL → LLMX_BASE_URL
- Added LLMX_API_KEY for unified authentication
- Enhanced error handling for Chat Completions API responses
- Implemented fallback mechanisms between Responses API and Chat Completions API
### Phase 4: TypeScript/Node.js Components
- Renamed npm package: @codex/codex-cli → @valknar/llmx
- Updated TypeScript SDK to use new LLMX APIs and endpoints
- Fixed all TypeScript compilation and linting errors
- Updated SDK tests to support both API backends
- Enhanced mock server to handle multiple API formats
- Updated build scripts for cross-platform packaging
### Phase 5: Configuration & Documentation
- Updated all configuration files to use LLMX naming
- Rewrote README and documentation for LLMX branding
- Updated config paths: ~/.codex/ → ~/.llmx/
- Added comprehensive LiteLLM setup guide
- Updated all user-facing strings and help text
- Created release plan and migration documentation
### Phase 6: Testing & Validation
- Fixed all Rust tests for new naming scheme
- Updated snapshot tests in TUI (36 frame files)
- Fixed authentication storage tests
- Updated Chat Completions payload and SSE tests
- Fixed SDK tests for new API endpoints
- Ensured compatibility with Claude Sonnet 4.5 model
- Fixed test environment variables (LLMX_API_KEY, LLMX_BASE_URL)
### Phase 7: Build & Release Pipeline
- Updated GitHub Actions workflows for LLMX binary names
- Fixed rust-release.yml to reference llmx-rs/ instead of codex-rs/
- Updated CI/CD pipelines for new package names
- Made Apple code signing optional in release workflow
- Enhanced npm packaging resilience for partial platform builds
- Added Windows sandbox support to workspace
- Updated dotslash configuration for new binary names
### Phase 8: Final Polish
- Renamed all assets (.github images, labels, templates)
- Updated VSCode and DevContainer configurations
- Fixed all clippy warnings and formatting issues
- Applied cargo fmt and prettier formatting across codebase
- Updated issue templates and pull request templates
- Fixed all remaining UI text references
## Technical Details
**Breaking Changes:**
- Binary name changed from `codex` to `llmx`
- Config directory changed from `~/.codex/` to `~/.llmx/`
- Environment variables renamed (CODEX_* → LLMX_*)
- npm package renamed to `@valknar/llmx`
**New Features:**
- Support for 100+ LLM providers via LiteLLM
- Unified authentication with LLMX_API_KEY
- Enhanced model provider detection and handling
- Improved error handling and fallback mechanisms
**Files Changed:**
- 578 files modified across Rust, TypeScript, and documentation
- 30+ Rust crates renamed and updated
- Complete rebrand of UI, CLI, and documentation
- All tests updated and passing
**Dependencies:**
- Updated Cargo.lock with new package names
- Updated npm dependencies in llmx-cli
- Enhanced OpenAPI models for LLMX backend
This release establishes LLMX as a standalone project with comprehensive LiteLLM
integration, maintaining full backward compatibility with existing functionality
while opening support for a wide ecosystem of LLM providers.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Sebastian Krüger <support@pivoine.art>
2025-11-12 20:40:44 +01:00
|
|
|
llmx_core::protocol::SandboxPolicy::WorkspaceWrite { .. }
|
|
|
|
|
| llmx_core::protocol::SandboxPolicy::ReadOnly
|
2025-11-06 10:44:42 -08:00
|
|
|
);
|
|
|
|
|
|
2025-08-20 13:47:24 -07:00
|
|
|
self.chat_widget.set_sandbox_policy(policy);
|
2025-11-06 10:44:42 -08:00
|
|
|
|
2025-11-08 11:35:43 -08:00
|
|
|
// If sandbox policy becomes workspace-write or read-only, run the Windows world-writable scan.
|
2025-11-06 10:44:42 -08:00
|
|
|
#[cfg(target_os = "windows")]
|
|
|
|
|
{
|
|
|
|
|
// One-shot suppression if the user just confirmed continue.
|
|
|
|
|
if self.skip_world_writable_scan_once {
|
|
|
|
|
self.skip_world_writable_scan_once = false;
|
|
|
|
|
return Ok(true);
|
|
|
|
|
}
|
|
|
|
|
|
feat: Complete LLMX v0.1.0 - Rebrand from Codex with LiteLLM Integration
This release represents a comprehensive transformation of the codebase from Codex to LLMX,
enhanced with LiteLLM integration to support 100+ LLM providers through a unified API.
## Major Changes
### Phase 1: Repository & Infrastructure Setup
- Established new repository structure and branching strategy
- Created comprehensive project documentation (CLAUDE.md, LITELLM-SETUP.md)
- Set up development environment and tooling configuration
### Phase 2: Rust Workspace Transformation
- Renamed all Rust crates from `codex-*` to `llmx-*` (30+ crates)
- Updated package names, binary names, and workspace members
- Renamed core modules: codex.rs → llmx.rs, codex_delegate.rs → llmx_delegate.rs
- Updated all internal references, imports, and type names
- Renamed directories: codex-rs/ → llmx-rs/, codex-backend-openapi-models/ → llmx-backend-openapi-models/
- Fixed all Rust compilation errors after mass rename
### Phase 3: LiteLLM Integration
- Integrated LiteLLM for multi-provider LLM support (Anthropic, OpenAI, Azure, Google AI, AWS Bedrock, etc.)
- Implemented OpenAI-compatible Chat Completions API support
- Added model family detection and provider-specific handling
- Updated authentication to support LiteLLM API keys
- Renamed environment variables: OPENAI_BASE_URL → LLMX_BASE_URL
- Added LLMX_API_KEY for unified authentication
- Enhanced error handling for Chat Completions API responses
- Implemented fallback mechanisms between Responses API and Chat Completions API
### Phase 4: TypeScript/Node.js Components
- Renamed npm package: @codex/codex-cli → @valknar/llmx
- Updated TypeScript SDK to use new LLMX APIs and endpoints
- Fixed all TypeScript compilation and linting errors
- Updated SDK tests to support both API backends
- Enhanced mock server to handle multiple API formats
- Updated build scripts for cross-platform packaging
### Phase 5: Configuration & Documentation
- Updated all configuration files to use LLMX naming
- Rewrote README and documentation for LLMX branding
- Updated config paths: ~/.codex/ → ~/.llmx/
- Added comprehensive LiteLLM setup guide
- Updated all user-facing strings and help text
- Created release plan and migration documentation
### Phase 6: Testing & Validation
- Fixed all Rust tests for new naming scheme
- Updated snapshot tests in TUI (36 frame files)
- Fixed authentication storage tests
- Updated Chat Completions payload and SSE tests
- Fixed SDK tests for new API endpoints
- Ensured compatibility with Claude Sonnet 4.5 model
- Fixed test environment variables (LLMX_API_KEY, LLMX_BASE_URL)
### Phase 7: Build & Release Pipeline
- Updated GitHub Actions workflows for LLMX binary names
- Fixed rust-release.yml to reference llmx-rs/ instead of codex-rs/
- Updated CI/CD pipelines for new package names
- Made Apple code signing optional in release workflow
- Enhanced npm packaging resilience for partial platform builds
- Added Windows sandbox support to workspace
- Updated dotslash configuration for new binary names
### Phase 8: Final Polish
- Renamed all assets (.github images, labels, templates)
- Updated VSCode and DevContainer configurations
- Fixed all clippy warnings and formatting issues
- Applied cargo fmt and prettier formatting across codebase
- Updated issue templates and pull request templates
- Fixed all remaining UI text references
## Technical Details
**Breaking Changes:**
- Binary name changed from `codex` to `llmx`
- Config directory changed from `~/.codex/` to `~/.llmx/`
- Environment variables renamed (CODEX_* → LLMX_*)
- npm package renamed to `@valknar/llmx`
**New Features:**
- Support for 100+ LLM providers via LiteLLM
- Unified authentication with LLMX_API_KEY
- Enhanced model provider detection and handling
- Improved error handling and fallback mechanisms
**Files Changed:**
- 578 files modified across Rust, TypeScript, and documentation
- 30+ Rust crates renamed and updated
- Complete rebrand of UI, CLI, and documentation
- All tests updated and passing
**Dependencies:**
- Updated Cargo.lock with new package names
- Updated npm dependencies in llmx-cli
- Enhanced OpenAPI models for LLMX backend
This release establishes LLMX as a standalone project with comprehensive LiteLLM
integration, maintaining full backward compatibility with existing functionality
while opening support for a wide ecosystem of LLM providers.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Sebastian Krüger <support@pivoine.art>
2025-11-12 20:40:44 +01:00
|
|
|
let should_check = llmx_core::get_platform_sandbox().is_some()
|
2025-11-08 11:35:43 -08:00
|
|
|
&& policy_is_workspace_write_or_ro
|
2025-11-06 10:44:42 -08:00
|
|
|
&& !self.chat_widget.world_writable_warning_hidden();
|
|
|
|
|
if should_check {
|
|
|
|
|
let cwd = self.config.cwd.clone();
|
|
|
|
|
let env_map: std::collections::HashMap<String, String> =
|
|
|
|
|
std::env::vars().collect();
|
|
|
|
|
let tx = self.app_event_tx.clone();
|
feat: Complete LLMX v0.1.0 - Rebrand from Codex with LiteLLM Integration
This release represents a comprehensive transformation of the codebase from Codex to LLMX,
enhanced with LiteLLM integration to support 100+ LLM providers through a unified API.
## Major Changes
### Phase 1: Repository & Infrastructure Setup
- Established new repository structure and branching strategy
- Created comprehensive project documentation (CLAUDE.md, LITELLM-SETUP.md)
- Set up development environment and tooling configuration
### Phase 2: Rust Workspace Transformation
- Renamed all Rust crates from `codex-*` to `llmx-*` (30+ crates)
- Updated package names, binary names, and workspace members
- Renamed core modules: codex.rs → llmx.rs, codex_delegate.rs → llmx_delegate.rs
- Updated all internal references, imports, and type names
- Renamed directories: codex-rs/ → llmx-rs/, codex-backend-openapi-models/ → llmx-backend-openapi-models/
- Fixed all Rust compilation errors after mass rename
### Phase 3: LiteLLM Integration
- Integrated LiteLLM for multi-provider LLM support (Anthropic, OpenAI, Azure, Google AI, AWS Bedrock, etc.)
- Implemented OpenAI-compatible Chat Completions API support
- Added model family detection and provider-specific handling
- Updated authentication to support LiteLLM API keys
- Renamed environment variables: OPENAI_BASE_URL → LLMX_BASE_URL
- Added LLMX_API_KEY for unified authentication
- Enhanced error handling for Chat Completions API responses
- Implemented fallback mechanisms between Responses API and Chat Completions API
### Phase 4: TypeScript/Node.js Components
- Renamed npm package: @codex/codex-cli → @valknar/llmx
- Updated TypeScript SDK to use new LLMX APIs and endpoints
- Fixed all TypeScript compilation and linting errors
- Updated SDK tests to support both API backends
- Enhanced mock server to handle multiple API formats
- Updated build scripts for cross-platform packaging
### Phase 5: Configuration & Documentation
- Updated all configuration files to use LLMX naming
- Rewrote README and documentation for LLMX branding
- Updated config paths: ~/.codex/ → ~/.llmx/
- Added comprehensive LiteLLM setup guide
- Updated all user-facing strings and help text
- Created release plan and migration documentation
### Phase 6: Testing & Validation
- Fixed all Rust tests for new naming scheme
- Updated snapshot tests in TUI (36 frame files)
- Fixed authentication storage tests
- Updated Chat Completions payload and SSE tests
- Fixed SDK tests for new API endpoints
- Ensured compatibility with Claude Sonnet 4.5 model
- Fixed test environment variables (LLMX_API_KEY, LLMX_BASE_URL)
### Phase 7: Build & Release Pipeline
- Updated GitHub Actions workflows for LLMX binary names
- Fixed rust-release.yml to reference llmx-rs/ instead of codex-rs/
- Updated CI/CD pipelines for new package names
- Made Apple code signing optional in release workflow
- Enhanced npm packaging resilience for partial platform builds
- Added Windows sandbox support to workspace
- Updated dotslash configuration for new binary names
### Phase 8: Final Polish
- Renamed all assets (.github images, labels, templates)
- Updated VSCode and DevContainer configurations
- Fixed all clippy warnings and formatting issues
- Applied cargo fmt and prettier formatting across codebase
- Updated issue templates and pull request templates
- Fixed all remaining UI text references
## Technical Details
**Breaking Changes:**
- Binary name changed from `codex` to `llmx`
- Config directory changed from `~/.codex/` to `~/.llmx/`
- Environment variables renamed (CODEX_* → LLMX_*)
- npm package renamed to `@valknar/llmx`
**New Features:**
- Support for 100+ LLM providers via LiteLLM
- Unified authentication with LLMX_API_KEY
- Enhanced model provider detection and handling
- Improved error handling and fallback mechanisms
**Files Changed:**
- 578 files modified across Rust, TypeScript, and documentation
- 30+ Rust crates renamed and updated
- Complete rebrand of UI, CLI, and documentation
- All tests updated and passing
**Dependencies:**
- Updated Cargo.lock with new package names
- Updated npm dependencies in llmx-cli
- Enhanced OpenAPI models for LLMX backend
This release establishes LLMX as a standalone project with comprehensive LiteLLM
integration, maintaining full backward compatibility with existing functionality
while opening support for a wide ecosystem of LLM providers.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Sebastian Krüger <support@pivoine.art>
2025-11-12 20:40:44 +01:00
|
|
|
let logs_base_dir = self.config.llmx_home.clone();
|
2025-11-08 11:35:43 -08:00
|
|
|
Self::spawn_world_writable_scan(cwd, env_map, logs_base_dir, tx);
|
2025-11-06 10:44:42 -08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
AppEvent::SkipNextWorldWritableScan => {
|
|
|
|
|
self.skip_world_writable_scan_once = true;
|
feat: initial import of Rust implementation of Codex CLI in codex-rs/ (#629)
As stated in `codex-rs/README.md`:
Today, Codex CLI is written in TypeScript and requires Node.js 22+ to
run it. For a number of users, this runtime requirement inhibits
adoption: they would be better served by a standalone executable. As
maintainers, we want Codex to run efficiently in a wide range of
environments with minimal overhead. We also want to take advantage of
operating system-specific APIs to provide better sandboxing, where
possible.
To that end, we are moving forward with a Rust implementation of Codex
CLI contained in this folder, which has the following benefits:
- The CLI compiles to small, standalone, platform-specific binaries.
- Can make direct, native calls to
[seccomp](https://man7.org/linux/man-pages/man2/seccomp.2.html) and
[landlock](https://man7.org/linux/man-pages/man7/landlock.7.html) in
order to support sandboxing on Linux.
- No runtime garbage collection, resulting in lower memory consumption
and better, more predictable performance.
Currently, the Rust implementation is materially behind the TypeScript
implementation in functionality, so continue to use the TypeScript
implmentation for the time being. We will publish native executables via
GitHub Releases as soon as we feel the Rust version is usable.
2025-04-24 13:31:40 -07:00
|
|
|
}
|
2025-10-16 17:31:46 -07:00
|
|
|
AppEvent::UpdateFullAccessWarningAcknowledged(ack) => {
|
|
|
|
|
self.chat_widget.set_full_access_warning_acknowledged(ack);
|
|
|
|
|
}
|
2025-11-06 10:44:42 -08:00
|
|
|
AppEvent::UpdateWorldWritableWarningAcknowledged(ack) => {
|
|
|
|
|
self.chat_widget
|
|
|
|
|
.set_world_writable_warning_acknowledged(ack);
|
|
|
|
|
}
|
2025-11-10 09:21:53 -08:00
|
|
|
AppEvent::UpdateRateLimitSwitchPromptHidden(hidden) => {
|
|
|
|
|
self.chat_widget.set_rate_limit_switch_prompt_hidden(hidden);
|
|
|
|
|
}
|
2025-10-16 17:31:46 -07:00
|
|
|
AppEvent::PersistFullAccessWarningAcknowledged => {
|
feat: Complete LLMX v0.1.0 - Rebrand from Codex with LiteLLM Integration
This release represents a comprehensive transformation of the codebase from Codex to LLMX,
enhanced with LiteLLM integration to support 100+ LLM providers through a unified API.
## Major Changes
### Phase 1: Repository & Infrastructure Setup
- Established new repository structure and branching strategy
- Created comprehensive project documentation (CLAUDE.md, LITELLM-SETUP.md)
- Set up development environment and tooling configuration
### Phase 2: Rust Workspace Transformation
- Renamed all Rust crates from `codex-*` to `llmx-*` (30+ crates)
- Updated package names, binary names, and workspace members
- Renamed core modules: codex.rs → llmx.rs, codex_delegate.rs → llmx_delegate.rs
- Updated all internal references, imports, and type names
- Renamed directories: codex-rs/ → llmx-rs/, codex-backend-openapi-models/ → llmx-backend-openapi-models/
- Fixed all Rust compilation errors after mass rename
### Phase 3: LiteLLM Integration
- Integrated LiteLLM for multi-provider LLM support (Anthropic, OpenAI, Azure, Google AI, AWS Bedrock, etc.)
- Implemented OpenAI-compatible Chat Completions API support
- Added model family detection and provider-specific handling
- Updated authentication to support LiteLLM API keys
- Renamed environment variables: OPENAI_BASE_URL → LLMX_BASE_URL
- Added LLMX_API_KEY for unified authentication
- Enhanced error handling for Chat Completions API responses
- Implemented fallback mechanisms between Responses API and Chat Completions API
### Phase 4: TypeScript/Node.js Components
- Renamed npm package: @codex/codex-cli → @valknar/llmx
- Updated TypeScript SDK to use new LLMX APIs and endpoints
- Fixed all TypeScript compilation and linting errors
- Updated SDK tests to support both API backends
- Enhanced mock server to handle multiple API formats
- Updated build scripts for cross-platform packaging
### Phase 5: Configuration & Documentation
- Updated all configuration files to use LLMX naming
- Rewrote README and documentation for LLMX branding
- Updated config paths: ~/.codex/ → ~/.llmx/
- Added comprehensive LiteLLM setup guide
- Updated all user-facing strings and help text
- Created release plan and migration documentation
### Phase 6: Testing & Validation
- Fixed all Rust tests for new naming scheme
- Updated snapshot tests in TUI (36 frame files)
- Fixed authentication storage tests
- Updated Chat Completions payload and SSE tests
- Fixed SDK tests for new API endpoints
- Ensured compatibility with Claude Sonnet 4.5 model
- Fixed test environment variables (LLMX_API_KEY, LLMX_BASE_URL)
### Phase 7: Build & Release Pipeline
- Updated GitHub Actions workflows for LLMX binary names
- Fixed rust-release.yml to reference llmx-rs/ instead of codex-rs/
- Updated CI/CD pipelines for new package names
- Made Apple code signing optional in release workflow
- Enhanced npm packaging resilience for partial platform builds
- Added Windows sandbox support to workspace
- Updated dotslash configuration for new binary names
### Phase 8: Final Polish
- Renamed all assets (.github images, labels, templates)
- Updated VSCode and DevContainer configurations
- Fixed all clippy warnings and formatting issues
- Applied cargo fmt and prettier formatting across codebase
- Updated issue templates and pull request templates
- Fixed all remaining UI text references
## Technical Details
**Breaking Changes:**
- Binary name changed from `codex` to `llmx`
- Config directory changed from `~/.codex/` to `~/.llmx/`
- Environment variables renamed (CODEX_* → LLMX_*)
- npm package renamed to `@valknar/llmx`
**New Features:**
- Support for 100+ LLM providers via LiteLLM
- Unified authentication with LLMX_API_KEY
- Enhanced model provider detection and handling
- Improved error handling and fallback mechanisms
**Files Changed:**
- 578 files modified across Rust, TypeScript, and documentation
- 30+ Rust crates renamed and updated
- Complete rebrand of UI, CLI, and documentation
- All tests updated and passing
**Dependencies:**
- Updated Cargo.lock with new package names
- Updated npm dependencies in llmx-cli
- Enhanced OpenAPI models for LLMX backend
This release establishes LLMX as a standalone project with comprehensive LiteLLM
integration, maintaining full backward compatibility with existing functionality
while opening support for a wide ecosystem of LLM providers.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Sebastian Krüger <support@pivoine.art>
2025-11-12 20:40:44 +01:00
|
|
|
if let Err(err) = ConfigEditsBuilder::new(&self.config.llmx_home)
|
2025-10-29 20:52:46 +00:00
|
|
|
.set_hide_full_access_warning(true)
|
|
|
|
|
.apply()
|
|
|
|
|
.await
|
|
|
|
|
{
|
2025-10-16 17:31:46 -07:00
|
|
|
tracing::error!(
|
|
|
|
|
error = %err,
|
|
|
|
|
"failed to persist full access warning acknowledgement"
|
|
|
|
|
);
|
|
|
|
|
self.chat_widget.add_error_message(format!(
|
|
|
|
|
"Failed to save full access confirmation preference: {err}"
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-11-06 10:44:42 -08:00
|
|
|
AppEvent::PersistWorldWritableWarningAcknowledged => {
|
feat: Complete LLMX v0.1.0 - Rebrand from Codex with LiteLLM Integration
This release represents a comprehensive transformation of the codebase from Codex to LLMX,
enhanced with LiteLLM integration to support 100+ LLM providers through a unified API.
## Major Changes
### Phase 1: Repository & Infrastructure Setup
- Established new repository structure and branching strategy
- Created comprehensive project documentation (CLAUDE.md, LITELLM-SETUP.md)
- Set up development environment and tooling configuration
### Phase 2: Rust Workspace Transformation
- Renamed all Rust crates from `codex-*` to `llmx-*` (30+ crates)
- Updated package names, binary names, and workspace members
- Renamed core modules: codex.rs → llmx.rs, codex_delegate.rs → llmx_delegate.rs
- Updated all internal references, imports, and type names
- Renamed directories: codex-rs/ → llmx-rs/, codex-backend-openapi-models/ → llmx-backend-openapi-models/
- Fixed all Rust compilation errors after mass rename
### Phase 3: LiteLLM Integration
- Integrated LiteLLM for multi-provider LLM support (Anthropic, OpenAI, Azure, Google AI, AWS Bedrock, etc.)
- Implemented OpenAI-compatible Chat Completions API support
- Added model family detection and provider-specific handling
- Updated authentication to support LiteLLM API keys
- Renamed environment variables: OPENAI_BASE_URL → LLMX_BASE_URL
- Added LLMX_API_KEY for unified authentication
- Enhanced error handling for Chat Completions API responses
- Implemented fallback mechanisms between Responses API and Chat Completions API
### Phase 4: TypeScript/Node.js Components
- Renamed npm package: @codex/codex-cli → @valknar/llmx
- Updated TypeScript SDK to use new LLMX APIs and endpoints
- Fixed all TypeScript compilation and linting errors
- Updated SDK tests to support both API backends
- Enhanced mock server to handle multiple API formats
- Updated build scripts for cross-platform packaging
### Phase 5: Configuration & Documentation
- Updated all configuration files to use LLMX naming
- Rewrote README and documentation for LLMX branding
- Updated config paths: ~/.codex/ → ~/.llmx/
- Added comprehensive LiteLLM setup guide
- Updated all user-facing strings and help text
- Created release plan and migration documentation
### Phase 6: Testing & Validation
- Fixed all Rust tests for new naming scheme
- Updated snapshot tests in TUI (36 frame files)
- Fixed authentication storage tests
- Updated Chat Completions payload and SSE tests
- Fixed SDK tests for new API endpoints
- Ensured compatibility with Claude Sonnet 4.5 model
- Fixed test environment variables (LLMX_API_KEY, LLMX_BASE_URL)
### Phase 7: Build & Release Pipeline
- Updated GitHub Actions workflows for LLMX binary names
- Fixed rust-release.yml to reference llmx-rs/ instead of codex-rs/
- Updated CI/CD pipelines for new package names
- Made Apple code signing optional in release workflow
- Enhanced npm packaging resilience for partial platform builds
- Added Windows sandbox support to workspace
- Updated dotslash configuration for new binary names
### Phase 8: Final Polish
- Renamed all assets (.github images, labels, templates)
- Updated VSCode and DevContainer configurations
- Fixed all clippy warnings and formatting issues
- Applied cargo fmt and prettier formatting across codebase
- Updated issue templates and pull request templates
- Fixed all remaining UI text references
## Technical Details
**Breaking Changes:**
- Binary name changed from `codex` to `llmx`
- Config directory changed from `~/.codex/` to `~/.llmx/`
- Environment variables renamed (CODEX_* → LLMX_*)
- npm package renamed to `@valknar/llmx`
**New Features:**
- Support for 100+ LLM providers via LiteLLM
- Unified authentication with LLMX_API_KEY
- Enhanced model provider detection and handling
- Improved error handling and fallback mechanisms
**Files Changed:**
- 578 files modified across Rust, TypeScript, and documentation
- 30+ Rust crates renamed and updated
- Complete rebrand of UI, CLI, and documentation
- All tests updated and passing
**Dependencies:**
- Updated Cargo.lock with new package names
- Updated npm dependencies in llmx-cli
- Enhanced OpenAPI models for LLMX backend
This release establishes LLMX as a standalone project with comprehensive LiteLLM
integration, maintaining full backward compatibility with existing functionality
while opening support for a wide ecosystem of LLM providers.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Sebastian Krüger <support@pivoine.art>
2025-11-12 20:40:44 +01:00
|
|
|
if let Err(err) = ConfigEditsBuilder::new(&self.config.llmx_home)
|
2025-11-06 10:44:42 -08:00
|
|
|
.set_hide_world_writable_warning(true)
|
|
|
|
|
.apply()
|
|
|
|
|
.await
|
|
|
|
|
{
|
|
|
|
|
tracing::error!(
|
|
|
|
|
error = %err,
|
|
|
|
|
"failed to persist world-writable warning acknowledgement"
|
|
|
|
|
);
|
|
|
|
|
self.chat_widget.add_error_message(format!(
|
|
|
|
|
"Failed to save Auto mode warning preference: {err}"
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-11-10 09:21:53 -08:00
|
|
|
AppEvent::PersistRateLimitSwitchPromptHidden => {
|
feat: Complete LLMX v0.1.0 - Rebrand from Codex with LiteLLM Integration
This release represents a comprehensive transformation of the codebase from Codex to LLMX,
enhanced with LiteLLM integration to support 100+ LLM providers through a unified API.
## Major Changes
### Phase 1: Repository & Infrastructure Setup
- Established new repository structure and branching strategy
- Created comprehensive project documentation (CLAUDE.md, LITELLM-SETUP.md)
- Set up development environment and tooling configuration
### Phase 2: Rust Workspace Transformation
- Renamed all Rust crates from `codex-*` to `llmx-*` (30+ crates)
- Updated package names, binary names, and workspace members
- Renamed core modules: codex.rs → llmx.rs, codex_delegate.rs → llmx_delegate.rs
- Updated all internal references, imports, and type names
- Renamed directories: codex-rs/ → llmx-rs/, codex-backend-openapi-models/ → llmx-backend-openapi-models/
- Fixed all Rust compilation errors after mass rename
### Phase 3: LiteLLM Integration
- Integrated LiteLLM for multi-provider LLM support (Anthropic, OpenAI, Azure, Google AI, AWS Bedrock, etc.)
- Implemented OpenAI-compatible Chat Completions API support
- Added model family detection and provider-specific handling
- Updated authentication to support LiteLLM API keys
- Renamed environment variables: OPENAI_BASE_URL → LLMX_BASE_URL
- Added LLMX_API_KEY for unified authentication
- Enhanced error handling for Chat Completions API responses
- Implemented fallback mechanisms between Responses API and Chat Completions API
### Phase 4: TypeScript/Node.js Components
- Renamed npm package: @codex/codex-cli → @valknar/llmx
- Updated TypeScript SDK to use new LLMX APIs and endpoints
- Fixed all TypeScript compilation and linting errors
- Updated SDK tests to support both API backends
- Enhanced mock server to handle multiple API formats
- Updated build scripts for cross-platform packaging
### Phase 5: Configuration & Documentation
- Updated all configuration files to use LLMX naming
- Rewrote README and documentation for LLMX branding
- Updated config paths: ~/.codex/ → ~/.llmx/
- Added comprehensive LiteLLM setup guide
- Updated all user-facing strings and help text
- Created release plan and migration documentation
### Phase 6: Testing & Validation
- Fixed all Rust tests for new naming scheme
- Updated snapshot tests in TUI (36 frame files)
- Fixed authentication storage tests
- Updated Chat Completions payload and SSE tests
- Fixed SDK tests for new API endpoints
- Ensured compatibility with Claude Sonnet 4.5 model
- Fixed test environment variables (LLMX_API_KEY, LLMX_BASE_URL)
### Phase 7: Build & Release Pipeline
- Updated GitHub Actions workflows for LLMX binary names
- Fixed rust-release.yml to reference llmx-rs/ instead of codex-rs/
- Updated CI/CD pipelines for new package names
- Made Apple code signing optional in release workflow
- Enhanced npm packaging resilience for partial platform builds
- Added Windows sandbox support to workspace
- Updated dotslash configuration for new binary names
### Phase 8: Final Polish
- Renamed all assets (.github images, labels, templates)
- Updated VSCode and DevContainer configurations
- Fixed all clippy warnings and formatting issues
- Applied cargo fmt and prettier formatting across codebase
- Updated issue templates and pull request templates
- Fixed all remaining UI text references
## Technical Details
**Breaking Changes:**
- Binary name changed from `codex` to `llmx`
- Config directory changed from `~/.codex/` to `~/.llmx/`
- Environment variables renamed (CODEX_* → LLMX_*)
- npm package renamed to `@valknar/llmx`
**New Features:**
- Support for 100+ LLM providers via LiteLLM
- Unified authentication with LLMX_API_KEY
- Enhanced model provider detection and handling
- Improved error handling and fallback mechanisms
**Files Changed:**
- 578 files modified across Rust, TypeScript, and documentation
- 30+ Rust crates renamed and updated
- Complete rebrand of UI, CLI, and documentation
- All tests updated and passing
**Dependencies:**
- Updated Cargo.lock with new package names
- Updated npm dependencies in llmx-cli
- Enhanced OpenAPI models for LLMX backend
This release establishes LLMX as a standalone project with comprehensive LiteLLM
integration, maintaining full backward compatibility with existing functionality
while opening support for a wide ecosystem of LLM providers.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Sebastian Krüger <support@pivoine.art>
2025-11-12 20:40:44 +01:00
|
|
|
if let Err(err) = ConfigEditsBuilder::new(&self.config.llmx_home)
|
2025-11-10 09:21:53 -08:00
|
|
|
.set_hide_rate_limit_model_nudge(true)
|
|
|
|
|
.apply()
|
|
|
|
|
.await
|
|
|
|
|
{
|
|
|
|
|
tracing::error!(
|
|
|
|
|
error = %err,
|
|
|
|
|
"failed to persist rate limit switch prompt preference"
|
|
|
|
|
);
|
|
|
|
|
self.chat_widget.add_error_message(format!(
|
|
|
|
|
"Failed to save rate limit reminder preference: {err}"
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-10-16 17:31:46 -07:00
|
|
|
AppEvent::OpenApprovalsPopup => {
|
|
|
|
|
self.chat_widget.open_approvals_popup();
|
|
|
|
|
}
|
2025-09-21 20:18:35 -07:00
|
|
|
AppEvent::OpenReviewBranchPicker(cwd) => {
|
|
|
|
|
self.chat_widget.show_review_branch_picker(&cwd).await;
|
|
|
|
|
}
|
|
|
|
|
AppEvent::OpenReviewCommitPicker(cwd) => {
|
|
|
|
|
self.chat_widget.show_review_commit_picker(&cwd).await;
|
|
|
|
|
}
|
|
|
|
|
AppEvent::OpenReviewCustomPrompt => {
|
|
|
|
|
self.chat_widget.show_review_custom_prompt();
|
|
|
|
|
}
|
2025-10-01 14:29:05 -07:00
|
|
|
AppEvent::FullScreenApprovalRequest(request) => match request {
|
|
|
|
|
ApprovalRequest::ApplyPatch { cwd, changes, .. } => {
|
|
|
|
|
let _ = tui.enter_alt_screen();
|
|
|
|
|
let diff_summary = DiffSummary::new(changes, cwd);
|
|
|
|
|
self.overlay = Some(Overlay::new_static_with_renderables(
|
|
|
|
|
vec![diff_summary.into()],
|
|
|
|
|
"P A T C H".to_string(),
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
ApprovalRequest::Exec { command, .. } => {
|
|
|
|
|
let _ = tui.enter_alt_screen();
|
|
|
|
|
let full_cmd = strip_bash_lc_and_escape(&command);
|
|
|
|
|
let full_cmd_lines = highlight_bash_to_lines(&full_cmd);
|
|
|
|
|
self.overlay = Some(Overlay::new_static_with_lines(
|
|
|
|
|
full_cmd_lines,
|
|
|
|
|
"E X E C".to_string(),
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
},
|
feat: initial import of Rust implementation of Codex CLI in codex-rs/ (#629)
As stated in `codex-rs/README.md`:
Today, Codex CLI is written in TypeScript and requires Node.js 22+ to
run it. For a number of users, this runtime requirement inhibits
adoption: they would be better served by a standalone executable. As
maintainers, we want Codex to run efficiently in a wide range of
environments with minimal overhead. We also want to take advantage of
operating system-specific APIs to provide better sandboxing, where
possible.
To that end, we are moving forward with a Rust implementation of Codex
CLI contained in this folder, which has the following benefits:
- The CLI compiles to small, standalone, platform-specific binaries.
- Can make direct, native calls to
[seccomp](https://man7.org/linux/man-pages/man2/seccomp.2.html) and
[landlock](https://man7.org/linux/man-pages/man7/landlock.7.html) in
order to support sandboxing on Linux.
- No runtime garbage collection, resulting in lower memory consumption
and better, more predictable performance.
Currently, the Rust implementation is materially behind the TypeScript
implementation in functionality, so continue to use the TypeScript
implmentation for the time being. We will publish native executables via
GitHub Releases as soon as we feel the Rust version is usable.
2025-04-24 13:31:40 -07:00
|
|
|
}
|
2025-08-20 10:11:09 -07:00
|
|
|
Ok(true)
|
feat: initial import of Rust implementation of Codex CLI in codex-rs/ (#629)
As stated in `codex-rs/README.md`:
Today, Codex CLI is written in TypeScript and requires Node.js 22+ to
run it. For a number of users, this runtime requirement inhibits
adoption: they would be better served by a standalone executable. As
maintainers, we want Codex to run efficiently in a wide range of
environments with minimal overhead. We also want to take advantage of
operating system-specific APIs to provide better sandboxing, where
possible.
To that end, we are moving forward with a Rust implementation of Codex
CLI contained in this folder, which has the following benefits:
- The CLI compiles to small, standalone, platform-specific binaries.
- Can make direct, native calls to
[seccomp](https://man7.org/linux/man-pages/man2/seccomp.2.html) and
[landlock](https://man7.org/linux/man-pages/man7/landlock.7.html) in
order to support sandboxing on Linux.
- No runtime garbage collection, resulting in lower memory consumption
and better, more predictable performance.
Currently, the Rust implementation is materially behind the TypeScript
implementation in functionality, so continue to use the TypeScript
implmentation for the time being. We will publish native executables via
GitHub Releases as soon as we feel the Rust version is usable.
2025-04-24 13:31:40 -07:00
|
|
|
}
|
|
|
|
|
|
feat: Complete LLMX v0.1.0 - Rebrand from Codex with LiteLLM Integration
This release represents a comprehensive transformation of the codebase from Codex to LLMX,
enhanced with LiteLLM integration to support 100+ LLM providers through a unified API.
## Major Changes
### Phase 1: Repository & Infrastructure Setup
- Established new repository structure and branching strategy
- Created comprehensive project documentation (CLAUDE.md, LITELLM-SETUP.md)
- Set up development environment and tooling configuration
### Phase 2: Rust Workspace Transformation
- Renamed all Rust crates from `codex-*` to `llmx-*` (30+ crates)
- Updated package names, binary names, and workspace members
- Renamed core modules: codex.rs → llmx.rs, codex_delegate.rs → llmx_delegate.rs
- Updated all internal references, imports, and type names
- Renamed directories: codex-rs/ → llmx-rs/, codex-backend-openapi-models/ → llmx-backend-openapi-models/
- Fixed all Rust compilation errors after mass rename
### Phase 3: LiteLLM Integration
- Integrated LiteLLM for multi-provider LLM support (Anthropic, OpenAI, Azure, Google AI, AWS Bedrock, etc.)
- Implemented OpenAI-compatible Chat Completions API support
- Added model family detection and provider-specific handling
- Updated authentication to support LiteLLM API keys
- Renamed environment variables: OPENAI_BASE_URL → LLMX_BASE_URL
- Added LLMX_API_KEY for unified authentication
- Enhanced error handling for Chat Completions API responses
- Implemented fallback mechanisms between Responses API and Chat Completions API
### Phase 4: TypeScript/Node.js Components
- Renamed npm package: @codex/codex-cli → @valknar/llmx
- Updated TypeScript SDK to use new LLMX APIs and endpoints
- Fixed all TypeScript compilation and linting errors
- Updated SDK tests to support both API backends
- Enhanced mock server to handle multiple API formats
- Updated build scripts for cross-platform packaging
### Phase 5: Configuration & Documentation
- Updated all configuration files to use LLMX naming
- Rewrote README and documentation for LLMX branding
- Updated config paths: ~/.codex/ → ~/.llmx/
- Added comprehensive LiteLLM setup guide
- Updated all user-facing strings and help text
- Created release plan and migration documentation
### Phase 6: Testing & Validation
- Fixed all Rust tests for new naming scheme
- Updated snapshot tests in TUI (36 frame files)
- Fixed authentication storage tests
- Updated Chat Completions payload and SSE tests
- Fixed SDK tests for new API endpoints
- Ensured compatibility with Claude Sonnet 4.5 model
- Fixed test environment variables (LLMX_API_KEY, LLMX_BASE_URL)
### Phase 7: Build & Release Pipeline
- Updated GitHub Actions workflows for LLMX binary names
- Fixed rust-release.yml to reference llmx-rs/ instead of codex-rs/
- Updated CI/CD pipelines for new package names
- Made Apple code signing optional in release workflow
- Enhanced npm packaging resilience for partial platform builds
- Added Windows sandbox support to workspace
- Updated dotslash configuration for new binary names
### Phase 8: Final Polish
- Renamed all assets (.github images, labels, templates)
- Updated VSCode and DevContainer configurations
- Fixed all clippy warnings and formatting issues
- Applied cargo fmt and prettier formatting across codebase
- Updated issue templates and pull request templates
- Fixed all remaining UI text references
## Technical Details
**Breaking Changes:**
- Binary name changed from `codex` to `llmx`
- Config directory changed from `~/.codex/` to `~/.llmx/`
- Environment variables renamed (CODEX_* → LLMX_*)
- npm package renamed to `@valknar/llmx`
**New Features:**
- Support for 100+ LLM providers via LiteLLM
- Unified authentication with LLMX_API_KEY
- Enhanced model provider detection and handling
- Improved error handling and fallback mechanisms
**Files Changed:**
- 578 files modified across Rust, TypeScript, and documentation
- 30+ Rust crates renamed and updated
- Complete rebrand of UI, CLI, and documentation
- All tests updated and passing
**Dependencies:**
- Updated Cargo.lock with new package names
- Updated npm dependencies in llmx-cli
- Enhanced OpenAPI models for LLMX backend
This release establishes LLMX as a standalone project with comprehensive LiteLLM
integration, maintaining full backward compatibility with existing functionality
while opening support for a wide ecosystem of LLM providers.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Sebastian Krüger <support@pivoine.art>
2025-11-12 20:40:44 +01:00
|
|
|
pub(crate) fn token_usage(&self) -> llmx_core::protocol::TokenUsage {
|
2025-09-11 11:59:37 -07:00
|
|
|
self.chat_widget.token_usage()
|
2025-07-25 01:56:40 -07:00
|
|
|
}
|
|
|
|
|
|
2025-09-12 12:06:33 -07:00
|
|
|
fn on_update_reasoning_effort(&mut self, effort: Option<ReasoningEffortConfig>) {
|
2025-09-12 10:38:12 -07:00
|
|
|
self.chat_widget.set_reasoning_effort(effort);
|
|
|
|
|
self.config.model_reasoning_effort = effort;
|
2025-09-11 15:04:29 -07:00
|
|
|
}
|
|
|
|
|
|
2025-08-20 16:57:35 -07:00
|
|
|
async fn handle_key_event(&mut self, tui: &mut tui::Tui, key_event: KeyEvent) {
|
2025-08-20 13:47:24 -07:00
|
|
|
match key_event {
|
2025-08-20 16:57:35 -07:00
|
|
|
KeyEvent {
|
|
|
|
|
code: KeyCode::Char('t'),
|
|
|
|
|
modifiers: crossterm::event::KeyModifiers::CONTROL,
|
|
|
|
|
kind: KeyEventKind::Press,
|
|
|
|
|
..
|
|
|
|
|
} => {
|
2025-08-21 11:17:29 -07:00
|
|
|
// Enter alternate screen and set viewport to full size.
|
2025-08-22 09:41:15 -07:00
|
|
|
let _ = tui.enter_alt_screen();
|
2025-09-18 13:55:53 -07:00
|
|
|
self.overlay = Some(Overlay::new_transcript(self.transcript_cells.clone()));
|
2025-08-21 11:17:29 -07:00
|
|
|
tui.frame_requester().schedule_frame();
|
2025-08-20 16:57:35 -07:00
|
|
|
}
|
2025-08-25 15:38:46 -07:00
|
|
|
// Esc primes/advances backtracking only in normal (not working) mode
|
2025-10-15 13:57:50 -07:00
|
|
|
// with the composer focused and empty. In any other state, forward
|
|
|
|
|
// Esc so the active UI (e.g. status indicator, modals, popups)
|
|
|
|
|
// handles it.
|
2025-08-23 23:23:15 -07:00
|
|
|
KeyEvent {
|
|
|
|
|
code: KeyCode::Esc,
|
|
|
|
|
kind: KeyEventKind::Press | KeyEventKind::Repeat,
|
|
|
|
|
..
|
|
|
|
|
} => {
|
2025-08-25 15:38:46 -07:00
|
|
|
if self.chat_widget.is_normal_backtrack_mode()
|
|
|
|
|
&& self.chat_widget.composer_is_empty()
|
|
|
|
|
{
|
|
|
|
|
self.handle_backtrack_esc_key(tui);
|
|
|
|
|
} else {
|
|
|
|
|
self.chat_widget.handle_key_event(key_event);
|
|
|
|
|
}
|
2025-08-23 23:23:15 -07:00
|
|
|
}
|
|
|
|
|
// Enter confirms backtrack when primed + count > 0. Otherwise pass to widget.
|
|
|
|
|
KeyEvent {
|
|
|
|
|
code: KeyCode::Enter,
|
|
|
|
|
kind: KeyEventKind::Press,
|
|
|
|
|
..
|
|
|
|
|
} if self.backtrack.primed
|
2025-09-18 13:55:53 -07:00
|
|
|
&& self.backtrack.nth_user_message != usize::MAX
|
2025-08-23 23:23:15 -07:00
|
|
|
&& self.chat_widget.composer_is_empty() =>
|
|
|
|
|
{
|
|
|
|
|
// Delegate to helper for clarity; preserves behavior.
|
|
|
|
|
self.confirm_backtrack_from_main();
|
|
|
|
|
}
|
2025-08-20 13:47:24 -07:00
|
|
|
KeyEvent {
|
|
|
|
|
kind: KeyEventKind::Press | KeyEventKind::Repeat,
|
|
|
|
|
..
|
|
|
|
|
} => {
|
2025-08-23 23:23:15 -07:00
|
|
|
// Any non-Esc key press should cancel a primed backtrack.
|
|
|
|
|
// This avoids stale "Esc-primed" state after the user starts typing
|
|
|
|
|
// (even if they later backspace to empty).
|
|
|
|
|
if key_event.code != KeyCode::Esc && self.backtrack.primed {
|
|
|
|
|
self.reset_backtrack_state();
|
|
|
|
|
}
|
2025-08-20 13:47:24 -07:00
|
|
|
self.chat_widget.handle_key_event(key_event);
|
feat: initial import of Rust implementation of Codex CLI in codex-rs/ (#629)
As stated in `codex-rs/README.md`:
Today, Codex CLI is written in TypeScript and requires Node.js 22+ to
run it. For a number of users, this runtime requirement inhibits
adoption: they would be better served by a standalone executable. As
maintainers, we want Codex to run efficiently in a wide range of
environments with minimal overhead. We also want to take advantage of
operating system-specific APIs to provide better sandboxing, where
possible.
To that end, we are moving forward with a Rust implementation of Codex
CLI contained in this folder, which has the following benefits:
- The CLI compiles to small, standalone, platform-specific binaries.
- Can make direct, native calls to
[seccomp](https://man7.org/linux/man-pages/man2/seccomp.2.html) and
[landlock](https://man7.org/linux/man-pages/man7/landlock.7.html) in
order to support sandboxing on Linux.
- No runtime garbage collection, resulting in lower memory consumption
and better, more predictable performance.
Currently, the Rust implementation is materially behind the TypeScript
implementation in functionality, so continue to use the TypeScript
implmentation for the time being. We will publish native executables via
GitHub Releases as soon as we feel the Rust version is usable.
2025-04-24 13:31:40 -07:00
|
|
|
}
|
2025-08-20 13:47:24 -07:00
|
|
|
_ => {
|
|
|
|
|
// Ignore Release key events.
|
|
|
|
|
}
|
|
|
|
|
};
|
2025-08-18 20:22:48 -07:00
|
|
|
}
|
2025-11-06 10:44:42 -08:00
|
|
|
|
|
|
|
|
#[cfg(target_os = "windows")]
|
|
|
|
|
fn spawn_world_writable_scan(
|
|
|
|
|
cwd: PathBuf,
|
|
|
|
|
env_map: std::collections::HashMap<String, String>,
|
2025-11-07 21:28:55 -08:00
|
|
|
logs_base_dir: PathBuf,
|
2025-11-06 10:44:42 -08:00
|
|
|
tx: AppEventSender,
|
|
|
|
|
) {
|
2025-11-08 11:35:43 -08:00
|
|
|
#[inline]
|
|
|
|
|
fn normalize_windows_path_for_display(p: &std::path::Path) -> String {
|
|
|
|
|
let canon = dunce::canonicalize(p).unwrap_or_else(|_| p.to_path_buf());
|
|
|
|
|
canon.display().to_string().replace('/', "\\")
|
|
|
|
|
}
|
2025-11-06 10:44:42 -08:00
|
|
|
tokio::task::spawn_blocking(move || {
|
feat: Complete LLMX v0.1.0 - Rebrand from Codex with LiteLLM Integration
This release represents a comprehensive transformation of the codebase from Codex to LLMX,
enhanced with LiteLLM integration to support 100+ LLM providers through a unified API.
## Major Changes
### Phase 1: Repository & Infrastructure Setup
- Established new repository structure and branching strategy
- Created comprehensive project documentation (CLAUDE.md, LITELLM-SETUP.md)
- Set up development environment and tooling configuration
### Phase 2: Rust Workspace Transformation
- Renamed all Rust crates from `codex-*` to `llmx-*` (30+ crates)
- Updated package names, binary names, and workspace members
- Renamed core modules: codex.rs → llmx.rs, codex_delegate.rs → llmx_delegate.rs
- Updated all internal references, imports, and type names
- Renamed directories: codex-rs/ → llmx-rs/, codex-backend-openapi-models/ → llmx-backend-openapi-models/
- Fixed all Rust compilation errors after mass rename
### Phase 3: LiteLLM Integration
- Integrated LiteLLM for multi-provider LLM support (Anthropic, OpenAI, Azure, Google AI, AWS Bedrock, etc.)
- Implemented OpenAI-compatible Chat Completions API support
- Added model family detection and provider-specific handling
- Updated authentication to support LiteLLM API keys
- Renamed environment variables: OPENAI_BASE_URL → LLMX_BASE_URL
- Added LLMX_API_KEY for unified authentication
- Enhanced error handling for Chat Completions API responses
- Implemented fallback mechanisms between Responses API and Chat Completions API
### Phase 4: TypeScript/Node.js Components
- Renamed npm package: @codex/codex-cli → @valknar/llmx
- Updated TypeScript SDK to use new LLMX APIs and endpoints
- Fixed all TypeScript compilation and linting errors
- Updated SDK tests to support both API backends
- Enhanced mock server to handle multiple API formats
- Updated build scripts for cross-platform packaging
### Phase 5: Configuration & Documentation
- Updated all configuration files to use LLMX naming
- Rewrote README and documentation for LLMX branding
- Updated config paths: ~/.codex/ → ~/.llmx/
- Added comprehensive LiteLLM setup guide
- Updated all user-facing strings and help text
- Created release plan and migration documentation
### Phase 6: Testing & Validation
- Fixed all Rust tests for new naming scheme
- Updated snapshot tests in TUI (36 frame files)
- Fixed authentication storage tests
- Updated Chat Completions payload and SSE tests
- Fixed SDK tests for new API endpoints
- Ensured compatibility with Claude Sonnet 4.5 model
- Fixed test environment variables (LLMX_API_KEY, LLMX_BASE_URL)
### Phase 7: Build & Release Pipeline
- Updated GitHub Actions workflows for LLMX binary names
- Fixed rust-release.yml to reference llmx-rs/ instead of codex-rs/
- Updated CI/CD pipelines for new package names
- Made Apple code signing optional in release workflow
- Enhanced npm packaging resilience for partial platform builds
- Added Windows sandbox support to workspace
- Updated dotslash configuration for new binary names
### Phase 8: Final Polish
- Renamed all assets (.github images, labels, templates)
- Updated VSCode and DevContainer configurations
- Fixed all clippy warnings and formatting issues
- Applied cargo fmt and prettier formatting across codebase
- Updated issue templates and pull request templates
- Fixed all remaining UI text references
## Technical Details
**Breaking Changes:**
- Binary name changed from `codex` to `llmx`
- Config directory changed from `~/.codex/` to `~/.llmx/`
- Environment variables renamed (CODEX_* → LLMX_*)
- npm package renamed to `@valknar/llmx`
**New Features:**
- Support for 100+ LLM providers via LiteLLM
- Unified authentication with LLMX_API_KEY
- Enhanced model provider detection and handling
- Improved error handling and fallback mechanisms
**Files Changed:**
- 578 files modified across Rust, TypeScript, and documentation
- 30+ Rust crates renamed and updated
- Complete rebrand of UI, CLI, and documentation
- All tests updated and passing
**Dependencies:**
- Updated Cargo.lock with new package names
- Updated npm dependencies in llmx-cli
- Enhanced OpenAPI models for LLMX backend
This release establishes LLMX as a standalone project with comprehensive LiteLLM
integration, maintaining full backward compatibility with existing functionality
while opening support for a wide ecosystem of LLM providers.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Sebastian Krüger <support@pivoine.art>
2025-11-12 20:40:44 +01:00
|
|
|
let result = llmx_windows_sandbox::preflight_audit_everyone_writable(
|
2025-11-07 21:28:55 -08:00
|
|
|
&cwd,
|
|
|
|
|
&env_map,
|
|
|
|
|
Some(logs_base_dir.as_path()),
|
2025-11-08 11:35:43 -08:00
|
|
|
);
|
|
|
|
|
if let Ok(ref paths) = result
|
|
|
|
|
&& !paths.is_empty()
|
2025-11-07 21:28:55 -08:00
|
|
|
{
|
2025-11-08 11:35:43 -08:00
|
|
|
let as_strings: Vec<String> = paths
|
|
|
|
|
.iter()
|
|
|
|
|
.map(|p| normalize_windows_path_for_display(p))
|
|
|
|
|
.collect();
|
|
|
|
|
let sample_paths: Vec<String> = as_strings.iter().take(3).cloned().collect();
|
|
|
|
|
let extra_count = if as_strings.len() > sample_paths.len() {
|
|
|
|
|
as_strings.len() - sample_paths.len()
|
2025-11-06 10:44:42 -08:00
|
|
|
} else {
|
2025-11-08 11:35:43 -08:00
|
|
|
0
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
tx.send(AppEvent::OpenWorldWritableWarningConfirmation {
|
|
|
|
|
preset: None,
|
|
|
|
|
sample_paths,
|
|
|
|
|
extra_count,
|
|
|
|
|
failed_scan: false,
|
|
|
|
|
});
|
|
|
|
|
} else if result.is_err() {
|
|
|
|
|
// Scan failed: still warn, but with no examples and mark as failed.
|
|
|
|
|
let sample_paths: Vec<String> = Vec::new();
|
|
|
|
|
let extra_count = 0usize;
|
|
|
|
|
tx.send(AppEvent::OpenWorldWritableWarningConfirmation {
|
|
|
|
|
preset: None,
|
|
|
|
|
sample_paths,
|
|
|
|
|
extra_count,
|
|
|
|
|
failed_scan: true,
|
|
|
|
|
});
|
2025-11-06 10:44:42 -08:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
2025-08-18 20:22:48 -07:00
|
|
|
}
|
2025-09-12 10:38:12 -07:00
|
|
|
|
|
|
|
|
#[cfg(test)]
|
|
|
|
|
mod tests {
|
|
|
|
|
use super::*;
|
|
|
|
|
use crate::app_backtrack::BacktrackState;
|
2025-09-22 11:16:25 -07:00
|
|
|
use crate::app_backtrack::user_count;
|
2025-09-12 10:38:12 -07:00
|
|
|
use crate::chatwidget::tests::make_chatwidget_manual_with_sender;
|
|
|
|
|
use crate::file_search::FileSearchManager;
|
2025-09-22 11:16:25 -07:00
|
|
|
use crate::history_cell::AgentMessageCell;
|
|
|
|
|
use crate::history_cell::HistoryCell;
|
|
|
|
|
use crate::history_cell::UserHistoryCell;
|
|
|
|
|
use crate::history_cell::new_session_info;
|
feat: Complete LLMX v0.1.0 - Rebrand from Codex with LiteLLM Integration
This release represents a comprehensive transformation of the codebase from Codex to LLMX,
enhanced with LiteLLM integration to support 100+ LLM providers through a unified API.
## Major Changes
### Phase 1: Repository & Infrastructure Setup
- Established new repository structure and branching strategy
- Created comprehensive project documentation (CLAUDE.md, LITELLM-SETUP.md)
- Set up development environment and tooling configuration
### Phase 2: Rust Workspace Transformation
- Renamed all Rust crates from `codex-*` to `llmx-*` (30+ crates)
- Updated package names, binary names, and workspace members
- Renamed core modules: codex.rs → llmx.rs, codex_delegate.rs → llmx_delegate.rs
- Updated all internal references, imports, and type names
- Renamed directories: codex-rs/ → llmx-rs/, codex-backend-openapi-models/ → llmx-backend-openapi-models/
- Fixed all Rust compilation errors after mass rename
### Phase 3: LiteLLM Integration
- Integrated LiteLLM for multi-provider LLM support (Anthropic, OpenAI, Azure, Google AI, AWS Bedrock, etc.)
- Implemented OpenAI-compatible Chat Completions API support
- Added model family detection and provider-specific handling
- Updated authentication to support LiteLLM API keys
- Renamed environment variables: OPENAI_BASE_URL → LLMX_BASE_URL
- Added LLMX_API_KEY for unified authentication
- Enhanced error handling for Chat Completions API responses
- Implemented fallback mechanisms between Responses API and Chat Completions API
### Phase 4: TypeScript/Node.js Components
- Renamed npm package: @codex/codex-cli → @valknar/llmx
- Updated TypeScript SDK to use new LLMX APIs and endpoints
- Fixed all TypeScript compilation and linting errors
- Updated SDK tests to support both API backends
- Enhanced mock server to handle multiple API formats
- Updated build scripts for cross-platform packaging
### Phase 5: Configuration & Documentation
- Updated all configuration files to use LLMX naming
- Rewrote README and documentation for LLMX branding
- Updated config paths: ~/.codex/ → ~/.llmx/
- Added comprehensive LiteLLM setup guide
- Updated all user-facing strings and help text
- Created release plan and migration documentation
### Phase 6: Testing & Validation
- Fixed all Rust tests for new naming scheme
- Updated snapshot tests in TUI (36 frame files)
- Fixed authentication storage tests
- Updated Chat Completions payload and SSE tests
- Fixed SDK tests for new API endpoints
- Ensured compatibility with Claude Sonnet 4.5 model
- Fixed test environment variables (LLMX_API_KEY, LLMX_BASE_URL)
### Phase 7: Build & Release Pipeline
- Updated GitHub Actions workflows for LLMX binary names
- Fixed rust-release.yml to reference llmx-rs/ instead of codex-rs/
- Updated CI/CD pipelines for new package names
- Made Apple code signing optional in release workflow
- Enhanced npm packaging resilience for partial platform builds
- Added Windows sandbox support to workspace
- Updated dotslash configuration for new binary names
### Phase 8: Final Polish
- Renamed all assets (.github images, labels, templates)
- Updated VSCode and DevContainer configurations
- Fixed all clippy warnings and formatting issues
- Applied cargo fmt and prettier formatting across codebase
- Updated issue templates and pull request templates
- Fixed all remaining UI text references
## Technical Details
**Breaking Changes:**
- Binary name changed from `codex` to `llmx`
- Config directory changed from `~/.codex/` to `~/.llmx/`
- Environment variables renamed (CODEX_* → LLMX_*)
- npm package renamed to `@valknar/llmx`
**New Features:**
- Support for 100+ LLM providers via LiteLLM
- Unified authentication with LLMX_API_KEY
- Enhanced model provider detection and handling
- Improved error handling and fallback mechanisms
**Files Changed:**
- 578 files modified across Rust, TypeScript, and documentation
- 30+ Rust crates renamed and updated
- Complete rebrand of UI, CLI, and documentation
- All tests updated and passing
**Dependencies:**
- Updated Cargo.lock with new package names
- Updated npm dependencies in llmx-cli
- Enhanced OpenAPI models for LLMX backend
This release establishes LLMX as a standalone project with comprehensive LiteLLM
integration, maintaining full backward compatibility with existing functionality
while opening support for a wide ecosystem of LLM providers.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Sebastian Krüger <support@pivoine.art>
2025-11-12 20:40:44 +01:00
|
|
|
use llmx_core::AuthManager;
|
|
|
|
|
use llmx_core::ConversationManager;
|
|
|
|
|
use llmx_core::LlmxAuth;
|
|
|
|
|
use llmx_core::protocol::SessionConfiguredEvent;
|
|
|
|
|
use llmx_protocol::ConversationId;
|
2025-09-22 11:16:25 -07:00
|
|
|
use ratatui::prelude::Line;
|
|
|
|
|
use std::path::PathBuf;
|
2025-09-12 10:38:12 -07:00
|
|
|
use std::sync::Arc;
|
|
|
|
|
use std::sync::atomic::AtomicBool;
|
|
|
|
|
|
|
|
|
|
fn make_test_app() -> App {
|
|
|
|
|
let (chat_widget, app_event_tx, _rx, _op_rx) = make_chatwidget_manual_with_sender();
|
|
|
|
|
let config = chat_widget.config_ref().clone();
|
|
|
|
|
|
feat: Complete LLMX v0.1.0 - Rebrand from Codex with LiteLLM Integration
This release represents a comprehensive transformation of the codebase from Codex to LLMX,
enhanced with LiteLLM integration to support 100+ LLM providers through a unified API.
## Major Changes
### Phase 1: Repository & Infrastructure Setup
- Established new repository structure and branching strategy
- Created comprehensive project documentation (CLAUDE.md, LITELLM-SETUP.md)
- Set up development environment and tooling configuration
### Phase 2: Rust Workspace Transformation
- Renamed all Rust crates from `codex-*` to `llmx-*` (30+ crates)
- Updated package names, binary names, and workspace members
- Renamed core modules: codex.rs → llmx.rs, codex_delegate.rs → llmx_delegate.rs
- Updated all internal references, imports, and type names
- Renamed directories: codex-rs/ → llmx-rs/, codex-backend-openapi-models/ → llmx-backend-openapi-models/
- Fixed all Rust compilation errors after mass rename
### Phase 3: LiteLLM Integration
- Integrated LiteLLM for multi-provider LLM support (Anthropic, OpenAI, Azure, Google AI, AWS Bedrock, etc.)
- Implemented OpenAI-compatible Chat Completions API support
- Added model family detection and provider-specific handling
- Updated authentication to support LiteLLM API keys
- Renamed environment variables: OPENAI_BASE_URL → LLMX_BASE_URL
- Added LLMX_API_KEY for unified authentication
- Enhanced error handling for Chat Completions API responses
- Implemented fallback mechanisms between Responses API and Chat Completions API
### Phase 4: TypeScript/Node.js Components
- Renamed npm package: @codex/codex-cli → @valknar/llmx
- Updated TypeScript SDK to use new LLMX APIs and endpoints
- Fixed all TypeScript compilation and linting errors
- Updated SDK tests to support both API backends
- Enhanced mock server to handle multiple API formats
- Updated build scripts for cross-platform packaging
### Phase 5: Configuration & Documentation
- Updated all configuration files to use LLMX naming
- Rewrote README and documentation for LLMX branding
- Updated config paths: ~/.codex/ → ~/.llmx/
- Added comprehensive LiteLLM setup guide
- Updated all user-facing strings and help text
- Created release plan and migration documentation
### Phase 6: Testing & Validation
- Fixed all Rust tests for new naming scheme
- Updated snapshot tests in TUI (36 frame files)
- Fixed authentication storage tests
- Updated Chat Completions payload and SSE tests
- Fixed SDK tests for new API endpoints
- Ensured compatibility with Claude Sonnet 4.5 model
- Fixed test environment variables (LLMX_API_KEY, LLMX_BASE_URL)
### Phase 7: Build & Release Pipeline
- Updated GitHub Actions workflows for LLMX binary names
- Fixed rust-release.yml to reference llmx-rs/ instead of codex-rs/
- Updated CI/CD pipelines for new package names
- Made Apple code signing optional in release workflow
- Enhanced npm packaging resilience for partial platform builds
- Added Windows sandbox support to workspace
- Updated dotslash configuration for new binary names
### Phase 8: Final Polish
- Renamed all assets (.github images, labels, templates)
- Updated VSCode and DevContainer configurations
- Fixed all clippy warnings and formatting issues
- Applied cargo fmt and prettier formatting across codebase
- Updated issue templates and pull request templates
- Fixed all remaining UI text references
## Technical Details
**Breaking Changes:**
- Binary name changed from `codex` to `llmx`
- Config directory changed from `~/.codex/` to `~/.llmx/`
- Environment variables renamed (CODEX_* → LLMX_*)
- npm package renamed to `@valknar/llmx`
**New Features:**
- Support for 100+ LLM providers via LiteLLM
- Unified authentication with LLMX_API_KEY
- Enhanced model provider detection and handling
- Improved error handling and fallback mechanisms
**Files Changed:**
- 578 files modified across Rust, TypeScript, and documentation
- 30+ Rust crates renamed and updated
- Complete rebrand of UI, CLI, and documentation
- All tests updated and passing
**Dependencies:**
- Updated Cargo.lock with new package names
- Updated npm dependencies in llmx-cli
- Enhanced OpenAPI models for LLMX backend
This release establishes LLMX as a standalone project with comprehensive LiteLLM
integration, maintaining full backward compatibility with existing functionality
while opening support for a wide ecosystem of LLM providers.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Sebastian Krüger <support@pivoine.art>
2025-11-12 20:40:44 +01:00
|
|
|
let server = Arc::new(ConversationManager::with_auth(LlmxAuth::from_api_key(
|
2025-09-12 10:38:12 -07:00
|
|
|
"Test API Key",
|
|
|
|
|
)));
|
2025-09-14 21:32:18 -04:00
|
|
|
let auth_manager =
|
feat: Complete LLMX v0.1.0 - Rebrand from Codex with LiteLLM Integration
This release represents a comprehensive transformation of the codebase from Codex to LLMX,
enhanced with LiteLLM integration to support 100+ LLM providers through a unified API.
## Major Changes
### Phase 1: Repository & Infrastructure Setup
- Established new repository structure and branching strategy
- Created comprehensive project documentation (CLAUDE.md, LITELLM-SETUP.md)
- Set up development environment and tooling configuration
### Phase 2: Rust Workspace Transformation
- Renamed all Rust crates from `codex-*` to `llmx-*` (30+ crates)
- Updated package names, binary names, and workspace members
- Renamed core modules: codex.rs → llmx.rs, codex_delegate.rs → llmx_delegate.rs
- Updated all internal references, imports, and type names
- Renamed directories: codex-rs/ → llmx-rs/, codex-backend-openapi-models/ → llmx-backend-openapi-models/
- Fixed all Rust compilation errors after mass rename
### Phase 3: LiteLLM Integration
- Integrated LiteLLM for multi-provider LLM support (Anthropic, OpenAI, Azure, Google AI, AWS Bedrock, etc.)
- Implemented OpenAI-compatible Chat Completions API support
- Added model family detection and provider-specific handling
- Updated authentication to support LiteLLM API keys
- Renamed environment variables: OPENAI_BASE_URL → LLMX_BASE_URL
- Added LLMX_API_KEY for unified authentication
- Enhanced error handling for Chat Completions API responses
- Implemented fallback mechanisms between Responses API and Chat Completions API
### Phase 4: TypeScript/Node.js Components
- Renamed npm package: @codex/codex-cli → @valknar/llmx
- Updated TypeScript SDK to use new LLMX APIs and endpoints
- Fixed all TypeScript compilation and linting errors
- Updated SDK tests to support both API backends
- Enhanced mock server to handle multiple API formats
- Updated build scripts for cross-platform packaging
### Phase 5: Configuration & Documentation
- Updated all configuration files to use LLMX naming
- Rewrote README and documentation for LLMX branding
- Updated config paths: ~/.codex/ → ~/.llmx/
- Added comprehensive LiteLLM setup guide
- Updated all user-facing strings and help text
- Created release plan and migration documentation
### Phase 6: Testing & Validation
- Fixed all Rust tests for new naming scheme
- Updated snapshot tests in TUI (36 frame files)
- Fixed authentication storage tests
- Updated Chat Completions payload and SSE tests
- Fixed SDK tests for new API endpoints
- Ensured compatibility with Claude Sonnet 4.5 model
- Fixed test environment variables (LLMX_API_KEY, LLMX_BASE_URL)
### Phase 7: Build & Release Pipeline
- Updated GitHub Actions workflows for LLMX binary names
- Fixed rust-release.yml to reference llmx-rs/ instead of codex-rs/
- Updated CI/CD pipelines for new package names
- Made Apple code signing optional in release workflow
- Enhanced npm packaging resilience for partial platform builds
- Added Windows sandbox support to workspace
- Updated dotslash configuration for new binary names
### Phase 8: Final Polish
- Renamed all assets (.github images, labels, templates)
- Updated VSCode and DevContainer configurations
- Fixed all clippy warnings and formatting issues
- Applied cargo fmt and prettier formatting across codebase
- Updated issue templates and pull request templates
- Fixed all remaining UI text references
## Technical Details
**Breaking Changes:**
- Binary name changed from `codex` to `llmx`
- Config directory changed from `~/.codex/` to `~/.llmx/`
- Environment variables renamed (CODEX_* → LLMX_*)
- npm package renamed to `@valknar/llmx`
**New Features:**
- Support for 100+ LLM providers via LiteLLM
- Unified authentication with LLMX_API_KEY
- Enhanced model provider detection and handling
- Improved error handling and fallback mechanisms
**Files Changed:**
- 578 files modified across Rust, TypeScript, and documentation
- 30+ Rust crates renamed and updated
- Complete rebrand of UI, CLI, and documentation
- All tests updated and passing
**Dependencies:**
- Updated Cargo.lock with new package names
- Updated npm dependencies in llmx-cli
- Enhanced OpenAPI models for LLMX backend
This release establishes LLMX as a standalone project with comprehensive LiteLLM
integration, maintaining full backward compatibility with existing functionality
while opening support for a wide ecosystem of LLM providers.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Sebastian Krüger <support@pivoine.art>
2025-11-12 20:40:44 +01:00
|
|
|
AuthManager::from_auth_for_testing(LlmxAuth::from_api_key("Test API Key"));
|
2025-09-12 10:38:12 -07:00
|
|
|
let file_search = FileSearchManager::new(config.cwd.clone(), app_event_tx.clone());
|
|
|
|
|
|
|
|
|
|
App {
|
|
|
|
|
server,
|
|
|
|
|
app_event_tx,
|
|
|
|
|
chat_widget,
|
2025-09-14 21:32:18 -04:00
|
|
|
auth_manager,
|
2025-09-12 10:38:12 -07:00
|
|
|
config,
|
|
|
|
|
active_profile: None,
|
|
|
|
|
file_search,
|
2025-09-18 13:55:53 -07:00
|
|
|
transcript_cells: Vec::new(),
|
2025-09-12 10:38:12 -07:00
|
|
|
overlay: None,
|
|
|
|
|
deferred_history_lines: Vec::new(),
|
|
|
|
|
has_emitted_history_lines: false,
|
|
|
|
|
enhanced_keys_supported: false,
|
|
|
|
|
commit_anim_running: Arc::new(AtomicBool::new(false)),
|
|
|
|
|
backtrack: BacktrackState::default(),
|
feat: Complete LLMX v0.1.0 - Rebrand from Codex with LiteLLM Integration
This release represents a comprehensive transformation of the codebase from Codex to LLMX,
enhanced with LiteLLM integration to support 100+ LLM providers through a unified API.
## Major Changes
### Phase 1: Repository & Infrastructure Setup
- Established new repository structure and branching strategy
- Created comprehensive project documentation (CLAUDE.md, LITELLM-SETUP.md)
- Set up development environment and tooling configuration
### Phase 2: Rust Workspace Transformation
- Renamed all Rust crates from `codex-*` to `llmx-*` (30+ crates)
- Updated package names, binary names, and workspace members
- Renamed core modules: codex.rs → llmx.rs, codex_delegate.rs → llmx_delegate.rs
- Updated all internal references, imports, and type names
- Renamed directories: codex-rs/ → llmx-rs/, codex-backend-openapi-models/ → llmx-backend-openapi-models/
- Fixed all Rust compilation errors after mass rename
### Phase 3: LiteLLM Integration
- Integrated LiteLLM for multi-provider LLM support (Anthropic, OpenAI, Azure, Google AI, AWS Bedrock, etc.)
- Implemented OpenAI-compatible Chat Completions API support
- Added model family detection and provider-specific handling
- Updated authentication to support LiteLLM API keys
- Renamed environment variables: OPENAI_BASE_URL → LLMX_BASE_URL
- Added LLMX_API_KEY for unified authentication
- Enhanced error handling for Chat Completions API responses
- Implemented fallback mechanisms between Responses API and Chat Completions API
### Phase 4: TypeScript/Node.js Components
- Renamed npm package: @codex/codex-cli → @valknar/llmx
- Updated TypeScript SDK to use new LLMX APIs and endpoints
- Fixed all TypeScript compilation and linting errors
- Updated SDK tests to support both API backends
- Enhanced mock server to handle multiple API formats
- Updated build scripts for cross-platform packaging
### Phase 5: Configuration & Documentation
- Updated all configuration files to use LLMX naming
- Rewrote README and documentation for LLMX branding
- Updated config paths: ~/.codex/ → ~/.llmx/
- Added comprehensive LiteLLM setup guide
- Updated all user-facing strings and help text
- Created release plan and migration documentation
### Phase 6: Testing & Validation
- Fixed all Rust tests for new naming scheme
- Updated snapshot tests in TUI (36 frame files)
- Fixed authentication storage tests
- Updated Chat Completions payload and SSE tests
- Fixed SDK tests for new API endpoints
- Ensured compatibility with Claude Sonnet 4.5 model
- Fixed test environment variables (LLMX_API_KEY, LLMX_BASE_URL)
### Phase 7: Build & Release Pipeline
- Updated GitHub Actions workflows for LLMX binary names
- Fixed rust-release.yml to reference llmx-rs/ instead of codex-rs/
- Updated CI/CD pipelines for new package names
- Made Apple code signing optional in release workflow
- Enhanced npm packaging resilience for partial platform builds
- Added Windows sandbox support to workspace
- Updated dotslash configuration for new binary names
### Phase 8: Final Polish
- Renamed all assets (.github images, labels, templates)
- Updated VSCode and DevContainer configurations
- Fixed all clippy warnings and formatting issues
- Applied cargo fmt and prettier formatting across codebase
- Updated issue templates and pull request templates
- Fixed all remaining UI text references
## Technical Details
**Breaking Changes:**
- Binary name changed from `codex` to `llmx`
- Config directory changed from `~/.codex/` to `~/.llmx/`
- Environment variables renamed (CODEX_* → LLMX_*)
- npm package renamed to `@valknar/llmx`
**New Features:**
- Support for 100+ LLM providers via LiteLLM
- Unified authentication with LLMX_API_KEY
- Enhanced model provider detection and handling
- Improved error handling and fallback mechanisms
**Files Changed:**
- 578 files modified across Rust, TypeScript, and documentation
- 30+ Rust crates renamed and updated
- Complete rebrand of UI, CLI, and documentation
- All tests updated and passing
**Dependencies:**
- Updated Cargo.lock with new package names
- Updated npm dependencies in llmx-cli
- Enhanced OpenAPI models for LLMX backend
This release establishes LLMX as a standalone project with comprehensive LiteLLM
integration, maintaining full backward compatibility with existing functionality
while opening support for a wide ecosystem of LLM providers.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Sebastian Krüger <support@pivoine.art>
2025-11-12 20:40:44 +01:00
|
|
|
feedback: llmx_feedback::LlmxFeedback::new(),
|
2025-10-15 16:11:20 -07:00
|
|
|
pending_update_action: None,
|
2025-11-06 10:44:42 -08:00
|
|
|
skip_world_writable_scan_once: false,
|
2025-09-12 10:38:12 -07:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#[test]
|
2025-09-15 00:25:43 +01:00
|
|
|
fn update_reasoning_effort_updates_config() {
|
2025-09-12 10:38:12 -07:00
|
|
|
let mut app = make_test_app();
|
2025-09-12 12:06:33 -07:00
|
|
|
app.config.model_reasoning_effort = Some(ReasoningEffortConfig::Medium);
|
2025-09-12 10:38:12 -07:00
|
|
|
app.chat_widget
|
2025-09-12 12:06:33 -07:00
|
|
|
.set_reasoning_effort(Some(ReasoningEffortConfig::Medium));
|
2025-09-12 10:38:12 -07:00
|
|
|
|
2025-09-12 12:06:33 -07:00
|
|
|
app.on_update_reasoning_effort(Some(ReasoningEffortConfig::High));
|
2025-09-12 10:38:12 -07:00
|
|
|
|
|
|
|
|
assert_eq!(
|
|
|
|
|
app.config.model_reasoning_effort,
|
2025-09-12 12:06:33 -07:00
|
|
|
Some(ReasoningEffortConfig::High)
|
2025-09-12 10:38:12 -07:00
|
|
|
);
|
|
|
|
|
assert_eq!(
|
|
|
|
|
app.chat_widget.config_ref().model_reasoning_effort,
|
2025-09-12 12:06:33 -07:00
|
|
|
Some(ReasoningEffortConfig::High)
|
2025-09-12 10:38:12 -07:00
|
|
|
);
|
|
|
|
|
}
|
2025-09-22 11:16:25 -07:00
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
|
fn backtrack_selection_with_duplicate_history_targets_unique_turn() {
|
|
|
|
|
let mut app = make_test_app();
|
|
|
|
|
|
|
|
|
|
let user_cell = |text: &str| -> Arc<dyn HistoryCell> {
|
|
|
|
|
Arc::new(UserHistoryCell {
|
|
|
|
|
message: text.to_string(),
|
|
|
|
|
}) as Arc<dyn HistoryCell>
|
|
|
|
|
};
|
|
|
|
|
let agent_cell = |text: &str| -> Arc<dyn HistoryCell> {
|
|
|
|
|
Arc::new(AgentMessageCell::new(
|
|
|
|
|
vec![Line::from(text.to_string())],
|
|
|
|
|
true,
|
|
|
|
|
)) as Arc<dyn HistoryCell>
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
let make_header = |is_first| {
|
|
|
|
|
let event = SessionConfiguredEvent {
|
|
|
|
|
session_id: ConversationId::new(),
|
|
|
|
|
model: "gpt-test".to_string(),
|
|
|
|
|
reasoning_effort: None,
|
|
|
|
|
history_log_id: 0,
|
|
|
|
|
history_entry_count: 0,
|
|
|
|
|
initial_messages: None,
|
|
|
|
|
rollout_path: PathBuf::new(),
|
|
|
|
|
};
|
|
|
|
|
Arc::new(new_session_info(
|
|
|
|
|
app.chat_widget.config_ref(),
|
|
|
|
|
event,
|
|
|
|
|
is_first,
|
|
|
|
|
)) as Arc<dyn HistoryCell>
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Simulate the transcript after trimming for a fork, replaying history, and
|
|
|
|
|
// appending the edited turn. The session header separates the retained history
|
|
|
|
|
// from the forked conversation's replayed turns.
|
|
|
|
|
app.transcript_cells = vec![
|
|
|
|
|
make_header(true),
|
|
|
|
|
user_cell("first question"),
|
|
|
|
|
agent_cell("answer first"),
|
|
|
|
|
user_cell("follow-up"),
|
|
|
|
|
agent_cell("answer follow-up"),
|
|
|
|
|
make_header(false),
|
|
|
|
|
user_cell("first question"),
|
|
|
|
|
agent_cell("answer first"),
|
|
|
|
|
user_cell("follow-up (edited)"),
|
|
|
|
|
agent_cell("answer edited"),
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
assert_eq!(user_count(&app.transcript_cells), 2);
|
|
|
|
|
|
|
|
|
|
app.backtrack.base_id = Some(ConversationId::new());
|
|
|
|
|
app.backtrack.primed = true;
|
|
|
|
|
app.backtrack.nth_user_message = user_count(&app.transcript_cells).saturating_sub(1);
|
|
|
|
|
|
|
|
|
|
app.confirm_backtrack_from_main();
|
|
|
|
|
|
|
|
|
|
let (_, nth, prefill) = app.backtrack.pending.clone().expect("pending backtrack");
|
|
|
|
|
assert_eq!(nth, 1);
|
|
|
|
|
assert_eq!(prefill, "follow-up (edited)");
|
|
|
|
|
}
|
2025-09-12 10:38:12 -07:00
|
|
|
}
|