feat(providers): advertise responses API agent capability

This commit is contained in:
ZheFox
2026-07-28 12:02:03 +08:00
parent f0f87b56a3
commit 0bf92ffffc
@@ -39,6 +39,7 @@ const AUTHORIZATION_HEADER: &str = "authorization";
const ASSERTION_PREFIX: &str = "AgentAssertion ";
const CODEX_AGENT_IDENTITY_AGENT_HARNESS_ID: &str = "codex-cli";
const CODEX_AGENT_IDENTITY_RUNNING_LOCATION: &str = "local";
const CODEX_AGENT_IDENTITY_RESPONSES_API_CAPABILITY: &str = "responsesapi";
/// The AgentAssertion scheme is generated internally after an Agent Identity
/// task has been registered. Keep the scheme check separate from envelope
@@ -740,6 +741,8 @@ async fn register_codex_agent_identity_from_access_token_with_auth_api_base_url(
"running_location": CODEX_AGENT_IDENTITY_RUNNING_LOCATION,
},
"agent_public_key": agent_public_key,
"capabilities": [CODEX_AGENT_IDENTITY_RESPONSES_API_CAPABILITY],
"ttl": null,
})),
body_bytes: None,
network,
@@ -1414,6 +1417,20 @@ mod tests {
.and_then(|abom| abom.get("agent_harness_id")),
Some(&json!("codex-cli"))
);
assert_eq!(
requests[0]
.json_body
.as_ref()
.and_then(|body| body.get("capabilities")),
Some(&json!(["responsesapi"]))
);
assert_eq!(
requests[0]
.json_body
.as_ref()
.and_then(|body| body.get("ttl")),
Some(&json!(null))
);
assert!(requests[0]
.json_body
.as_ref()