Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions MODULE.bazel.lock

Large diffs are not rendered by default.

33 changes: 16 additions & 17 deletions codex-rs/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions codex-rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ members = [
resolver = "2"

[workspace.package]
version = "0.0.0"
version = "0.142.0"
# Track the edition for all workspace crates in one place. Individual
# crates can still override this value, but keeping it here means new
# crates created with `cargo new -w ...` automatically inherit the 2024
Expand Down Expand Up @@ -546,11 +546,11 @@ opt-level = 0
# ratatui = { path = "../../ratatui" }
crossterm = { git = "https://github.com/nornagon/crossterm", rev = "87db8bfa6dc99427fd3b071681b07fc31c6ce995" }
ratatui = { git = "https://github.com/nornagon/ratatui", rev = "9b2ad1298408c45918ee9f8241a6f95498cdbed2" }
tokio-tungstenite = { git = "https://github.com/openai-oss-forks/tokio-tungstenite", rev = "e5e64b86722c5453c4038131c3193faa49a648ad" }
tungstenite = { git = "https://github.com/openai-oss-forks/tungstenite-rs", rev = "9200079d3b54a1ff51072e24d81fd354f085156f" }
tokio-tungstenite = { git = "https://github.com/openai-oss-forks/tokio-tungstenite", rev = "0e5b2d73aa18dd9f0a50ee9ff199d5aef7594186" }
tungstenite = { git = "https://github.com/openai-oss-forks/tungstenite-rs", rev = "4fffad30fe373adbdcffab9545e9e9bf4f2fc19f" }

# Uncomment to debug local changes.
# rmcp = { path = "../../rust-sdk/crates/rmcp" }

[patch."ssh://git@github.com/openai-oss-forks/tungstenite-rs.git"]
tungstenite = { git = "https://github.com/openai-oss-forks/tungstenite-rs", rev = "9200079d3b54a1ff51072e24d81fd354f085156f" }
tungstenite = { git = "https://github.com/openai-oss-forks/tungstenite-rs", rev = "4fffad30fe373adbdcffab9545e9e9bf4f2fc19f" }
28 changes: 24 additions & 4 deletions codex-rs/agent-identity/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ pub struct AgentIdentityJwtClaims {
pub agent_private_key: String,
pub account_id: String,
pub chatgpt_user_id: String,
pub email: String,
pub email: Option<String>,
pub plan_type: AuthPlanType,
pub chatgpt_account_is_fedramp: bool,
}
Expand Down Expand Up @@ -667,13 +667,33 @@ mod tests {
agent_private_key: "private-key".to_string(),
account_id: "account-id".to_string(),
chatgpt_user_id: "user-id".to_string(),
email: "user@example.com".to_string(),
email: Some("user@example.com".to_string()),
plan_type: AuthPlanType::Known(KnownPlan::Pro),
chatgpt_account_is_fedramp: false,
}
);
}

#[test]
fn decode_agent_identity_jwt_accepts_missing_email() {
let jwt = jwt_with_payload(serde_json::json!({
"iss": AGENT_IDENTITY_JWT_ISSUER,
"aud": AGENT_IDENTITY_JWT_AUDIENCE,
"iat": 1_700_000_000usize,
"exp": 4_000_000_000usize,
"agent_runtime_id": "agent-runtime-id",
"agent_private_key": "private-key",
"account_id": "account-id",
"chatgpt_user_id": "user-id",
"plan_type": "pro",
"chatgpt_account_is_fedramp": false,
}));

let claims = decode_agent_identity_jwt(&jwt, /*jwks*/ None).expect("JWT should decode");

assert_eq!(claims.email, None);
}

#[test]
fn decode_agent_identity_jwt_maps_raw_plan_aliases() {
let jwt = jwt_with_payload(serde_json::json!({
Expand Down Expand Up @@ -707,7 +727,7 @@ mod tests {
agent_private_key: "private-key".to_string(),
account_id: "account-id".to_string(),
chatgpt_user_id: "user-id".to_string(),
email: "user@example.com".to_string(),
email: Some("user@example.com".to_string()),
plan_type: AuthPlanType::Known(KnownPlan::Pro),
chatgpt_account_is_fedramp: false,
};
Expand Down Expand Up @@ -739,7 +759,7 @@ mod tests {
agent_private_key: "private-key".to_string(),
account_id: "account-id".to_string(),
chatgpt_user_id: "user-id".to_string(),
email: "user@example.com".to_string(),
email: Some("user@example.com".to_string()),
plan_type: AuthPlanType::Known(KnownPlan::Pro),
chatgpt_account_is_fedramp: false,
};
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 14 additions & 1 deletion codex-rs/app-server-protocol/src/protocol/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2854,7 +2854,7 @@ mod tests {
);

let chatgpt = v2::Account::Chatgpt {
email: "user@example.com".to_string(),
email: Some("user@example.com".to_string()),
plan_type: PlanType::Plus,
};
assert_eq!(
Expand All @@ -2866,6 +2866,19 @@ mod tests {
serde_json::to_value(&chatgpt)?,
);

let chatgpt_without_email = v2::Account::Chatgpt {
email: None,
plan_type: PlanType::Pro,
};
assert_eq!(
json!({
"type": "chatgpt",
"email": null,
"planType": "pro",
}),
serde_json::to_value(&chatgpt_without_email)?,
);

let codex_managed_bedrock = v2::Account::AmazonBedrock {
credential_source: AmazonBedrockCredentialSource::CodexManaged,
};
Expand Down
12 changes: 11 additions & 1 deletion codex-rs/app-server-protocol/src/protocol/v2/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ pub enum Account {

#[serde(rename = "chatgpt", rename_all = "camelCase")]
#[ts(rename = "chatgpt", rename_all = "camelCase")]
Chatgpt { email: String, plan_type: PlanType },
Chatgpt {
#[schemars(required, schema_with = "nullable_string_schema")]
email: Option<String>,
plan_type: PlanType,
},

#[serde(rename = "amazonBedrock", rename_all = "camelCase")]
#[ts(rename = "amazonBedrock", rename_all = "camelCase")]
Expand All @@ -35,6 +39,12 @@ pub enum Account {
},
}

fn nullable_string_schema(
generator: &mut schemars::r#gen::SchemaGenerator,
) -> schemars::schema::Schema {
generator.subschema_for::<Option<String>>()
}

fn default_bedrock_credential_source() -> AmazonBedrockCredentialSource {
AmazonBedrockCredentialSource::AwsManaged
}
Expand Down
2 changes: 2 additions & 0 deletions codex-rs/app-server-protocol/src/protocol/v2/permissions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,8 @@ pub struct PermissionProfileSummary {
pub id: String,
/// Optional user-facing description for display in clients.
pub description: Option<String>,
/// Whether the effective requirements allow selecting this profile.
pub allowed: bool,
}

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
Expand Down
3 changes: 3 additions & 0 deletions codex-rs/app-server-test-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ uuid = { workspace = true, features = ["v4"] }

[lib]
doctest = false

[dev-dependencies]
pretty_assertions = { workspace = true }
4 changes: 4 additions & 0 deletions codex-rs/app-server-test-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ cargo run -p codex-app-server-test-client -- \
cargo run -p codex-app-server-test-client -- model-list
```

`send-message` and `send-message-v2` handle `request_user_input` server requests interactively.
When Codex asks a question, choose a numbered option (or `o` for a free-form answer when offered)
and the client will send the response and continue streaming the same turn.

## Testing Plugin Analytics

The `plugin-analytics-smoke` command exercises `plugin/installed`, plugin
Expand Down
Loading