Phase 2: Rust Workspace Transformation (Part 1)

- Renamed directory: codex-backend-openapi-models -> llmx-backend-openapi-models
- Updated all Cargo.toml files:
  - Package names: codex-* -> llmx-*
  - Library names: codex_* -> llmx_*
  - Workspace dependencies updated
- Renamed Rust source files:
  - codex*.rs -> llmx*.rs (all modules)
  - codex_conversation -> llmx_conversation
  - codex_delegate -> llmx_delegate
  - codex_message_processor -> llmx_message_processor
  - codex_tool_* -> llmx_tool_*
- Updated all Rust imports:
  - use codex_* -> use llmx_*
  - mod codex* -> mod llmx*
- Updated environment variables in code:
  - CODEX_HOME -> LLMX_HOME
  - .codex -> .llmx paths
- Updated protocol crate lib name for proper linking

Note: Some compilation errors remain (type inference issues) but all
renaming is complete. Will fix compilation in next phase.

🤖 Generated with Claude Code
This commit is contained in:
Sebastian Krüger
2025-11-11 14:29:57 +01:00
parent f237fe560d
commit cb8d941adf
346 changed files with 3256 additions and 3199 deletions

View File

@@ -1,14 +1,14 @@
[package]
edition = "2024"
name = "codex-app-server"
name = "llmx-app-server"
version = { workspace = true }
[[bin]]
name = "codex-app-server"
name = "llmx-app-server"
path = "src/main.rs"
[lib]
name = "codex_app_server"
name = "llmx_app_server"
path = "src/lib.rs"
[lints]
@@ -16,16 +16,16 @@ workspace = true
[dependencies]
anyhow = { workspace = true }
codex-arg0 = { workspace = true }
codex-common = { workspace = true, features = ["cli"] }
codex-core = { workspace = true }
codex-backend-client = { workspace = true }
codex-file-search = { workspace = true }
codex-login = { workspace = true }
codex-protocol = { workspace = true }
codex-app-server-protocol = { workspace = true }
codex-feedback = { workspace = true }
codex-utils-json-to-toml = { workspace = true }
llmx-arg0 = { workspace = true }
llmx-common = { workspace = true, features = ["cli"] }
llmx-core = { workspace = true }
llmx-backend-client = { workspace = true }
llmx-file-search = { workspace = true }
llmx-login = { workspace = true }
llmx-protocol = { workspace = true }
llmx-app-server-protocol = { workspace = true }
llmx-feedback = { workspace = true }
llmx-utils-json-to-toml = { workspace = true }
chrono = { workspace = true }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }

View File

@@ -5,8 +5,8 @@ use std::path::PathBuf;
use std::sync::Arc;
use std::sync::atomic::AtomicBool;
use codex_app_server_protocol::FuzzyFileSearchResult;
use codex_file_search as file_search;
use llmx_app_server_protocol::FuzzyFileSearchResult;
use llmx_file_search as file_search;
use tokio::task::JoinSet;
use tracing::warn;

View File

