test: fix mcp refresh flow after agent key scoping

This commit is contained in:
a.tolmachev
2026-05-03 16:24:30 +00:00
parent a28e6a55cb
commit 10433d5193
+12 -1
View File
@@ -145,6 +145,7 @@ mod tests {
use crank_registry::{
CreateAgentRequest, CreateAsyncJobRequest, CreatePlatformApiKeyRequest,
ListInvocationLogsQuery, PostgresRegistry, PublishAgentRequest, PublishRequest,
SaveAgentBindingsRequest,
};
use crank_runtime::{
RequestRateLimitConfig, RequestRateLimiter, RuntimeExecutor, SecretCrypto,
@@ -1182,6 +1183,7 @@ mod tests {
.await;
let client = reqwest::Client::new();
let mcp_url = agent_mcp_url(&base_url, "sales-refresh");
publish_agent_with_bindings(&registry, "sales-refresh", vec![]).await;
let api_key = create_platform_api_key(
&registry,
"sales-refresh",
@@ -1220,7 +1222,15 @@ mod tests {
})
.await
.unwrap();
publish_agent_for_operation(&registry, &operation, "sales-refresh").await;
registry
.save_agent_bindings(SaveAgentBindingsRequest {
workspace_id: &test_workspace_id(),
agent_id: &test_agent_id("sales-refresh"),
agent_version: 1,
bindings: &[binding_for_operation(&operation)],
})
.await
.unwrap();
let after_publish = post_jsonrpc(
&client,
@@ -2482,6 +2492,7 @@ mod tests {
.send()
.await
.unwrap();
assert_eq!(initialize_response.status(), reqwest::StatusCode::OK);
let session_id = initialize_response
.headers()
.get("MCP-Session-Id")