mirror of
https://github.com/openai/codex.git
synced 2026-11-24 15:21:20 +00:00
Upgrade rmcp to 3.0.0-beta.3 (#35720)
## What changed - Update the `rmcp` model and transport integrations for `3.0.0-beta.3`. - Preserve legacy `elicitation/create` form requests, schema defaults, metadata, and wire-format compatibility while adopting the new elicitation types. - Harden OAuth discovery by using GET-first discovery without starting an MCP session, preventing cross-origin header redirects, validating authorization-server and callback issuers, and retaining compatibility with metadata that omits an issuer. - Keep stored OAuth credentials readable and avoid requiring reauthorization after transient refresh failures. ## Testing - Add coverage for legacy elicitation round trips, OAuth discovery variants, callback issuer validation, credential migration, and refresh failures. GitOrigin-RevId: 756197d26f3fd347c28c400228f6b3d06ed493b7
This commit is contained in:
1 parent
899539c03a
commit
61de0d8fe8
48 files changed
+1391
-639
No files matched your search
@@ -248,13 +248,11 @@ impl ElicitationRequestManager {
|
||||
);
|
||||
let routed_request_id = RequestId::String(public_request_id.clone().into());
|
||||
let request = match elicitation {
|
||||
Elicitation::Mcp(
|
||||
rmcp::model::CreateElicitationRequestParams::FormElicitationParams {
|
||||
meta,
|
||||
message,
|
||||
requested_schema,
|
||||
},
|
||||
) => ElicitationRequest::Form {
|
||||
Elicitation::Mcp(rmcp::model::ElicitRequestParams::FormElicitationParams {
|
||||
meta,
|
||||
message,
|
||||
requested_schema,
|
||||
}) => ElicitationRequest::Form {
|
||||
meta: meta
|
||||
.map(serde_json::to_value)
|
||||
.transpose()
|
||||
@@ -263,14 +261,12 @@ impl ElicitationRequestManager {
|
||||
requested_schema: serde_json::to_value(requested_schema)
|
||||
.context("failed to serialize MCP elicitation schema")?,
|
||||
},
|
||||
Elicitation::Mcp(
|
||||
rmcp::model::CreateElicitationRequestParams::UrlElicitationParams {
|
||||
meta,
|
||||
message,
|
||||
url,
|
||||
elicitation_id,
|
||||
},
|
||||
) => ElicitationRequest::Url {
|
||||
Elicitation::Mcp(rmcp::model::ElicitRequestParams::UrlElicitationParams {
|
||||
meta,
|
||||
message,
|
||||
url,
|
||||
elicitation_id,
|
||||
}) => ElicitationRequest::Url {
|
||||
meta: meta
|
||||
.map(serde_json::to_value)
|
||||
.transpose()
|
||||
@@ -279,6 +275,13 @@ impl ElicitationRequestManager {
|
||||
url,
|
||||
elicitation_id,
|
||||
},
|
||||
Elicitation::Mcp(_) => {
|
||||
return Ok(ElicitationResponse {
|
||||
action: ElicitationAction::Decline,
|
||||
content: None,
|
||||
meta: None,
|
||||
});
|
||||
}
|
||||
Elicitation::OpenAiForm {
|
||||
meta,
|
||||
message,
|
||||
@@ -327,16 +330,13 @@ type ResponderMap = HashMap<(String, RequestId), oneshot::Sender<ElicitationResp
|
||||
|
||||
fn can_auto_accept_elicitation(elicitation: &Elicitation) -> bool {
|
||||
match elicitation {
|
||||
Elicitation::Mcp(rmcp::model::CreateElicitationRequestParams::FormElicitationParams {
|
||||
Elicitation::Mcp(rmcp::model::ElicitRequestParams::FormElicitationParams {
|
||||
requested_schema,
|
||||
..
|
||||
}) => {
|
||||
// Auto-accept confirm/approval elicitations without schema requirements.
|
||||
requested_schema.properties.is_empty()
|
||||
}
|
||||
Elicitation::Mcp(rmcp::model::CreateElicitationRequestParams::UrlElicitationParams {
|
||||
..
|
||||
})
|
||||
| Elicitation::OpenAiForm { .. } => false,
|
||||
Elicitation::Mcp(_) | Elicitation::OpenAiForm { .. } => false,
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user