@@ -1,8 +1,8 @@
#![deny(clippy::print_stdout, clippy::print_stderr)]
use codex_common::CliConfigOverrides;
use codex_core::config::Config;
use codex_core::config::ConfigOverrides;
use llmx_common::CliConfigOverrides;
use llmx_core::config::Config;
use llmx_core::config::ConfigOverrides;
use opentelemetry_appender_tracing::layer::OpenTelemetryTracingBridge;
use std::io::ErrorKind;
use std::io::Result as IoResult;
@@ -11,8 +11,8 @@ use std::path::PathBuf;
use crate::message_processor::MessageProcessor;
use crate::outgoing_message::OutgoingMessage;
use crate::outgoing_message::OutgoingMessageSender;
use codex_app_server_protocol::JSONRPCMessage;
use codex_feedback::CodexFeedback;
use llmx_app_server_protocol::JSONRPCMessage;
use llmx_feedback::CodexFeedback;
use tokio::io::AsyncBufReadExt;
use tokio::io::AsyncWriteExt;
use tokio::io::BufReader;
@@ -28,7 +28,7 @@ use tracing_subscriber::filter::Targets;
use tracing_subscriber::layer::SubscriberExt;
use tracing_subscriber::util::SubscriberInitExt;
mod codex_message_processor;
mod llmx_message_processor;
mod error_code;
mod fuzzy_file_search;
mod message_processor;
@@ -88,7 +88,7 @@ pub async fn run_main(
let feedback = CodexFeedback::new();
let otel =
codex_core::otel_init::build_provider(&config, env!("CARGO_PKG_VERSION")).map_err(|e| {
llmx_core::otel_init::build_provider(&config, env!("CARGO_PKG_VERSION")).map_err(|e| {
std::io::Error::new(
ErrorKind::InvalidData,
format!("error loading otel config: {e}"),
@@ -112,7 +112,7 @@ pub async fn run_main(
.with(feedback_layer)
.with(otel.as_ref().map(|provider| {
OpenTelemetryTracingBridge::new(&provider.logger).with_filter(
tracing_subscriber::filter::filter_fn(codex_core::otel_init::codex_export_filter),
tracing_subscriber::filter::filter_fn(llmx_core::otel_init::codex_export_filter),
)
}))
.try_init();

View File

@@ -6,143 +6,143 @@ use crate::outgoing_message::OutgoingMessageSender;
use crate::outgoing_message::OutgoingNotification;
use chrono::DateTime;
use chrono::Utc;
use codex_app_server_protocol::Account;
use codex_app_server_protocol::AccountLoginCompletedNotification;
use codex_app_server_protocol::AccountRateLimitsUpdatedNotification;
use codex_app_server_protocol::AccountUpdatedNotification;
use codex_app_server_protocol::AddConversationListenerParams;
use codex_app_server_protocol::AddConversationSubscriptionResponse;
use codex_app_server_protocol::ApplyPatchApprovalParams;
use codex_app_server_protocol::ApplyPatchApprovalResponse;
use codex_app_server_protocol::ArchiveConversationParams;
use codex_app_server_protocol::ArchiveConversationResponse;
use codex_app_server_protocol::AskForApproval;
use codex_app_server_protocol::AuthMode;
use codex_app_server_protocol::AuthStatusChangeNotification;
use codex_app_server_protocol::CancelLoginAccountParams;
use codex_app_server_protocol::CancelLoginAccountResponse;
use codex_app_server_protocol::CancelLoginChatGptResponse;
use codex_app_server_protocol::ClientRequest;
use codex_app_server_protocol::ConversationGitInfo;
use codex_app_server_protocol::ConversationSummary;
use codex_app_server_protocol::ExecCommandApprovalParams;
use codex_app_server_protocol::ExecCommandApprovalResponse;
use codex_app_server_protocol::ExecOneOffCommandParams;
use codex_app_server_protocol::ExecOneOffCommandResponse;
use codex_app_server_protocol::FeedbackUploadParams;
use codex_app_server_protocol::FeedbackUploadResponse;
use codex_app_server_protocol::FuzzyFileSearchParams;
use codex_app_server_protocol::FuzzyFileSearchResponse;
use codex_app_server_protocol::GetAccountParams;
use codex_app_server_protocol::GetAccountRateLimitsResponse;
use codex_app_server_protocol::GetAccountResponse;
use codex_app_server_protocol::GetAuthStatusParams;
use codex_app_server_protocol::GetAuthStatusResponse;
use codex_app_server_protocol::GetConversationSummaryParams;
use codex_app_server_protocol::GetConversationSummaryResponse;
use codex_app_server_protocol::GetUserAgentResponse;
use codex_app_server_protocol::GetUserSavedConfigResponse;
use codex_app_server_protocol::GitDiffToRemoteResponse;
use codex_app_server_protocol::InputItem as WireInputItem;
use codex_app_server_protocol::InterruptConversationParams;
use codex_app_server_protocol::InterruptConversationResponse;
use codex_app_server_protocol::JSONRPCErrorError;
use codex_app_server_protocol::ListConversationsParams;
use codex_app_server_protocol::ListConversationsResponse;
use codex_app_server_protocol::LoginAccountParams;
use codex_app_server_protocol::LoginApiKeyParams;
use codex_app_server_protocol::LoginApiKeyResponse;
use codex_app_server_protocol::LoginChatGptCompleteNotification;
use codex_app_server_protocol::LoginChatGptResponse;
use codex_app_server_protocol::LogoutAccountResponse;
use codex_app_server_protocol::LogoutChatGptResponse;
use codex_app_server_protocol::ModelListParams;
use codex_app_server_protocol::ModelListResponse;
use codex_app_server_protocol::NewConversationParams;
use codex_app_server_protocol::NewConversationResponse;
use codex_app_server_protocol::RemoveConversationListenerParams;
use codex_app_server_protocol::RemoveConversationSubscriptionResponse;
use codex_app_server_protocol::RequestId;
use codex_app_server_protocol::Result as JsonRpcResult;
use codex_app_server_protocol::ResumeConversationParams;
use codex_app_server_protocol::ResumeConversationResponse;
use codex_app_server_protocol::SandboxMode;
use codex_app_server_protocol::SendUserMessageParams;
use codex_app_server_protocol::SendUserMessageResponse;
use codex_app_server_protocol::SendUserTurnParams;
use codex_app_server_protocol::SendUserTurnResponse;
use codex_app_server_protocol::ServerNotification;
use codex_app_server_protocol::ServerRequestPayload;
use codex_app_server_protocol::SessionConfiguredNotification;
use codex_app_server_protocol::SetDefaultModelParams;
use codex_app_server_protocol::SetDefaultModelResponse;
use codex_app_server_protocol::Thread;
use codex_app_server_protocol::ThreadArchiveParams;
use codex_app_server_protocol::ThreadArchiveResponse;
use codex_app_server_protocol::ThreadItem;
use codex_app_server_protocol::ThreadListParams;
use codex_app_server_protocol::ThreadListResponse;
use codex_app_server_protocol::ThreadResumeParams;
use codex_app_server_protocol::ThreadResumeResponse;
use codex_app_server_protocol::ThreadStartParams;
use codex_app_server_protocol::ThreadStartResponse;
use codex_app_server_protocol::ThreadStartedNotification;
use codex_app_server_protocol::Turn;
use codex_app_server_protocol::TurnInterruptParams;
use codex_app_server_protocol::TurnInterruptResponse;
use codex_app_server_protocol::TurnStartParams;
use codex_app_server_protocol::TurnStartResponse;
use codex_app_server_protocol::TurnStartedNotification;
use codex_app_server_protocol::TurnStatus;
use codex_app_server_protocol::UserInfoResponse;
use codex_app_server_protocol::UserInput as V2UserInput;
use codex_app_server_protocol::UserSavedConfig;
use codex_backend_client::Client as BackendClient;
use codex_core::AuthManager;
use codex_core::CodexConversation;
use codex_core::ConversationManager;
use codex_core::Cursor as RolloutCursor;
use codex_core::INTERACTIVE_SESSION_SOURCES;
use codex_core::InitialHistory;
use codex_core::NewConversation;
use codex_core::RolloutRecorder;
use codex_core::SessionMeta;
use codex_core::auth::CLIENT_ID;
use codex_core::auth::login_with_api_key;
use codex_core::config::Config;
use codex_core::config::ConfigOverrides;
use codex_core::config::ConfigToml;
use codex_core::config::edit::ConfigEditsBuilder;
use codex_core::config_loader::load_config_as_toml;
use codex_core::default_client::get_codex_user_agent;
use codex_core::exec::ExecParams;
use codex_core::exec_env::create_env;
use codex_core::find_conversation_path_by_id_str;
use codex_core::get_platform_sandbox;
use codex_core::git_info::git_diff_to_remote;
use codex_core::parse_cursor;
use codex_core::protocol::ApplyPatchApprovalRequestEvent;
use codex_core::protocol::Event;
use codex_core::protocol::EventMsg;
use codex_core::protocol::ExecApprovalRequestEvent;
use codex_core::protocol::Op;
use codex_core::protocol::ReviewDecision;
use codex_core::read_head_for_summary;
use codex_feedback::CodexFeedback;
use codex_login::ServerOptions as LoginServerOptions;
use codex_login::ShutdownHandle;
use codex_login::run_login_server;
use codex_protocol::ConversationId;
use codex_protocol::config_types::ForcedLoginMethod;
use codex_protocol::items::TurnItem;
use codex_protocol::models::ResponseItem;
use codex_protocol::protocol::GitInfo;
use codex_protocol::protocol::RateLimitSnapshot as CoreRateLimitSnapshot;
use codex_protocol::protocol::RolloutItem;
use codex_protocol::protocol::SessionMetaLine;
use codex_protocol::protocol::USER_MESSAGE_BEGIN;
use codex_protocol::user_input::UserInput as CoreInputItem;
use codex_utils_json_to_toml::json_to_toml;
use llmx_app_server_protocol::Account;
use llmx_app_server_protocol::AccountLoginCompletedNotification;
use llmx_app_server_protocol::AccountRateLimitsUpdatedNotification;
use llmx_app_server_protocol::AccountUpdatedNotification;
use llmx_app_server_protocol::AddConversationListenerParams;
use llmx_app_server_protocol::AddConversationSubscriptionResponse;
use llmx_app_server_protocol::ApplyPatchApprovalParams;
use llmx_app_server_protocol::ApplyPatchApprovalResponse;
use llmx_app_server_protocol::ArchiveConversationParams;
use llmx_app_server_protocol::ArchiveConversationResponse;
use llmx_app_server_protocol::AskForApproval;
use llmx_app_server_protocol::AuthMode;
use llmx_app_server_protocol::AuthStatusChangeNotification;
use llmx_app_server_protocol::CancelLoginAccountParams;
use llmx_app_server_protocol::CancelLoginAccountResponse;
use llmx_app_server_protocol::CancelLoginChatGptResponse;
use llmx_app_server_protocol::ClientRequest;
use llmx_app_server_protocol::ConversationGitInfo;
use llmx_app_server_protocol::ConversationSummary;
use llmx_app_server_protocol::ExecCommandApprovalParams;
use llmx_app_server_protocol::ExecCommandApprovalResponse;
use llmx_app_server_protocol::ExecOneOffCommandParams;
use llmx_app_server_protocol::ExecOneOffCommandResponse;
use llmx_app_server_protocol::FeedbackUploadParams;
use llmx_app_server_protocol::FeedbackUploadResponse;
use llmx_app_server_protocol::FuzzyFileSearchParams;
use llmx_app_server_protocol::FuzzyFileSearchResponse;
use llmx_app_server_protocol::GetAccountParams;
use llmx_app_server_protocol::GetAccountRateLimitsResponse;
use llmx_app_server_protocol::GetAccountResponse;
use llmx_app_server_protocol::GetAuthStatusParams;
use llmx_app_server_protocol::GetAuthStatusResponse;
use llmx_app_server_protocol::GetConversationSummaryParams;
use llmx_app_server_protocol::GetConversationSummaryResponse;
use llmx_app_server_protocol::GetUserAgentResponse;
use llmx_app_server_protocol::GetUserSavedConfigResponse;
use llmx_app_server_protocol::GitDiffToRemoteResponse;
use llmx_app_server_protocol::InputItem as WireInputItem;
use llmx_app_server_protocol::InterruptConversationParams;
use llmx_app_server_protocol::InterruptConversationResponse;
use llmx_app_server_protocol::JSONRPCErrorError;
use llmx_app_server_protocol::ListConversationsParams;
use llmx_app_server_protocol::ListConversationsResponse;
use llmx_app_server_protocol::LoginAccountParams;
use llmx_app_server_protocol::LoginApiKeyParams;
use llmx_app_server_protocol::LoginApiKeyResponse;
use llmx_app_server_protocol::LoginChatGptCompleteNotification;
use llmx_app_server_protocol::LoginChatGptResponse;
use llmx_app_server_protocol::LogoutAccountResponse;
use llmx_app_server_protocol::LogoutChatGptResponse;
use llmx_app_server_protocol::ModelListParams;
use llmx_app_server_protocol::ModelListResponse;
use llmx_app_server_protocol::NewConversationParams;
use llmx_app_server_protocol::NewConversationResponse;
use llmx_app_server_protocol::RemoveConversationListenerParams;
use llmx_app_server_protocol::RemoveConversationSubscriptionResponse;
use llmx_app_server_protocol::RequestId;
use llmx_app_server_protocol::Result as JsonRpcResult;
use llmx_app_server_protocol::ResumeConversationParams;
use llmx_app_server_protocol::ResumeConversationResponse;
use llmx_app_server_protocol::SandboxMode;
use llmx_app_server_protocol::SendUserMessageParams;
use llmx_app_server_protocol::SendUserMessageResponse;
use llmx_app_server_protocol::SendUserTurnParams;
use llmx_app_server_protocol::SendUserTurnResponse;
use llmx_app_server_protocol::ServerNotification;
use llmx_app_server_protocol::ServerRequestPayload;
use llmx_app_server_protocol::SessionConfiguredNotification;
use llmx_app_server_protocol::SetDefaultModelParams;
use llmx_app_server_protocol::SetDefaultModelResponse;
use llmx_app_server_protocol::Thread;
use llmx_app_server_protocol::ThreadArchiveParams;
use llmx_app_server_protocol::ThreadArchiveResponse;
use llmx_app_server_protocol::ThreadItem;
use llmx_app_server_protocol::ThreadListParams;
use llmx_app_server_protocol::ThreadListResponse;
use llmx_app_server_protocol::ThreadResumeParams;
use llmx_app_server_protocol::ThreadResumeResponse;
use llmx_app_server_protocol::ThreadStartParams;
use llmx_app_server_protocol::ThreadStartResponse;
use llmx_app_server_protocol::ThreadStartedNotification;
use llmx_app_server_protocol::Turn;
use llmx_app_server_protocol::TurnInterruptParams;
use llmx_app_server_protocol::TurnInterruptResponse;
use llmx_app_server_protocol::TurnStartParams;
use llmx_app_server_protocol::TurnStartResponse;
use llmx_app_server_protocol::TurnStartedNotification;
use llmx_app_server_protocol::TurnStatus;
use llmx_app_server_protocol::UserInfoResponse;
use llmx_app_server_protocol::UserInput as V2UserInput;
use llmx_app_server_protocol::UserSavedConfig;
use llmx_backend_client::Client as BackendClient;
use llmx_core::AuthManager;
use llmx_core::CodexConversation;
use llmx_core::ConversationManager;
use llmx_core::Cursor as RolloutCursor;
use llmx_core::INTERACTIVE_SESSION_SOURCES;
use llmx_core::InitialHistory;
use llmx_core::NewConversation;
use llmx_core::RolloutRecorder;
use llmx_core::SessionMeta;
use llmx_core::auth::CLIENT_ID;
use llmx_core::auth::login_with_api_key;
use llmx_core::config::Config;
use llmx_core::config::ConfigOverrides;
use llmx_core::config::ConfigToml;
use llmx_core::config::edit::ConfigEditsBuilder;
use llmx_core::config_loader::load_config_as_toml;
use llmx_core::default_client::get_codex_user_agent;
use llmx_core::exec::ExecParams;
use llmx_core::exec_env::create_env;
use llmx_core::find_conversation_path_by_id_str;
use llmx_core::get_platform_sandbox;
use llmx_core::git_info::git_diff_to_remote;
use llmx_core::parse_cursor;
use llmx_core::protocol::ApplyPatchApprovalRequestEvent;
use llmx_core::protocol::Event;
use llmx_core::protocol::EventMsg;
use llmx_core::protocol::ExecApprovalRequestEvent;
use llmx_core::protocol::Op;
use llmx_core::protocol::ReviewDecision;
use llmx_core::read_head_for_summary;
use llmx_feedback::CodexFeedback;
use llmx_login::ServerOptions as LoginServerOptions;
use llmx_login::ShutdownHandle;
use llmx_login::run_login_server;
use llmx_protocol::ConversationId;
use llmx_protocol::config_types::ForcedLoginMethod;
use llmx_protocol::items::TurnItem;
use llmx_protocol::models::ResponseItem;
use llmx_protocol::protocol::GitInfo;
use llmx_protocol::protocol::RateLimitSnapshot as CoreRateLimitSnapshot;
use llmx_protocol::protocol::RolloutItem;
use llmx_protocol::protocol::SessionMetaLine;
use llmx_protocol::protocol::USER_MESSAGE_BEGIN;
use llmx_protocol::user_input::UserInput as CoreInputItem;
use llmx_utils_json_to_toml::json_to_toml;
use std::collections::HashMap;
use std::ffi::OsStr;
use std::io::Error as IoError;
@@ -473,7 +473,7 @@ impl CodexMessageProcessor {
async fn login_api_key_v2(&mut self, request_id: RequestId, params: LoginApiKeyParams) {
match self.login_api_key_common(&params).await {
Ok(()) => {
let response = codex_app_server_protocol::LoginAccountResponse::ApiKey {};
let response = llmx_app_server_protocol::LoginAccountResponse::ApiKey {};
self.outgoing.send_response(request_id, response).await;
let payload_login_completed = AccountLoginCompletedNotification {
@@ -688,7 +688,7 @@ impl CodexMessageProcessor {
}
});
let response = codex_app_server_protocol::LoginAccountResponse::Chatgpt {
let response = llmx_app_server_protocol::LoginAccountResponse::Chatgpt {
login_id: login_id.to_string(),
auth_url,
};
@@ -1087,10 +1087,10 @@ impl CodexMessageProcessor {
.unwrap_or_else(|| self.config.sandbox_policy.clone());
let sandbox_type = match &effective_policy {
codex_core::protocol::SandboxPolicy::DangerFullAccess => {
codex_core::exec::SandboxType::None
llmx_core::protocol::SandboxPolicy::DangerFullAccess => {
llmx_core::exec::SandboxType::None
}
_ => get_platform_sandbox().unwrap_or(codex_core::exec::SandboxType::None),
_ => get_platform_sandbox().unwrap_or(llmx_core::exec::SandboxType::None),
};
tracing::debug!("Sandbox type: {sandbox_type:?}");
let codex_linux_sandbox_exe = self.config.codex_linux_sandbox_exe.clone();
@@ -1099,7 +1099,7 @@ impl CodexMessageProcessor {
let sandbox_cwd = self.config.cwd.clone();
tokio::spawn(async move {
match codex_core::exec::process_exec_tool_call(
match llmx_core::exec::process_exec_tool_call(
exec_params,
sandbox_type,
&effective_policy,
@@ -1494,7 +1494,7 @@ impl CodexMessageProcessor {
}
}
GetConversationSummaryParams::ConversationId { conversation_id } => {
match codex_core::find_conversation_path_by_id_str(
match llmx_core::find_conversation_path_by_id_str(
&self.config.codex_home,
&conversation_id.to_string(),
)
@@ -1911,7 +1911,7 @@ impl CodexMessageProcessor {
rollout_path: &Path,
) -> Result<(), JSONRPCErrorError> {
// Verify rollout_path is under sessions dir.
let rollout_folder = self.config.codex_home.join(codex_core::SESSIONS_SUBDIR);
let rollout_folder = self.config.codex_home.join(llmx_core::SESSIONS_SUBDIR);
let canonical_sessions_dir = match tokio::fs::canonicalize(&rollout_folder).await {
Ok(path) => path,
@@ -2028,7 +2028,7 @@ impl CodexMessageProcessor {
let archive_folder = self
.config
.codex_home
.join(codex_core::ARCHIVED_SESSIONS_SUBDIR);
.join(llmx_core::ARCHIVED_SESSIONS_SUBDIR);
tokio::fs::create_dir_all(&archive_folder).await?;
tokio::fs::rename(&canonical_rollout_path, &archive_folder.join(&file_name)).await?;
Ok(())
@@ -2797,7 +2797,7 @@ fn extract_conversation_summary(
let preview = head
.iter()
.filter_map(|value| serde_json::from_value::<ResponseItem>(value.clone()).ok())
.find_map(|item| match codex_core::parse_turn_item(&item) {
.find_map(|item| match llmx_core::parse_turn_item(&item) {
Some(TurnItem::UserMessage(user)) => Some(user.message()),
_ => None,
})?;
@@ -2871,7 +2871,7 @@ fn summary_to_thread(summary: ConversationSummary) -> Thread {
mod tests {
use super::*;
use anyhow::Result;
use codex_protocol::protocol::SessionSource;
use llmx_protocol::protocol::SessionSource;
use pretty_assertions::assert_eq;
use serde_json::json;
use tempfile::TempDir;
@@ -2934,9 +2934,9 @@ mod tests {
#[tokio::test]
async fn read_summary_from_rollout_returns_empty_preview_when_no_user_message() -> Result<()> {
use codex_protocol::protocol::RolloutItem;
use codex_protocol::protocol::RolloutLine;
use codex_protocol::protocol::SessionMetaLine;
use llmx_protocol::protocol::RolloutItem;
use llmx_protocol::protocol::RolloutLine;
use llmx_protocol::protocol::SessionMetaLine;
use std::fs;
let temp_dir = TempDir::new()?;

View File

@@ -1,6 +1,6 @@
use codex_app_server::run_main;
use codex_arg0::arg0_dispatch_or_else;
use codex_common::CliConfigOverrides;
use llmx_app_server::run_main;
use llmx_arg0::arg0_dispatch_or_else;
use llmx_common::CliConfigOverrides;
fn main() -> anyhow::Result<()> {
arg0_dispatch_or_else(|codex_linux_sandbox_exe| async move {

View File

@@ -1,24 +1,24 @@
use std::path::PathBuf;
use crate::codex_message_processor::CodexMessageProcessor;
use crate::llmx_message_processor::CodexMessageProcessor;
use crate::error_code::INVALID_REQUEST_ERROR_CODE;
use crate::outgoing_message::OutgoingMessageSender;
use codex_app_server_protocol::ClientInfo;
use codex_app_server_protocol::ClientRequest;
use codex_app_server_protocol::InitializeResponse;
use llmx_app_server_protocol::ClientInfo;
use llmx_app_server_protocol::ClientRequest;
use llmx_app_server_protocol::InitializeResponse;
use codex_app_server_protocol::JSONRPCError;
use codex_app_server_protocol::JSONRPCErrorError;
use codex_app_server_protocol::JSONRPCNotification;
use codex_app_server_protocol::JSONRPCRequest;
use codex_app_server_protocol::JSONRPCResponse;
use codex_core::AuthManager;
use codex_core::ConversationManager;
use codex_core::config::Config;
use codex_core::default_client::USER_AGENT_SUFFIX;
use codex_core::default_client::get_codex_user_agent;
use codex_feedback::CodexFeedback;
use codex_protocol::protocol::SessionSource;
use llmx_app_server_protocol::JSONRPCError;
use llmx_app_server_protocol::JSONRPCErrorError;
use llmx_app_server_protocol::JSONRPCNotification;
use llmx_app_server_protocol::JSONRPCRequest;
use llmx_app_server_protocol::JSONRPCResponse;
use llmx_core::AuthManager;
use llmx_core::ConversationManager;
use llmx_core::config::Config;
use llmx_core::default_client::USER_AGENT_SUFFIX;
use llmx_core::default_client::get_codex_user_agent;
use llmx_feedback::CodexFeedback;
use llmx_protocol::protocol::SessionSource;
use std::sync::Arc;
pub(crate) struct MessageProcessor {

View File

@@ -1,9 +1,9 @@
use codex_app_server_protocol::AuthMode;
use codex_app_server_protocol::Model;
use codex_app_server_protocol::ReasoningEffortOption;
use codex_common::model_presets::ModelPreset;
use codex_common::model_presets::ReasoningEffortPreset;
use codex_common::model_presets::builtin_model_presets;
use llmx_app_server_protocol::AuthMode;
use llmx_app_server_protocol::Model;
use llmx_app_server_protocol::ReasoningEffortOption;
use llmx_common::model_presets::ModelPreset;
use llmx_common::model_presets::ReasoningEffortPreset;
use llmx_common::model_presets::builtin_model_presets;
pub fn supported_models(auth_mode: Option<AuthMode>) -> Vec<Model> {
builtin_model_presets(auth_mode)

View File

@@ -2,12 +2,12 @@ use std::collections::HashMap;
use std::sync::atomic::AtomicI64;
use std::sync::atomic::Ordering;
use codex_app_server_protocol::JSONRPCErrorError;
use codex_app_server_protocol::RequestId;
use codex_app_server_protocol::Result;
use codex_app_server_protocol::ServerNotification;
use codex_app_server_protocol::ServerRequest;
use codex_app_server_protocol::ServerRequestPayload;
use llmx_app_server_protocol::JSONRPCErrorError;
use llmx_app_server_protocol::RequestId;
use llmx_app_server_protocol::Result;
use llmx_app_server_protocol::ServerNotification;
use llmx_app_server_protocol::ServerRequest;
use llmx_app_server_protocol::ServerRequestPayload;
use serde::Serialize;
use tokio::sync::Mutex;
use tokio::sync::mpsc;
@@ -141,13 +141,13 @@ pub(crate) struct OutgoingError {
#[cfg(test)]
mod tests {
use codex_app_server_protocol::AccountLoginCompletedNotification;
use codex_app_server_protocol::AccountRateLimitsUpdatedNotification;
use codex_app_server_protocol::AccountUpdatedNotification;
use codex_app_server_protocol::AuthMode;
use codex_app_server_protocol::LoginChatGptCompleteNotification;
use codex_app_server_protocol::RateLimitSnapshot;
use codex_app_server_protocol::RateLimitWindow;
use llmx_app_server_protocol::AccountLoginCompletedNotification;
use llmx_app_server_protocol::AccountRateLimitsUpdatedNotification;
use llmx_app_server_protocol::AccountUpdatedNotification;
use llmx_app_server_protocol::AuthMode;
use llmx_app_server_protocol::LoginChatGptCompleteNotification;
use llmx_app_server_protocol::RateLimitSnapshot;
use llmx_app_server_protocol::RateLimitWindow;
use pretty_assertions::assert_eq;
use serde_json::json;
use uuid::Uuid;

View File

@@ -11,9 +11,9 @@ anyhow = { workspace = true }
assert_cmd = { workspace = true }
base64 = { workspace = true }
chrono = { workspace = true }
codex-app-server-protocol = { workspace = true }
codex-core = { workspace = true }
codex-protocol = { workspace = true }
llmx-app-server-protocol = { workspace = true }
llmx-core = { workspace = true }
llmx-protocol = { workspace = true }
serde = { workspace = true }
serde_json = { workspace = true }
tokio = { workspace = true, features = [

View File

@@ -6,11 +6,11 @@ use base64::Engine;
use base64::engine::general_purpose::URL_SAFE_NO_PAD;
use chrono::DateTime;
use chrono::Utc;
use codex_core::auth::AuthCredentialsStoreMode;
use codex_core::auth::AuthDotJson;
use codex_core::auth::save_auth;
use codex_core::token_data::TokenData;
use codex_core::token_data::parse_id_token;
use llmx_core::auth::AuthCredentialsStoreMode;
use llmx_core::auth::AuthDotJson;
use llmx_core::auth::save_auth;
use llmx_core::token_data::TokenData;
use llmx_core::token_data::parse_id_token;
use serde_json::json;
/// Builder for writing a fake ChatGPT auth.json in tests.

View File

@@ -8,7 +8,7 @@ pub use auth_fixtures::ChatGptAuthFixture;
pub use auth_fixtures::ChatGptIdTokenClaims;
pub use auth_fixtures::encode_id_token;
pub use auth_fixtures::write_chatgpt_auth;
use codex_app_server_protocol::JSONRPCResponse;
use llmx_app_server_protocol::JSONRPCResponse;
pub use mcp_process::McpProcess;
pub use mock_model_server::create_mock_chat_completions_server;
pub use mock_model_server::create_mock_chat_completions_server_unchecked;

View File

@@ -12,39 +12,39 @@ use tokio::process::ChildStdout;
use anyhow::Context;
use assert_cmd::prelude::*;
use codex_app_server_protocol::AddConversationListenerParams;
use codex_app_server_protocol::ArchiveConversationParams;
use codex_app_server_protocol::CancelLoginAccountParams;
use codex_app_server_protocol::CancelLoginChatGptParams;
use codex_app_server_protocol::ClientInfo;
use codex_app_server_protocol::ClientNotification;
use codex_app_server_protocol::FeedbackUploadParams;
use codex_app_server_protocol::GetAccountParams;
use codex_app_server_protocol::GetAuthStatusParams;
use codex_app_server_protocol::InitializeParams;
use codex_app_server_protocol::InterruptConversationParams;
use codex_app_server_protocol::JSONRPCError;
use codex_app_server_protocol::JSONRPCMessage;
use codex_app_server_protocol::JSONRPCNotification;
use codex_app_server_protocol::JSONRPCRequest;
use codex_app_server_protocol::JSONRPCResponse;
use codex_app_server_protocol::ListConversationsParams;
use codex_app_server_protocol::LoginApiKeyParams;
use codex_app_server_protocol::ModelListParams;
use codex_app_server_protocol::NewConversationParams;
use codex_app_server_protocol::RemoveConversationListenerParams;
use codex_app_server_protocol::RequestId;
use codex_app_server_protocol::ResumeConversationParams;
use codex_app_server_protocol::SendUserMessageParams;
use codex_app_server_protocol::SendUserTurnParams;
use codex_app_server_protocol::ServerRequest;
use codex_app_server_protocol::SetDefaultModelParams;
use codex_app_server_protocol::ThreadArchiveParams;
use codex_app_server_protocol::ThreadListParams;
use codex_app_server_protocol::ThreadResumeParams;
use codex_app_server_protocol::ThreadStartParams;
use codex_app_server_protocol::TurnInterruptParams;
use codex_app_server_protocol::TurnStartParams;
use llmx_app_server_protocol::AddConversationListenerParams;
use llmx_app_server_protocol::ArchiveConversationParams;
use llmx_app_server_protocol::CancelLoginAccountParams;
use llmx_app_server_protocol::CancelLoginChatGptParams;
use llmx_app_server_protocol::ClientInfo;
use llmx_app_server_protocol::ClientNotification;
use llmx_app_server_protocol::FeedbackUploadParams;
use llmx_app_server_protocol::GetAccountParams;
use llmx_app_server_protocol::GetAuthStatusParams;
use llmx_app_server_protocol::InitializeParams;
use llmx_app_server_protocol::InterruptConversationParams;
use llmx_app_server_protocol::JSONRPCError;
use llmx_app_server_protocol::JSONRPCMessage;
use llmx_app_server_protocol::JSONRPCNotification;
use llmx_app_server_protocol::JSONRPCRequest;
use llmx_app_server_protocol::JSONRPCResponse;
use llmx_app_server_protocol::ListConversationsParams;
use llmx_app_server_protocol::LoginApiKeyParams;
use llmx_app_server_protocol::ModelListParams;
use llmx_app_server_protocol::NewConversationParams;
use llmx_app_server_protocol::RemoveConversationListenerParams;
use llmx_app_server_protocol::RequestId;
use llmx_app_server_protocol::ResumeConversationParams;
use llmx_app_server_protocol::SendUserMessageParams;
use llmx_app_server_protocol::SendUserTurnParams;
use llmx_app_server_protocol::ServerRequest;
use llmx_app_server_protocol::SetDefaultModelParams;
use llmx_app_server_protocol::ThreadArchiveParams;
use llmx_app_server_protocol::ThreadListParams;
use llmx_app_server_protocol::ThreadResumeParams;
use llmx_app_server_protocol::ThreadStartParams;
use llmx_app_server_protocol::TurnInterruptParams;
use llmx_app_server_protocol::TurnStartParams;
use std::process::Command as StdCommand;
use tokio::process::Command;

View File

@@ -1,7 +1,7 @@
use anyhow::Result;
use codex_protocol::ConversationId;
use codex_protocol::protocol::SessionMeta;
use codex_protocol::protocol::SessionSource;
use llmx_protocol::ConversationId;
use llmx_protocol::protocol::SessionMeta;
use llmx_protocol::protocol::SessionSource;
use serde_json::json;
use std::fs;
use std::path::Path;

View File

@@ -1,13 +1,13 @@
use anyhow::Result;
use app_test_support::McpProcess;
use app_test_support::to_response;
use codex_app_server_protocol::ArchiveConversationParams;
use codex_app_server_protocol::ArchiveConversationResponse;
use codex_app_server_protocol::JSONRPCResponse;
use codex_app_server_protocol::NewConversationParams;
use codex_app_server_protocol::NewConversationResponse;
use codex_app_server_protocol::RequestId;
use codex_core::ARCHIVED_SESSIONS_SUBDIR;
use llmx_app_server_protocol::ArchiveConversationParams;
use llmx_app_server_protocol::ArchiveConversationResponse;
use llmx_app_server_protocol::JSONRPCResponse;
use llmx_app_server_protocol::NewConversationParams;
use llmx_app_server_protocol::NewConversationResponse;
use llmx_app_server_protocol::RequestId;
use llmx_core::ARCHIVED_SESSIONS_SUBDIR;
use std::path::Path;
use tempfile::TempDir;
use tokio::time::timeout;

View File

@@ -1,14 +1,14 @@
use anyhow::Result;
use app_test_support::McpProcess;
use app_test_support::to_response;
use codex_app_server_protocol::AuthMode;
use codex_app_server_protocol::GetAuthStatusParams;
use codex_app_server_protocol::GetAuthStatusResponse;
use codex_app_server_protocol::JSONRPCError;
use codex_app_server_protocol::JSONRPCResponse;
use codex_app_server_protocol::LoginApiKeyParams;
use codex_app_server_protocol::LoginApiKeyResponse;
use codex_app_server_protocol::RequestId;
use llmx_app_server_protocol::AuthMode;
use llmx_app_server_protocol::GetAuthStatusParams;
use llmx_app_server_protocol::GetAuthStatusResponse;
use llmx_app_server_protocol::JSONRPCError;
use llmx_app_server_protocol::JSONRPCResponse;
use llmx_app_server_protocol::LoginApiKeyParams;
use llmx_app_server_protocol::LoginApiKeyResponse;
use llmx_app_server_protocol::RequestId;
use pretty_assertions::assert_eq;
use std::path::Path;
use tempfile::TempDir;

View File

@@ -1,19 +1,19 @@
use anyhow::Result;
use app_test_support::McpProcess;
use app_test_support::to_response;
use codex_app_server_protocol::GetUserSavedConfigResponse;
use codex_app_server_protocol::JSONRPCResponse;
use codex_app_server_protocol::Profile;
use codex_app_server_protocol::RequestId;
use codex_app_server_protocol::SandboxSettings;
use codex_app_server_protocol::Tools;
use codex_app_server_protocol::UserSavedConfig;
use codex_core::protocol::AskForApproval;
use codex_protocol::config_types::ForcedLoginMethod;
use codex_protocol::config_types::ReasoningEffort;
use codex_protocol::config_types::ReasoningSummary;
use codex_protocol::config_types::SandboxMode;
use codex_protocol::config_types::Verbosity;
use llmx_app_server_protocol::GetUserSavedConfigResponse;
use llmx_app_server_protocol::JSONRPCResponse;
use llmx_app_server_protocol::Profile;
use llmx_app_server_protocol::RequestId;
use llmx_app_server_protocol::SandboxSettings;
use llmx_app_server_protocol::Tools;
use llmx_app_server_protocol::UserSavedConfig;
use llmx_core::protocol::AskForApproval;
use llmx_protocol::config_types::ForcedLoginMethod;
use llmx_protocol::config_types::ReasoningEffort;
use llmx_protocol::config_types::ReasoningSummary;
use llmx_protocol::config_types::SandboxMode;
use llmx_protocol::config_types::Verbosity;
use pretty_assertions::assert_eq;
use std::collections::HashMap;
use std::path::Path;

View File

@@ -3,15 +3,15 @@ use app_test_support::McpProcess;
use app_test_support::create_final_assistant_message_sse_response;
use app_test_support::create_mock_chat_completions_server;
use app_test_support::to_response;
use codex_app_server_protocol::AddConversationListenerParams;
use codex_app_server_protocol::AddConversationSubscriptionResponse;
use codex_app_server_protocol::InputItem;
use codex_app_server_protocol::JSONRPCResponse;
use codex_app_server_protocol::NewConversationParams;
use codex_app_server_protocol::NewConversationResponse;
use codex_app_server_protocol::RequestId;
use codex_app_server_protocol::SendUserMessageParams;
use codex_app_server_protocol::SendUserMessageResponse;
use llmx_app_server_protocol::AddConversationListenerParams;
use llmx_app_server_protocol::AddConversationSubscriptionResponse;
use llmx_app_server_protocol::InputItem;
use llmx_app_server_protocol::JSONRPCResponse;
use llmx_app_server_protocol::NewConversationParams;
use llmx_app_server_protocol::NewConversationResponse;
use llmx_app_server_protocol::RequestId;
use llmx_app_server_protocol::SendUserMessageParams;
use llmx_app_server_protocol::SendUserMessageResponse;
use pretty_assertions::assert_eq;
use serde_json::json;
use std::path::Path;

View File

@@ -1,8 +1,8 @@
use anyhow::Result;
use anyhow::anyhow;
use app_test_support::McpProcess;
use codex_app_server_protocol::JSONRPCResponse;
use codex_app_server_protocol::RequestId;
use llmx_app_server_protocol::JSONRPCResponse;
use llmx_app_server_protocol::RequestId;
use pretty_assertions::assert_eq;
use serde_json::json;
use tempfile::TempDir;

View File

@@ -3,16 +3,16 @@
use std::path::Path;
use codex_app_server_protocol::AddConversationListenerParams;
use codex_app_server_protocol::InterruptConversationParams;
use codex_app_server_protocol::InterruptConversationResponse;
use codex_app_server_protocol::JSONRPCResponse;
use codex_app_server_protocol::NewConversationParams;
use codex_app_server_protocol::NewConversationResponse;
use codex_app_server_protocol::RequestId;
use codex_app_server_protocol::SendUserMessageParams;
use codex_app_server_protocol::SendUserMessageResponse;
use codex_core::protocol::TurnAbortReason;
use llmx_app_server_protocol::AddConversationListenerParams;
use llmx_app_server_protocol::InterruptConversationParams;
use llmx_app_server_protocol::InterruptConversationResponse;
use llmx_app_server_protocol::JSONRPCResponse;
use llmx_app_server_protocol::NewConversationParams;
use llmx_app_server_protocol::NewConversationResponse;
use llmx_app_server_protocol::RequestId;
use llmx_app_server_protocol::SendUserMessageParams;
use llmx_app_server_protocol::SendUserMessageResponse;
use llmx_core::protocol::TurnAbortReason;
use core_test_support::skip_if_no_network;
use tempfile::TempDir;
use tokio::time::timeout;
@@ -103,7 +103,7 @@ async fn shell_command_interruption() -> anyhow::Result<()> {
let send_user_id = mcp
.send_send_user_message_request(SendUserMessageParams {
conversation_id,
items: vec![codex_app_server_protocol::InputItem::Text {
items: vec![llmx_app_server_protocol::InputItem::Text {
text: "run first sleep command".to_string(),
}],
})

View File

@@ -2,19 +2,19 @@ use anyhow::Result;
use app_test_support::McpProcess;
use app_test_support::create_fake_rollout;
use app_test_support::to_response;
use codex_app_server_protocol::JSONRPCNotification;
use codex_app_server_protocol::JSONRPCResponse;
use codex_app_server_protocol::ListConversationsParams;
use codex_app_server_protocol::ListConversationsResponse;
use codex_app_server_protocol::NewConversationParams; // reused for overrides shape
use codex_app_server_protocol::RequestId;
use codex_app_server_protocol::ResumeConversationParams;
use codex_app_server_protocol::ResumeConversationResponse;
use codex_app_server_protocol::ServerNotification;
use codex_app_server_protocol::SessionConfiguredNotification;
use codex_core::protocol::EventMsg;
use codex_protocol::models::ContentItem;
use codex_protocol::models::ResponseItem;
use llmx_app_server_protocol::JSONRPCNotification;
use llmx_app_server_protocol::JSONRPCResponse;
use llmx_app_server_protocol::ListConversationsParams;
use llmx_app_server_protocol::ListConversationsResponse;
use llmx_app_server_protocol::NewConversationParams; // reused for overrides shape
use llmx_app_server_protocol::RequestId;
use llmx_app_server_protocol::ResumeConversationParams;
use llmx_app_server_protocol::ResumeConversationResponse;
use llmx_app_server_protocol::ServerNotification;
use llmx_app_server_protocol::SessionConfiguredNotification;
use llmx_core::protocol::EventMsg;
use llmx_protocol::models::ContentItem;
use llmx_protocol::models::ResponseItem;
use pretty_assertions::assert_eq;
use tempfile::TempDir;
use tokio::time::timeout;

View File

@@ -4,31 +4,31 @@ use app_test_support::create_final_assistant_message_sse_response;
use app_test_support::create_mock_chat_completions_server;
use app_test_support::create_shell_sse_response;
use app_test_support::to_response;
use codex_app_server_protocol::AddConversationListenerParams;
use codex_app_server_protocol::AddConversationSubscriptionResponse;
use codex_app_server_protocol::ExecCommandApprovalParams;
use codex_app_server_protocol::InputItem;
use codex_app_server_protocol::JSONRPCNotification;
use codex_app_server_protocol::JSONRPCResponse;
use codex_app_server_protocol::NewConversationParams;
use codex_app_server_protocol::NewConversationResponse;
use codex_app_server_protocol::RemoveConversationListenerParams;
use codex_app_server_protocol::RemoveConversationSubscriptionResponse;
use codex_app_server_protocol::RequestId;
use codex_app_server_protocol::SendUserMessageParams;
use codex_app_server_protocol::SendUserMessageResponse;
use codex_app_server_protocol::SendUserTurnParams;
use codex_app_server_protocol::SendUserTurnResponse;
use codex_app_server_protocol::ServerRequest;
use codex_core::protocol::AskForApproval;
use codex_core::protocol::SandboxPolicy;
use codex_core::protocol_config_types::ReasoningEffort;
use codex_core::protocol_config_types::ReasoningSummary;
use codex_core::spawn::CODEX_SANDBOX_NETWORK_DISABLED_ENV_VAR;
use codex_protocol::config_types::SandboxMode;
use codex_protocol::parse_command::ParsedCommand;
use codex_protocol::protocol::Event;
use codex_protocol::protocol::EventMsg;
use llmx_app_server_protocol::AddConversationListenerParams;
use llmx_app_server_protocol::AddConversationSubscriptionResponse;
use llmx_app_server_protocol::ExecCommandApprovalParams;
use llmx_app_server_protocol::InputItem;
use llmx_app_server_protocol::JSONRPCNotification;
use llmx_app_server_protocol::JSONRPCResponse;
use llmx_app_server_protocol::NewConversationParams;
use llmx_app_server_protocol::NewConversationResponse;
use llmx_app_server_protocol::RemoveConversationListenerParams;
use llmx_app_server_protocol::RemoveConversationSubscriptionResponse;
use llmx_app_server_protocol::RequestId;
use llmx_app_server_protocol::SendUserMessageParams;
use llmx_app_server_protocol::SendUserMessageResponse;
use llmx_app_server_protocol::SendUserTurnParams;
use llmx_app_server_protocol::SendUserTurnResponse;
use llmx_app_server_protocol::ServerRequest;
use llmx_core::protocol::AskForApproval;
use llmx_core::protocol::SandboxPolicy;
use llmx_core::protocol_config_types::ReasoningEffort;
use llmx_core::protocol_config_types::ReasoningSummary;
use llmx_core::spawn::CODEX_SANDBOX_NETWORK_DISABLED_ENV_VAR;
use llmx_protocol::config_types::SandboxMode;
use llmx_protocol::parse_command::ParsedCommand;
use llmx_protocol::protocol::Event;
use llmx_protocol::protocol::EventMsg;
use pretty_assertions::assert_eq;
use std::env;
use std::path::Path;
@@ -111,7 +111,7 @@ async fn test_codex_jsonrpc_conversation_flow() -> Result<()> {
let send_user_id = mcp
.send_send_user_message_request(SendUserMessageParams {
conversation_id,
items: vec![codex_app_server_protocol::InputItem::Text {
items: vec![llmx_app_server_protocol::InputItem::Text {
text: "text".to_string(),
}],
})
@@ -240,7 +240,7 @@ async fn test_send_user_turn_changes_approval_policy_behavior() -> Result<()> {
let send_user_id = mcp
.send_send_user_message_request(SendUserMessageParams {
conversation_id,
items: vec![codex_app_server_protocol::InputItem::Text {
items: vec![llmx_app_server_protocol::InputItem::Text {
text: "run python".to_string(),
}],
})
@@ -285,7 +285,7 @@ async fn test_send_user_turn_changes_approval_policy_behavior() -> Result<()> {
// Approve so the first turn can complete
mcp.send_response(
request_id,
serde_json::json!({ "decision": codex_core::protocol::ReviewDecision::Approved }),
serde_json::json!({ "decision": llmx_core::protocol::ReviewDecision::Approved }),
)
.await?;
@@ -300,7 +300,7 @@ async fn test_send_user_turn_changes_approval_policy_behavior() -> Result<()> {
let send_turn_id = mcp
.send_send_user_turn_request(SendUserTurnParams {
conversation_id,
items: vec![codex_app_server_protocol::InputItem::Text {
items: vec![llmx_app_server_protocol::InputItem::Text {
text: "run python again".to_string(),
}],
cwd: working_directory.clone(),

View File

@@ -1,17 +1,17 @@
use anyhow::Result;
use app_test_support::McpProcess;
use app_test_support::to_response;
use codex_app_server_protocol::CancelLoginChatGptParams;
use codex_app_server_protocol::CancelLoginChatGptResponse;
use codex_app_server_protocol::GetAuthStatusParams;
use codex_app_server_protocol::GetAuthStatusResponse;
use codex_app_server_protocol::JSONRPCError;
use codex_app_server_protocol::JSONRPCResponse;
use codex_app_server_protocol::LoginChatGptResponse;
use codex_app_server_protocol::LogoutChatGptResponse;
use codex_app_server_protocol::RequestId;
use codex_core::auth::AuthCredentialsStoreMode;
use codex_login::login_with_api_key;
use llmx_app_server_protocol::CancelLoginChatGptParams;
use llmx_app_server_protocol::CancelLoginChatGptResponse;
use llmx_app_server_protocol::GetAuthStatusParams;
use llmx_app_server_protocol::GetAuthStatusResponse;
use llmx_app_server_protocol::JSONRPCError;
use llmx_app_server_protocol::JSONRPCResponse;
use llmx_app_server_protocol::LoginChatGptResponse;
use llmx_app_server_protocol::LogoutChatGptResponse;
use llmx_app_server_protocol::RequestId;
use llmx_core::auth::AuthCredentialsStoreMode;
use llmx_login::login_with_api_key;
use serial_test::serial;
use std::path::Path;
use std::time::Duration;

View File

@@ -1,6 +1,6 @@
mod archive_conversation;
mod auth;
mod codex_message_processor_flow;
mod llmx_message_processor_flow;
mod config;
mod create_conversation;
mod fuzzy_file_search;

View File

@@ -3,20 +3,20 @@ use app_test_support::McpProcess;
use app_test_support::create_final_assistant_message_sse_response;
use app_test_support::create_mock_chat_completions_server;
use app_test_support::to_response;
use codex_app_server_protocol::AddConversationListenerParams;
use codex_app_server_protocol::AddConversationSubscriptionResponse;
use codex_app_server_protocol::InputItem;
use codex_app_server_protocol::JSONRPCNotification;
use codex_app_server_protocol::JSONRPCResponse;
use codex_app_server_protocol::NewConversationParams;
use codex_app_server_protocol::NewConversationResponse;
use codex_app_server_protocol::RequestId;
use codex_app_server_protocol::SendUserMessageParams;
use codex_app_server_protocol::SendUserMessageResponse;
use codex_protocol::ConversationId;
use codex_protocol::models::ContentItem;
use codex_protocol::models::ResponseItem;
use codex_protocol::protocol::RawResponseItemEvent;
use llmx_app_server_protocol::AddConversationListenerParams;
use llmx_app_server_protocol::AddConversationSubscriptionResponse;
use llmx_app_server_protocol::InputItem;
use llmx_app_server_protocol::JSONRPCNotification;
use llmx_app_server_protocol::JSONRPCResponse;
use llmx_app_server_protocol::NewConversationParams;
use llmx_app_server_protocol::NewConversationResponse;
use llmx_app_server_protocol::RequestId;
use llmx_app_server_protocol::SendUserMessageParams;
use llmx_app_server_protocol::SendUserMessageResponse;
use llmx_protocol::ConversationId;
use llmx_protocol::models::ContentItem;
use llmx_protocol::models::ResponseItem;
use llmx_protocol::protocol::RawResponseItemEvent;
use pretty_assertions::assert_eq;
use std::path::Path;
use tempfile::TempDir;

View File

@@ -1,11 +1,11 @@
use anyhow::Result;
use app_test_support::McpProcess;
use app_test_support::to_response;
use codex_app_server_protocol::JSONRPCResponse;
use codex_app_server_protocol::RequestId;
use codex_app_server_protocol::SetDefaultModelParams;
use codex_app_server_protocol::SetDefaultModelResponse;
use codex_core::config::ConfigToml;
use llmx_app_server_protocol::JSONRPCResponse;
use llmx_app_server_protocol::RequestId;
use llmx_app_server_protocol::SetDefaultModelParams;
use llmx_app_server_protocol::SetDefaultModelResponse;
use llmx_core::config::ConfigToml;
use pretty_assertions::assert_eq;
use std::path::Path;
use tempfile::TempDir;

View File

@@ -1,9 +1,9 @@
use anyhow::Result;
use app_test_support::McpProcess;
use app_test_support::to_response;
use codex_app_server_protocol::GetUserAgentResponse;
use codex_app_server_protocol::JSONRPCResponse;
use codex_app_server_protocol::RequestId;
use llmx_app_server_protocol::GetUserAgentResponse;
use llmx_app_server_protocol::JSONRPCResponse;
use llmx_app_server_protocol::RequestId;
use pretty_assertions::assert_eq;
use tempfile::TempDir;
use tokio::time::timeout;
@@ -30,7 +30,7 @@ async fn get_user_agent_returns_current_codex_user_agent() -> Result<()> {
os_info.os_type(),
os_info.version(),
os_info.architecture().unwrap_or("unknown"),
codex_core::terminal::user_agent()
llmx_core::terminal::user_agent()
);
let received: GetUserAgentResponse = to_response(response)?;

View File

@@ -3,10 +3,10 @@ use app_test_support::ChatGptAuthFixture;
use app_test_support::McpProcess;
use app_test_support::to_response;
use app_test_support::write_chatgpt_auth;
use codex_app_server_protocol::JSONRPCResponse;
use codex_app_server_protocol::RequestId;
use codex_app_server_protocol::UserInfoResponse;
use codex_core::auth::AuthCredentialsStoreMode;
use llmx_app_server_protocol::JSONRPCResponse;
use llmx_app_server_protocol::RequestId;
use llmx_app_server_protocol::UserInfoResponse;
use llmx_core::auth::AuthCredentialsStoreMode;
use pretty_assertions::assert_eq;
use std::time::Duration;
use tempfile::TempDir;

View File

@@ -5,21 +5,21 @@ use app_test_support::to_response;
use app_test_support::ChatGptAuthFixture;
use app_test_support::write_chatgpt_auth;
use codex_app_server_protocol::Account;
use codex_app_server_protocol::AuthMode;
use codex_app_server_protocol::CancelLoginAccountParams;
use codex_app_server_protocol::CancelLoginAccountResponse;
use codex_app_server_protocol::GetAccountParams;
use codex_app_server_protocol::GetAccountResponse;
use codex_app_server_protocol::JSONRPCError;
use codex_app_server_protocol::JSONRPCResponse;
use codex_app_server_protocol::LoginAccountResponse;
use codex_app_server_protocol::LogoutAccountResponse;
use codex_app_server_protocol::RequestId;
use codex_app_server_protocol::ServerNotification;
use codex_core::auth::AuthCredentialsStoreMode;
use codex_login::login_with_api_key;
use codex_protocol::account::PlanType as AccountPlanType;
use llmx_app_server_protocol::Account;
use llmx_app_server_protocol::AuthMode;
use llmx_app_server_protocol::CancelLoginAccountParams;
use llmx_app_server_protocol::CancelLoginAccountResponse;
use llmx_app_server_protocol::GetAccountParams;
use llmx_app_server_protocol::GetAccountResponse;
use llmx_app_server_protocol::JSONRPCError;
use llmx_app_server_protocol::JSONRPCResponse;
use llmx_app_server_protocol::LoginAccountResponse;
use llmx_app_server_protocol::LogoutAccountResponse;
use llmx_app_server_protocol::RequestId;
use llmx_app_server_protocol::ServerNotification;
use llmx_core::auth::AuthCredentialsStoreMode;
use llmx_login::login_with_api_key;
use llmx_protocol::account::PlanType as AccountPlanType;
use pretty_assertions::assert_eq;
use serial_test::serial;
use std::path::Path;

View File

@@ -4,14 +4,14 @@ use anyhow::Result;
use anyhow::anyhow;
use app_test_support::McpProcess;
use app_test_support::to_response;
use codex_app_server_protocol::JSONRPCError;
use codex_app_server_protocol::JSONRPCResponse;
use codex_app_server_protocol::Model;
use codex_app_server_protocol::ModelListParams;
use codex_app_server_protocol::ModelListResponse;
use codex_app_server_protocol::ReasoningEffortOption;
use codex_app_server_protocol::RequestId;
use codex_protocol::config_types::ReasoningEffort;
use llmx_app_server_protocol::JSONRPCError;
use llmx_app_server_protocol::JSONRPCResponse;
use llmx_app_server_protocol::Model;
use llmx_app_server_protocol::ModelListParams;
use llmx_app_server_protocol::ModelListResponse;
use llmx_app_server_protocol::ReasoningEffortOption;
use llmx_app_server_protocol::RequestId;
use llmx_protocol::config_types::ReasoningEffort;
use pretty_assertions::assert_eq;
use tempfile::TempDir;
use tokio::time::timeout;

View File

@@ -3,14 +3,14 @@ use app_test_support::ChatGptAuthFixture;
use app_test_support::McpProcess;
use app_test_support::to_response;
use app_test_support::write_chatgpt_auth;
use codex_app_server_protocol::GetAccountRateLimitsResponse;
use codex_app_server_protocol::JSONRPCError;
use codex_app_server_protocol::JSONRPCResponse;
use codex_app_server_protocol::LoginApiKeyParams;
use codex_app_server_protocol::RateLimitSnapshot;
use codex_app_server_protocol::RateLimitWindow;
use codex_app_server_protocol::RequestId;
use codex_core::auth::AuthCredentialsStoreMode;
use llmx_app_server_protocol::GetAccountRateLimitsResponse;
use llmx_app_server_protocol::JSONRPCError;
use llmx_app_server_protocol::JSONRPCResponse;
use llmx_app_server_protocol::LoginApiKeyParams;
use llmx_app_server_protocol::RateLimitSnapshot;
use llmx_app_server_protocol::RateLimitWindow;
use llmx_app_server_protocol::RequestId;
use llmx_core::auth::AuthCredentialsStoreMode;
use pretty_assertions::assert_eq;
use serde_json::json;
use std::path::Path;

View File

@@ -1,14 +1,14 @@
use anyhow::Result;
use app_test_support::McpProcess;
use app_test_support::to_response;
use codex_app_server_protocol::JSONRPCResponse;
use codex_app_server_protocol::RequestId;
use codex_app_server_protocol::ThreadArchiveParams;
use codex_app_server_protocol::ThreadArchiveResponse;
use codex_app_server_protocol::ThreadStartParams;
use codex_app_server_protocol::ThreadStartResponse;
use codex_core::ARCHIVED_SESSIONS_SUBDIR;
use codex_core::find_conversation_path_by_id_str;
use llmx_app_server_protocol::JSONRPCResponse;
use llmx_app_server_protocol::RequestId;
use llmx_app_server_protocol::ThreadArchiveParams;
use llmx_app_server_protocol::ThreadArchiveResponse;
use llmx_app_server_protocol::ThreadStartParams;
use llmx_app_server_protocol::ThreadStartResponse;
use llmx_core::ARCHIVED_SESSIONS_SUBDIR;
use llmx_core::find_conversation_path_by_id_str;
use std::path::Path;
use tempfile::TempDir;
use tokio::time::timeout;

View File

@@ -2,10 +2,10 @@ use anyhow::Result;
use app_test_support::McpProcess;
use app_test_support::create_fake_rollout;
use app_test_support::to_response;
use codex_app_server_protocol::JSONRPCResponse;
use codex_app_server_protocol::RequestId;
use codex_app_server_protocol::ThreadListParams;
use codex_app_server_protocol::ThreadListResponse;
use llmx_app_server_protocol::JSONRPCResponse;
use llmx_app_server_protocol::RequestId;
use llmx_app_server_protocol::ThreadListParams;
use llmx_app_server_protocol::ThreadListResponse;
use serde_json::json;
use tempfile::TempDir;
use tokio::time::timeout;

View File

@@ -2,12 +2,12 @@ use anyhow::Result;
use app_test_support::McpProcess;
use app_test_support::create_mock_chat_completions_server;
use app_test_support::to_response;
use codex_app_server_protocol::JSONRPCResponse;
use codex_app_server_protocol::RequestId;
use codex_app_server_protocol::ThreadResumeParams;
use codex_app_server_protocol::ThreadResumeResponse;
use codex_app_server_protocol::ThreadStartParams;
use codex_app_server_protocol::ThreadStartResponse;
use llmx_app_server_protocol::JSONRPCResponse;
use llmx_app_server_protocol::RequestId;
use llmx_app_server_protocol::ThreadResumeParams;
use llmx_app_server_protocol::ThreadResumeResponse;
use llmx_app_server_protocol::ThreadStartParams;
use llmx_app_server_protocol::ThreadStartResponse;
use tempfile::TempDir;
use tokio::time::timeout;

View File

@@ -2,12 +2,12 @@ use anyhow::Result;
use app_test_support::McpProcess;
use app_test_support::create_mock_chat_completions_server;
use app_test_support::to_response;
use codex_app_server_protocol::JSONRPCNotification;
use codex_app_server_protocol::JSONRPCResponse;
use codex_app_server_protocol::RequestId;
use codex_app_server_protocol::ThreadStartParams;
use codex_app_server_protocol::ThreadStartResponse;
use codex_app_server_protocol::ThreadStartedNotification;
use llmx_app_server_protocol::JSONRPCNotification;
use llmx_app_server_protocol::JSONRPCResponse;
use llmx_app_server_protocol::RequestId;
use llmx_app_server_protocol::ThreadStartParams;
use llmx_app_server_protocol::ThreadStartResponse;
use llmx_app_server_protocol::ThreadStartedNotification;
use std::path::Path;
use tempfile::TempDir;
use tokio::time::timeout;

View File

@@ -5,15 +5,15 @@ use app_test_support::McpProcess;
use app_test_support::create_mock_chat_completions_server;
use app_test_support::create_shell_sse_response;
use app_test_support::to_response;
use codex_app_server_protocol::JSONRPCResponse;
use codex_app_server_protocol::RequestId;
use codex_app_server_protocol::ThreadStartParams;
use codex_app_server_protocol::ThreadStartResponse;
use codex_app_server_protocol::TurnInterruptParams;
use codex_app_server_protocol::TurnInterruptResponse;
use codex_app_server_protocol::TurnStartParams;
use codex_app_server_protocol::TurnStartResponse;
use codex_app_server_protocol::UserInput as V2UserInput;
use llmx_app_server_protocol::JSONRPCResponse;
use llmx_app_server_protocol::RequestId;
use llmx_app_server_protocol::ThreadStartParams;
use llmx_app_server_protocol::ThreadStartResponse;
use llmx_app_server_protocol::TurnInterruptParams;
use llmx_app_server_protocol::TurnInterruptResponse;
use llmx_app_server_protocol::TurnStartParams;
use llmx_app_server_protocol::TurnStartResponse;
use llmx_app_server_protocol::UserInput as V2UserInput;
use tempfile::TempDir;
use tokio::time::timeout;

View File

@@ -5,21 +5,21 @@ use app_test_support::create_mock_chat_completions_server;
use app_test_support::create_mock_chat_completions_server_unchecked;
use app_test_support::create_shell_sse_response;
use app_test_support::to_response;
use codex_app_server_protocol::JSONRPCNotification;
use codex_app_server_protocol::JSONRPCResponse;
use codex_app_server_protocol::RequestId;
use codex_app_server_protocol::ServerRequest;
use codex_app_server_protocol::ThreadStartParams;
use codex_app_server_protocol::ThreadStartResponse;
use codex_app_server_protocol::TurnStartParams;
use codex_app_server_protocol::TurnStartResponse;
use codex_app_server_protocol::TurnStartedNotification;
use codex_app_server_protocol::UserInput as V2UserInput;
use codex_core::protocol_config_types::ReasoningEffort;
use codex_core::protocol_config_types::ReasoningSummary;
use codex_protocol::parse_command::ParsedCommand;
use codex_protocol::protocol::Event;
use codex_protocol::protocol::EventMsg;
use llmx_app_server_protocol::JSONRPCNotification;
use llmx_app_server_protocol::JSONRPCResponse;
use llmx_app_server_protocol::RequestId;
use llmx_app_server_protocol::ServerRequest;
use llmx_app_server_protocol::ThreadStartParams;
use llmx_app_server_protocol::ThreadStartResponse;
use llmx_app_server_protocol::TurnStartParams;
use llmx_app_server_protocol::TurnStartResponse;
use llmx_app_server_protocol::TurnStartedNotification;
use llmx_app_server_protocol::UserInput as V2UserInput;
use llmx_core::protocol_config_types::ReasoningEffort;
use llmx_core::protocol_config_types::ReasoningSummary;
use llmx_protocol::parse_command::ParsedCommand;
use llmx_protocol::protocol::Event;
use llmx_protocol::protocol::EventMsg;
use core_test_support::skip_if_no_network;
use pretty_assertions::assert_eq;
use std::path::Path;
@@ -87,7 +87,7 @@ async fn turn_start_emits_notifications_and_accepts_model_override() -> Result<(
serde_json::from_value(notif.params.expect("params must be present"))?;
assert_eq!(
started.turn.status,
codex_app_server_protocol::TurnStatus::InProgress
llmx_app_server_protocol::TurnStatus::InProgress
);
// Send a second turn that exercises the overrides path: change the model.
@@ -272,7 +272,7 @@ async fn turn_start_exec_approval_toggle_v2() -> Result<()> {
// Approve and wait for task completion
mcp.send_response(
request_id,
serde_json::json!({ "decision": codex_core::protocol::ReviewDecision::Approved }),
serde_json::json!({ "decision": llmx_core::protocol::ReviewDecision::Approved }),
)
.await?;
timeout(
@@ -288,8 +288,8 @@ async fn turn_start_exec_approval_toggle_v2() -> Result<()> {
input: vec![V2UserInput::Text {
text: "run python again".to_string(),
}],
approval_policy: Some(codex_app_server_protocol::AskForApproval::Never),
sandbox_policy: Some(codex_app_server_protocol::SandboxPolicy::DangerFullAccess),
approval_policy: Some(llmx_app_server_protocol::AskForApproval::Never),
sandbox_policy: Some(llmx_app_server_protocol::SandboxPolicy::DangerFullAccess),
model: Some("mock-model".to_string()),
effort: Some(ReasoningEffort::Medium),
summary: Some(ReasoningSummary::Auto),
@@ -380,8 +380,8 @@ async fn turn_start_updates_sandbox_and_cwd_between_turns_v2() -> Result<()> {
text: "first turn".to_string(),
}],
cwd: Some(first_cwd.clone()),
approval_policy: Some(codex_app_server_protocol::AskForApproval::Never),
sandbox_policy: Some(codex_app_server_protocol::SandboxPolicy::WorkspaceWrite {
approval_policy: Some(llmx_app_server_protocol::AskForApproval::Never),
sandbox_policy: Some(llmx_app_server_protocol::SandboxPolicy::WorkspaceWrite {
writable_roots: vec![first_cwd.clone()],
network_access: false,
exclude_tmpdir_env_var: false,
@@ -411,8 +411,8 @@ async fn turn_start_updates_sandbox_and_cwd_between_turns_v2() -> Result<()> {
text: "second turn".to_string(),
}],
cwd: Some(second_cwd.clone()),
approval_policy: Some(codex_app_server_protocol::AskForApproval::Never),
sandbox_policy: Some(codex_app_server_protocol::SandboxPolicy::DangerFullAccess),
approval_policy: Some(llmx_app_server_protocol::AskForApproval::Never),
sandbox_policy: Some(llmx_app_server_protocol::SandboxPolicy::DangerFullAccess),
model: Some("mock-model".to_string()),
effort: Some(ReasoningEffort::Medium),
summary: Some(ReasoningSummary::Auto),