Skip to content

Commit e780262

Browse files
committed
Clean up RFD
1 parent ee2755d commit e780262

2 files changed

Lines changed: 21 additions & 25 deletions

File tree

docs/rfds/custom-llm-endpoint.mdx

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,23 @@ If `providers` is absent, clients must treat provider methods as unsupported.
102102
### Types
103103

104104
```typescript
105-
/** Well-known API protocol identifiers. */
106-
type LlmProtocol = "anthropic" | "openai" | "azure" | "vertex" | "bedrock";
105+
/**
106+
* Well-known API protocol identifiers for LLM providers.
107+
*
108+
* This is an open string type: agents and clients MUST handle unknown
109+
* protocol identifiers gracefully.
110+
*
111+
* Protocol names beginning with `_` are free for custom use, like other
112+
* ACP extension methods. Protocol names that do not begin with `_` are
113+
* reserved for the ACP spec.
114+
*/
115+
type LlmProtocol =
116+
| "anthropic"
117+
| "openai"
118+
| "azure"
119+
| "vertex"
120+
| "bedrock"
121+
| string;
107122

108123
interface ProviderCurrentConfig {
109124
/** Protocol currently used by this provider. */
@@ -172,8 +187,9 @@ interface ProvidersSetRequest {
172187
/**
173188
* Full headers map for this provider.
174189
* May include authorization, routing, or other integration-specific headers.
190+
* Omitting this field is equivalent to an empty map (no headers).
175191
*/
176-
headers: Record<string, string>;
192+
headers?: Record<string, string>;
177193

178194
/** Extension metadata */
179195
_meta?: Record<string, unknown>;
@@ -321,7 +337,7 @@ interface ProvidersDisableResponse {
321337
3. **List semantics**: `providers/list` returns configurable providers, their supported protocol types, current effective routing, and `required` flag. Providers SHOULD remain discoverable in list after `providers/disable`.
322338
4. **Client behavior for required providers**: clients SHOULD NOT call `providers/disable` for providers where `required: true`.
323339
5. **Disabled state encoding**: in `providers/list`, `current: null` means the provider is disabled and MUST NOT be used by the agent for LLM calls.
324-
6. **Set semantics and validation**: `providers/set` replaces the full configuration for the target `id` (`apiType`, `baseUrl`, full `headers`). If `id` is unknown, `apiType` is unsupported for that provider, or params are malformed, agents SHOULD return `invalid_params`.
340+
6. **Set semantics and validation**: `providers/set` replaces the full configuration for the target `id` (`apiType`, `baseUrl`, `headers`); an omitted `headers` field is treated as an empty map. If `id` is unknown, `apiType` is unsupported for that provider, or params are malformed, agents SHOULD return `invalid_params`.
325341
7. **Disable semantics**: `providers/disable` disables the target provider at runtime. A disabled provider MUST appear in `providers/list` with `current: null`. If target provider has `required: true`, agents MUST return `invalid_params`. Disabling an unknown `id` SHOULD be treated as success (idempotent behavior).
326342
8. **Scope and persistence**: provider configuration is process-scoped and SHOULD NOT be persisted to disk.
327343

src/agent.rs

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3593,7 +3593,7 @@ impl ListProvidersResponse {
35933593
///
35943594
/// Replaces the full configuration for one provider id.
35953595
#[cfg(feature = "unstable_llm_providers")]
3596-
#[derive(Clone, Serialize, Deserialize, JsonSchema, PartialEq, Eq)]
3596+
#[derive(Clone, Debug, Serialize, Deserialize, JsonSchema, PartialEq, Eq)]
35973597
#[schemars(extend("x-side" = "agent", "x-method" = PROVIDERS_SET_METHOD_NAME))]
35983598
#[serde(rename_all = "camelCase")]
35993599
#[non_exhaustive]
@@ -3617,26 +3617,6 @@ pub struct SetProvidersRequest {
36173617
pub meta: Option<Meta>,
36183618
}
36193619

3620-
#[cfg(feature = "unstable_llm_providers")]
3621-
impl std::fmt::Debug for SetProvidersRequest {
3622-
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3623-
f.debug_struct("SetProvidersRequest")
3624-
.field("id", &self.id)
3625-
.field("api_type", &self.api_type)
3626-
.field("base_url", &self.base_url)
3627-
.field(
3628-
"headers",
3629-
&self
3630-
.headers
3631-
.keys()
3632-
.map(|k| (k.as_str(), "[REDACTED]"))
3633-
.collect::<Vec<_>>(),
3634-
)
3635-
.field("meta", &self.meta)
3636-
.finish()
3637-
}
3638-
}
3639-
36403620
#[cfg(feature = "unstable_llm_providers")]
36413621
impl SetProvidersRequest {
36423622
#[must_use]

0 commit comments

Comments
 (0)