mirror of
https://github.com/openai/codex.git
synced 2026-11-22 23:00:42 +00:00
@@ -797,6 +797,10 @@ fn installation_check(show_details: bool) -> DoctorCheck {
|
||||
"managed by bun: {}",
|
||||
env::var_os("CODEX_MANAGED_BY_BUN").is_some()
|
||||
));
|
||||
details.push(format!(
|
||||
"managed by pnpm: {}",
|
||||
env::var_os("CODEX_MANAGED_BY_PNPM").is_some()
|
||||
));
|
||||
push_env_path_detail(
|
||||
&mut details,
|
||||
"managed package root",
|
||||
@@ -885,6 +889,7 @@ fn doctor_managed_by_npm(current_exe: Option<&Path>) -> bool {
|
||||
fn inherited_managed_env_for_cargo_binary(current_exe: Option<&Path>) -> bool {
|
||||
if env::var_os("CODEX_MANAGED_BY_NPM").is_none()
|
||||
&& env::var_os("CODEX_MANAGED_BY_BUN").is_none()
|
||||
&& env::var_os("CODEX_MANAGED_BY_PNPM").is_none()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -937,6 +942,9 @@ fn describe_install_context(context: &InstallContext) -> String {
|
||||
InstallMethod::Bun => {
|
||||
describe_method_with_package_layout("bun", context.package_layout.as_ref())
|
||||
}
|
||||
InstallMethod::Pnpm => {
|
||||
describe_method_with_package_layout("pnpm", context.package_layout.as_ref())
|
||||
}
|
||||
InstallMethod::Brew => {
|
||||
describe_method_with_package_layout("brew", context.package_layout.as_ref())
|
||||
}
|
||||
@@ -1327,6 +1335,7 @@ fn stored_auth_mode(auth: &codex_login::AuthDotJson) -> &'static str {
|
||||
AuthMode::ApiKey => "api_key",
|
||||
AuthMode::Chatgpt => "chatgpt",
|
||||
AuthMode::ChatgptAuthTokens => "chatgpt_auth_tokens",
|
||||
AuthMode::Headers => "headers",
|
||||
AuthMode::AgentIdentity => "agent_identity",
|
||||
AuthMode::PersonalAccessToken => "personal_access_token",
|
||||
AuthMode::BedrockApiKey => "bedrock_api_key",
|
||||
@@ -1397,6 +1406,9 @@ fn stored_auth_issues(
|
||||
issues.push("external ChatGPT auth is missing refresh metadata");
|
||||
}
|
||||
}
|
||||
AuthMode::Headers => {
|
||||
issues.push("header auth cannot be loaded from auth storage");
|
||||
}
|
||||
AuthMode::AgentIdentity => {
|
||||
if auth
|
||||
.agent_identity
|
||||
@@ -2371,9 +2383,11 @@ async fn websocket_reachability_check(
|
||||
HeaderValue::from_static(RESPONSES_WEBSOCKETS_V2_BETA_HEADER_VALUE),
|
||||
);
|
||||
let client = ResponsesWebsocketClient::new(api_provider, api_auth);
|
||||
let http_client_factory = config.http_client_factory();
|
||||
match tokio::time::timeout(
|
||||
provider.websocket_connect_timeout(),
|
||||
client.probe_handshake(
|
||||
&http_client_factory,
|
||||
extra_headers,
|
||||
default_headers(),
|
||||
WEBSOCKET_IMMEDIATE_CLOSE_GRACE,
|
||||
@@ -2466,6 +2480,7 @@ fn auth_mode_name(auth: &CodexAuth) -> &'static str {
|
||||
AuthMode::ApiKey => "api_key",
|
||||
AuthMode::Chatgpt => "chatgpt",
|
||||
AuthMode::ChatgptAuthTokens => "chatgpt_auth_tokens",
|
||||
AuthMode::Headers => "headers",
|
||||
AuthMode::AgentIdentity => "agent_identity",
|
||||
AuthMode::PersonalAccessToken => "personal_access_token",
|
||||
AuthMode::BedrockApiKey => "bedrock_api_key",
|
||||
@@ -2605,6 +2620,7 @@ fn provider_auth_reachability_mode_from_auth(
|
||||
Some(
|
||||
AuthMode::Chatgpt
|
||||
| AuthMode::ChatgptAuthTokens
|
||||
| AuthMode::Headers
|
||||
| AuthMode::AgentIdentity
|
||||
| AuthMode::PersonalAccessToken,
|
||||
)
|
||||
|
||||
@@ -1260,7 +1260,7 @@ Environment
|
||||
LESS -FRX
|
||||
✓ runtime running local build on darwin-arm64
|
||||
✓ install consistent
|
||||
managed by npm: no · bun: no · package root —
|
||||
managed by npm: no · bun: no · pnpm: no · package root —
|
||||
✓ search search is OK (bundled)
|
||||
✓ git git version 2.54.0
|
||||
selected git /usr/bin/git
|
||||
|
||||
@@ -211,13 +211,15 @@ fn install_details(parsed: &[ParsedDetail], options: HumanOutputOptions) -> Vec<
|
||||
|
||||
let managed_by_npm = value(parsed, "managed by npm").unwrap_or("false");
|
||||
let managed_by_bun = value(parsed, "managed by bun").unwrap_or("false");
|
||||
let managed_by_pnpm = value(parsed, "managed by pnpm").unwrap_or("false");
|
||||
let package_root = value(parsed, "managed package root").unwrap_or("not set");
|
||||
out.push(HumanDetail::Row {
|
||||
label: "managed by".to_string(),
|
||||
value: format!(
|
||||
"npm: {} · bun: {} · package root {}",
|
||||
"npm: {} · bun: {} · pnpm: {} · package root {}",
|
||||
yes_no(managed_by_npm),
|
||||
yes_no(managed_by_bun),
|
||||
yes_no(managed_by_pnpm),
|
||||
if is_falsy(package_root) {
|
||||
"—".to_string()
|
||||
} else {
|
||||
@@ -263,6 +265,7 @@ fn install_details(parsed: &[ParsedDetail], options: HumanOutputOptions) -> Vec<
|
||||
"install context",
|
||||
"managed by npm",
|
||||
"managed by bun",
|
||||
"managed by pnpm",
|
||||
"managed package root",
|
||||
"PATH codex entries",
|
||||
],
|
||||
|
||||
@@ -121,6 +121,7 @@ fn install_method_name(context: &InstallContext) -> &'static str {
|
||||
InstallMethod::Standalone { .. } => "standalone",
|
||||
InstallMethod::Npm => "npm",
|
||||
InstallMethod::Bun => "bun",
|
||||
InstallMethod::Pnpm => "pnpm",
|
||||
InstallMethod::Brew => "brew",
|
||||
InstallMethod::Other => "local build",
|
||||
}
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ Environment
|
||||
LESS -FRX
|
||||
✓ runtime running local build on darwin-arm64
|
||||
✓ install consistent
|
||||
managed by npm: no · bun: no · package root —
|
||||
managed by npm: no · bun: no · pnpm: no · package root —
|
||||
✓ search search is OK (bundled)
|
||||
✓ git git version 2.54.0
|
||||
selected git /usr/bin/git
|
||||
|
||||
@@ -133,6 +133,7 @@ fn update_action_label(context: &InstallContext) -> &'static str {
|
||||
match &context.method {
|
||||
InstallMethod::Npm => "npm install -g @openai/codex",
|
||||
InstallMethod::Bun => "bun install -g @openai/codex",
|
||||
InstallMethod::Pnpm => "pnpm add -g @openai/codex",
|
||||
InstallMethod::Brew => "brew upgrade --cask codex",
|
||||
InstallMethod::Standalone { .. } => "standalone installer",
|
||||
InstallMethod::Other => "manual or unknown",
|
||||
@@ -144,6 +145,7 @@ fn fetch_latest_version(context: &InstallContext) -> Result<String, String> {
|
||||
InstallMethod::Brew => fetch_homebrew_cask_version(),
|
||||
InstallMethod::Npm
|
||||
| InstallMethod::Bun
|
||||
| InstallMethod::Pnpm
|
||||
| InstallMethod::Standalone { .. }
|
||||
| InstallMethod::Other => fetch_latest_github_release_version(),
|
||||
}
|
||||
@@ -223,6 +225,13 @@ mod tests {
|
||||
}),
|
||||
"npm install -g @openai/codex"
|
||||
);
|
||||
assert_eq!(
|
||||
update_action_label(&InstallContext {
|
||||
method: InstallMethod::Pnpm,
|
||||
package_layout: None,
|
||||
}),
|
||||
"pnpm add -g @openai/codex"
|
||||
);
|
||||
assert_eq!(
|
||||
update_action_label(&InstallContext {
|
||||
method: InstallMethod::Other,
|
||||
|
||||
@@ -449,6 +449,9 @@ pub async fn run_login_status(cli_config_overrides: CliConfigOverrides) -> ! {
|
||||
eprintln!("Logged in using ChatGPT");
|
||||
std::process::exit(0);
|
||||
}
|
||||
AuthMode::Headers => {
|
||||
unreachable!("header auth cannot be loaded from auth storage")
|
||||
}
|
||||
AuthMode::AgentIdentity => {
|
||||
eprintln!("Logged in using access token");
|
||||
std::process::exit(0);
|
||||
|
||||
@@ -963,6 +963,7 @@ async fn run_get(config_overrides: &CliConfigOverrides, get_args: GetArgs) -> Re
|
||||
let approval_mode = match approval_mode {
|
||||
AppToolApproval::Auto => "auto",
|
||||
AppToolApproval::Prompt => "prompt",
|
||||
AppToolApproval::Writes => "writes",
|
||||
AppToolApproval::Approve => "approve",
|
||||
};
|
||||
println!(" default_tools_approval_mode: {approval_mode}");
|
||||
|
||||
Reference in New Issue
Block a user