protocol cleanup (#9147)

This commit is contained in:
Jack Amadeo
2026-05-22 17:04:46 -04:00
committed by GitHub
parent 48d20e72d3
commit 0a958213db
19 changed files with 2378 additions and 1788 deletions
@@ -56,7 +56,7 @@ fn acp_catalog_and_custom_provider_methods_use_core_provider_store() {
let catalog = send_custom(
conn.cx(),
"_goose/providers/catalog/list",
"_goose/unstable/providers/catalog/list",
serde_json::json!({ "format": "openai" }),
)
.await
@@ -74,7 +74,7 @@ fn acp_catalog_and_custom_provider_methods_use_core_provider_store() {
let setup_catalog = send_custom(
conn.cx(),
"_goose/providers/setup/catalog/list",
"_goose/unstable/providers/setup/catalog/list",
serde_json::json!({}),
)
.await
@@ -137,7 +137,7 @@ fn acp_catalog_and_custom_provider_methods_use_core_provider_store() {
let template = send_custom(
conn.cx(),
"_goose/providers/catalog/template",
"_goose/unstable/providers/catalog/template",
serde_json::json!({ "providerId": "zai" }),
)
.await
@@ -156,7 +156,7 @@ fn acp_catalog_and_custom_provider_methods_use_core_provider_store() {
let configured_status = send_custom(
conn.cx(),
"_goose/providers/config/status",
"_goose/unstable/providers/config/status",
serde_json::json!({ "providerIds": ["xai"] }),
)
.await
@@ -172,7 +172,7 @@ fn acp_catalog_and_custom_provider_methods_use_core_provider_store() {
let configured_read = send_custom(
conn.cx(),
"_goose/providers/config/read",
"_goose/unstable/providers/config/read",
serde_json::json!({ "providerId": "xai" }),
)
.await
@@ -194,7 +194,7 @@ fn acp_catalog_and_custom_provider_methods_use_core_provider_store() {
let non_oauth_auth = send_custom(
conn.cx(),
"_goose/providers/config/authenticate",
"_goose/unstable/providers/config/authenticate",
serde_json::json!({ "providerId": "xai" }),
)
.await;
@@ -210,7 +210,7 @@ fn acp_catalog_and_custom_provider_methods_use_core_provider_store() {
let created = send_custom(
conn.cx(),
"_goose/providers/custom/create",
"_goose/unstable/providers/custom/create",
serde_json::json!({
"engine": "openai_compatible",
"displayName": "Stark ACP Provider",
@@ -292,7 +292,7 @@ fn acp_catalog_and_custom_provider_methods_use_core_provider_store() {
let read = send_custom(
conn.cx(),
"_goose/providers/custom/read",
"_goose/unstable/providers/custom/read",
serde_json::json!({ "providerId": provider_id }),
)
.await
@@ -321,7 +321,7 @@ fn acp_catalog_and_custom_provider_methods_use_core_provider_store() {
let inventory = send_custom(
conn.cx(),
"_goose/providers/list",
"_goose/unstable/providers/list",
serde_json::json!({ "providerIds": [provider_id] }),
)
.await
@@ -337,7 +337,7 @@ fn acp_catalog_and_custom_provider_methods_use_core_provider_store() {
let updated = send_custom(
conn.cx(),
"_goose/providers/custom/update",
"_goose/unstable/providers/custom/update",
serde_json::json!({
"providerId": provider_id,
"engine": "openai",
@@ -392,7 +392,7 @@ fn acp_catalog_and_custom_provider_methods_use_core_provider_store() {
let auth_disabled = send_custom(
conn.cx(),
"_goose/providers/custom/update",
"_goose/unstable/providers/custom/update",
serde_json::json!({
"providerId": provider_id,
"engine": "openai_compatible",
@@ -432,7 +432,7 @@ fn acp_catalog_and_custom_provider_methods_use_core_provider_store() {
let auth_reenabled_without_key = send_custom(
conn.cx(),
"_goose/providers/custom/update",
"_goose/unstable/providers/custom/update",
serde_json::json!({
"providerId": provider_id,
"engine": "openai_compatible",
@@ -464,7 +464,7 @@ fn acp_catalog_and_custom_provider_methods_use_core_provider_store() {
let deleted = send_custom(
conn.cx(),
"_goose/providers/custom/delete",
"_goose/unstable/providers/custom/delete",
serde_json::json!({ "providerId": provider_id }),
)
.await
@@ -494,7 +494,7 @@ fn acp_catalog_and_custom_provider_methods_use_core_provider_store() {
let deleted_status = send_custom(
conn.cx(),
"_goose/providers/config/status",
"_goose/unstable/providers/config/status",
serde_json::json!({ "providerIds": [provider_id] }),
)
.await
@@ -518,7 +518,7 @@ fn acp_catalog_and_custom_provider_methods_use_core_provider_store() {
] {
let read = send_custom(
conn.cx(),
"_goose/providers/custom/read",
"_goose/unstable/providers/custom/read",
serde_json::json!({ "providerId": invalid_id }),
)
.await;
@@ -570,7 +570,12 @@ fn acp_catalog_and_custom_provider_methods_use_core_provider_store() {
payload_obj.insert(key.clone(), value.clone());
}
let result = send_custom(conn.cx(), "_goose/providers/custom/create", payload).await;
let result = send_custom(
conn.cx(),
"_goose/unstable/providers/custom/create",
payload,
)
.await;
assert!(result.is_err(), "{name} should be rejected");
}
@@ -580,7 +585,7 @@ fn acp_catalog_and_custom_provider_methods_use_core_provider_store() {
let shared = send_custom(
conn.cx(),
"_goose/providers/custom/create",
"_goose/unstable/providers/custom/create",
serde_json::json!({
"engine": "openai_compatible",
"displayName": "Shared Secret Test",
@@ -613,7 +618,7 @@ fn acp_catalog_and_custom_provider_methods_use_core_provider_store() {
send_custom(
conn.cx(),
"_goose/providers/custom/update",
"_goose/unstable/providers/custom/update",
serde_json::json!({
"providerId": shared_id,
"engine": "openai_compatible",
@@ -635,7 +640,7 @@ fn acp_catalog_and_custom_provider_methods_use_core_provider_store() {
let shared_delete = send_custom(
conn.cx(),
"_goose/providers/custom/create",
"_goose/unstable/providers/custom/create",
serde_json::json!({
"engine": "openai_compatible",
"displayName": "Shared Secret Delete",
@@ -668,7 +673,7 @@ fn acp_catalog_and_custom_provider_methods_use_core_provider_store() {
send_custom(
conn.cx(),
"_goose/providers/custom/delete",
"_goose/unstable/providers/custom/delete",
serde_json::json!({ "providerId": shared_delete_id }),
)
.await
+47 -27
View File
@@ -79,7 +79,7 @@ fn test_custom_get_tools() {
let result = send_custom(
conn.cx(),
"_goose/tools",
"_goose/unstable/tools/list",
serde_json::json!({ "sessionId": session_id }),
)
.await;
@@ -97,8 +97,12 @@ fn test_custom_get_extensions() {
let openai = OpenAiFixture::new(vec![], Arc::new(EnforceSessionId::default())).await;
let conn = AcpServerConnection::new(TestConnectionConfig::default(), openai).await;
let result =
send_custom(conn.cx(), "_goose/config/extensions", serde_json::json!({})).await;
let result = send_custom(
conn.cx(),
"_goose/unstable/config/extensions/list",
serde_json::json!({}),
)
.await;
assert!(result.is_ok(), "expected ok, got: {:?}", result);
let response = result.unwrap();
@@ -221,7 +225,7 @@ fn test_custom_list_builtin_skill_sources() {
let response = send_custom(
conn.cx(),
"_goose/sources/list",
"_goose/unstable/sources/list",
serde_json::json!({ "type": "builtinSkill" }),
)
.await
@@ -253,9 +257,13 @@ fn test_custom_provider_inventory_includes_metadata() {
let openai = OpenAiFixture::new(vec![], Arc::new(EnforceSessionId::default())).await;
let conn = AcpServerConnection::new(TestConnectionConfig::default(), openai).await;
let response = send_custom(conn.cx(), "_goose/providers/list", serde_json::json!({}))
.await
.expect("provider inventory should succeed");
let response = send_custom(
conn.cx(),
"_goose/unstable/providers/list",
serde_json::json!({}),
)
.await
.expect("provider inventory should succeed");
let providers = response
.get("entries")
.and_then(|value| value.as_array())
@@ -294,7 +302,7 @@ fn test_custom_preferences_read_save_remove() {
let response = send_custom(
conn.cx(),
"_goose/preferences/read",
"_goose/unstable/preferences/read",
serde_json::json!({
"keys": [
"autoCompactThreshold",
@@ -316,7 +324,7 @@ fn test_custom_preferences_read_save_remove() {
send_custom(
conn.cx(),
"_goose/preferences/save",
"_goose/unstable/preferences/save",
serde_json::json!({
"values": [
{ "key": "voiceDictationProvider", "value": "__disabled__" },
@@ -329,7 +337,7 @@ fn test_custom_preferences_read_save_remove() {
send_custom(
conn.cx(),
"_goose/preferences/remove",
"_goose/unstable/preferences/remove",
serde_json::json!({
"keys": ["voiceDictationProvider"],
}),
@@ -339,7 +347,7 @@ fn test_custom_preferences_read_save_remove() {
let response = send_custom(
conn.cx(),
"_goose/preferences/read",
"_goose/unstable/preferences/read",
serde_json::json!({
"keys": ["voiceDictationProvider", "voiceDictationPreferredMic"],
}),
@@ -381,13 +389,13 @@ fn test_custom_preferences_save_rejects_invalid_values() {
];
for payload in invalid_payloads {
let result = send_custom(conn.cx(), "_goose/preferences/save", payload).await;
let result = send_custom(conn.cx(), "_goose/unstable/preferences/save", payload).await;
assert!(result.is_err(), "expected invalid params error");
}
let result = send_custom(
conn.cx(),
"_goose/preferences/save",
"_goose/unstable/preferences/save",
serde_json::json!({
"values": [
{ "key": "voiceDictationPreferredMic", "value": "mic-1" },
@@ -400,7 +408,7 @@ fn test_custom_preferences_save_rejects_invalid_values() {
let response = send_custom(
conn.cx(),
"_goose/preferences/read",
"_goose/unstable/preferences/read",
serde_json::json!({
"keys": ["voiceDictationPreferredMic"],
}),
@@ -432,9 +440,13 @@ fn test_custom_defaults_read() {
};
let conn = AcpServerConnection::new(config, openai).await;
let response = send_custom(conn.cx(), "_goose/defaults/read", serde_json::json!({}))
.await
.expect("defaults read should succeed");
let response = send_custom(
conn.cx(),
"_goose/unstable/defaults/read",
serde_json::json!({}),
)
.await
.expect("defaults read should succeed");
assert_eq!(
response,
serde_json::json!({
@@ -472,7 +484,7 @@ fn test_custom_dictation_secret_save_delete() {
send_custom(
conn.cx(),
"_goose/dictation/secret/save",
"_goose/unstable/dictation/secret/save",
serde_json::json!({
"provider": "groq",
"value": "groq-key",
@@ -481,9 +493,13 @@ fn test_custom_dictation_secret_save_delete() {
.await
.expect("dictation secret save should succeed");
let config = send_custom(conn.cx(), "_goose/dictation/config", serde_json::json!({}))
.await
.expect("dictation config should succeed");
let config = send_custom(
conn.cx(),
"_goose/unstable/dictation/config",
serde_json::json!({}),
)
.await
.expect("dictation config should succeed");
assert_eq!(
config
.pointer("/providers/groq/configured")
@@ -493,7 +509,7 @@ fn test_custom_dictation_secret_save_delete() {
let provider_config_result = send_custom(
conn.cx(),
"_goose/dictation/secret/save",
"_goose/unstable/dictation/secret/save",
serde_json::json!({
"provider": "openai",
"value": "openai-key",
@@ -507,7 +523,7 @@ fn test_custom_dictation_secret_save_delete() {
let unknown_result = send_custom(
conn.cx(),
"_goose/dictation/secret/save",
"_goose/unstable/dictation/secret/save",
serde_json::json!({
"provider": "unknown",
"value": "key",
@@ -521,7 +537,7 @@ fn test_custom_dictation_secret_save_delete() {
send_custom(
conn.cx(),
"_goose/dictation/secret/delete",
"_goose/unstable/dictation/secret/delete",
serde_json::json!({
"provider": "groq",
}),
@@ -529,9 +545,13 @@ fn test_custom_dictation_secret_save_delete() {
.await
.expect("dictation secret delete should succeed");
let config = send_custom(conn.cx(), "_goose/dictation/config", serde_json::json!({}))
.await
.expect("dictation config should succeed");
let config = send_custom(
conn.cx(),
"_goose/unstable/dictation/config",
serde_json::json!({}),
)
.await
.expect("dictation config should succeed");
assert_eq!(
config
.pointer("/providers/groq/configured")
@@ -113,7 +113,7 @@ fn acp_secret_mutations_and_inventory_refresh_invalidate_global_secret_cache() {
write_secrets(&config_dir, "GROQ_API_KEY: fresh-key\n");
send_custom(
conn.cx(),
"_goose/dictation/secret/save",
"_goose/unstable/dictation/secret/save",
serde_json::json!({
"provider": "groq",
"value": "fresh-key",
@@ -133,7 +133,7 @@ fn acp_secret_mutations_and_inventory_refresh_invalidate_global_secret_cache() {
write_secrets(&config_dir, "{}\n");
send_custom(
conn.cx(),
"_goose/dictation/secret/delete",
"_goose/unstable/dictation/secret/delete",
serde_json::json!({
"provider": "groq",
}),
@@ -151,7 +151,7 @@ fn acp_secret_mutations_and_inventory_refresh_invalidate_global_secret_cache() {
let save_provider_config = send_custom(
conn.cx(),
"_goose/providers/config/save",
"_goose/unstable/providers/config/save",
serde_json::json!({
"providerId": "xai",
"fields": [
@@ -199,7 +199,7 @@ fn acp_secret_mutations_and_inventory_refresh_invalidate_global_secret_cache() {
let read_provider_config = send_custom(
conn.cx(),
"_goose/providers/config/read",
"_goose/unstable/providers/config/read",
serde_json::json!({
"providerId": "xai",
}),
@@ -223,7 +223,7 @@ fn acp_secret_mutations_and_inventory_refresh_invalidate_global_secret_cache() {
let delete_provider_config = send_custom(
conn.cx(),
"_goose/providers/config/delete",
"_goose/unstable/providers/config/delete",
serde_json::json!({
"providerId": "xai",
}),
@@ -255,7 +255,7 @@ fn acp_secret_mutations_and_inventory_refresh_invalidate_global_secret_cache() {
let refresh = send_custom(
conn.cx(),
"_goose/providers/inventory/refresh",
"_goose/unstable/providers/inventory/refresh",
serde_json::json!({
"providerIds": ["anthropic"],
}),