Skip to content

Commit b336d4e

Browse files
committed
other instead of unknown
1 parent f791108 commit b336d4e

10 files changed

Lines changed: 102 additions & 159 deletions

File tree

docs/protocol/draft/schema-v2.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3063,7 +3063,7 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/exte
30633063
</Expandable>
30643064
</ResponseField>
30653065

3066-
<ResponseField name="unknown" type="object">
3066+
<ResponseField name="other" type="object">
30673067
Custom or future authentication method.
30683068

30693069
Values beginning with `_` are reserved for implementation-specific
@@ -3289,7 +3289,7 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/exte
32893289
</Expandable>
32903290
</ResponseField>
32913291

3292-
<ResponseField name="unknown" type="object">
3292+
<ResponseField name="other" type="object">
32933293
Custom or future command input specification.
32943294

32953295
Values beginning with `_` are reserved for implementation-specific
@@ -3694,7 +3694,7 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/exte
36943694
</Expandable>
36953695
</ResponseField>
36963696

3697-
<ResponseField name="unknown" type="object">
3697+
<ResponseField name="other" type="object">
36983698
Custom or future content block.
36993699

37003700
Values beginning with `_` are reserved for implementation-specific
@@ -6024,7 +6024,7 @@ A search-and-replace suggestion.
60246024
</Expandable>
60256025
</ResponseField>
60266026

6027-
<ResponseField name="unknown" type="object">
6027+
<ResponseField name="other" type="object">
60286028
Custom or future NES suggestion.
60296029

60306030
Values beginning with `_` are reserved for implementation-specific
@@ -6605,7 +6605,7 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/exte
66056605
</Expandable>
66066606
</ResponseField>
66076607

6608-
<ResponseField name="unknown" type="object">
6608+
<ResponseField name="other" type="object">
66096609
Custom or future plan update content.
66106610

66116611
Values beginning with `_` are reserved for implementation-specific
@@ -7189,7 +7189,7 @@ Boolean on/off toggle.
71897189
</Expandable>
71907190
</ResponseField>
71917191

7192-
<ResponseField name="unknown" type="object">
7192+
<ResponseField name="other" type="object">
71937193
Custom or future session configuration option payload.
71947194

71957195
Values beginning with `_` are reserved for implementation-specific
@@ -8010,7 +8010,7 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/exte
80108010
</Expandable>
80118011
</ResponseField>
80128012

8013-
<ResponseField name="unknown" type="object">
8013+
<ResponseField name="other" type="object">
80148014
Custom or future session update.
80158015

80168016
Values beginning with `_` are reserved for implementation-specific
@@ -8445,7 +8445,7 @@ See protocol docs: [Extensibility](https://agentclientprotocol.com/protocol/exte
84458445
</Expandable>
84468446
</ResponseField>
84478447

8448-
<ResponseField name="unknown" type="object">
8448+
<ResponseField name="other" type="object">
84498449
Custom or future tool call content.
84508450

84518451
Values beginning with `_` are reserved for implementation-specific

docs/rfds/v2/enum-variant-extension.mdx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ The v2 Rust schema types should encode this convention directly where fallback b
6565
- Core control-flow discriminators may remain closed when there is no safe fallback behavior.
6666
- SDKs should expose fallback variants that carry unknown values rather than silently discarding them.
6767
- Conversion from v2 to v1 should fail when an unknown v2 value cannot be represented in v1 without data loss.
68-
- v2-to-v1 conversion errors for unknown v2 variants should be structured so compatibility bridges can explicitly decide to drop unsupported informational notifications while continuing to fail requests, responses, and required fields that cannot be represented correctly.
6968
- v1 schemas remain unchanged.
7069

7170
The fallback variant's Rust doc comment should document the `_` extension rule and the future-ACP reservation rule, so generated docs and schemas follow the type source of truth.

schema/schema.v2.unstable.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@
742742
}
743743
},
744744
"required": ["type", "id", "name"],
745-
"title": "unknown",
745+
"title": "other",
746746
"type": "object"
747747
},
748748
{
@@ -948,7 +948,7 @@
948948
}
949949
},
950950
"required": ["type"],
951-
"title": "unknown",
951+
"title": "other",
952952
"type": "object"
953953
}
954954
],
@@ -1972,7 +1972,7 @@
19721972
}
19731973
},
19741974
"required": ["type"],
1975-
"title": "unknown",
1975+
"title": "other",
19761976
"type": "object"
19771977
}
19781978
],
@@ -4908,7 +4908,7 @@
49084908
}
49094909
},
49104910
"required": ["kind"],
4911-
"title": "unknown",
4911+
"title": "other",
49124912
"type": "object"
49134913
}
49144914
],
@@ -5510,7 +5510,7 @@
55105510
}
55115511
},
55125512
"required": ["type"],
5513-
"title": "unknown",
5513+
"title": "other",
55145514
"type": "object"
55155515
}
55165516
],
@@ -6338,7 +6338,7 @@
63386338
}
63396339
},
63406340
"required": ["type"],
6341-
"title": "unknown",
6341+
"title": "other",
63426342
"type": "object"
63436343
}
63446344
],
@@ -7084,7 +7084,7 @@
70847084
}
70857085
},
70867086
"required": ["sessionUpdate"],
7087-
"title": "unknown",
7087+
"title": "other",
70887088
"type": "object"
70897089
}
70907090
],
@@ -7930,7 +7930,7 @@
79307930
}
79317931
},
79327932
"required": ["type"],
7933-
"title": "unknown",
7933+
"title": "other",
79347934
"type": "object"
79357935
}
79367936
],

src/v2/agent.rs

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ pub enum AuthMethod {
531531
/// payload when storing, replaying, proxying, or forwarding initialization
532532
/// data, and otherwise ignore the method or display it generically.
533533
#[serde(untagged)]
534-
Unknown(UnknownAuthMethod),
534+
Other(OtherAuthMethod),
535535
/// Agent handles authentication itself.
536536
///
537537
/// This is the default when no `type` is specified.
@@ -545,7 +545,7 @@ impl AuthMethod {
545545
pub fn id(&self) -> &AuthMethodId {
546546
match self {
547547
Self::Agent(a) => &a.id,
548-
Self::Unknown(a) => &a.id,
548+
Self::Other(a) => &a.id,
549549
#[cfg(feature = "unstable_auth_methods")]
550550
Self::EnvVar(e) => &e.id,
551551
#[cfg(feature = "unstable_auth_methods")]
@@ -558,7 +558,7 @@ impl AuthMethod {
558558
pub fn name(&self) -> &str {
559559
match self {
560560
Self::Agent(a) => &a.name,
561-
Self::Unknown(a) => &a.name,
561+
Self::Other(a) => &a.name,
562562
#[cfg(feature = "unstable_auth_methods")]
563563
Self::EnvVar(e) => &e.name,
564564
#[cfg(feature = "unstable_auth_methods")]
@@ -571,7 +571,7 @@ impl AuthMethod {
571571
pub fn description(&self) -> Option<&str> {
572572
match self {
573573
Self::Agent(a) => a.description.as_deref(),
574-
Self::Unknown(a) => a.description.as_deref(),
574+
Self::Other(a) => a.description.as_deref(),
575575
#[cfg(feature = "unstable_auth_methods")]
576576
Self::EnvVar(e) => e.description.as_deref(),
577577
#[cfg(feature = "unstable_auth_methods")]
@@ -588,7 +588,7 @@ impl AuthMethod {
588588
pub fn meta(&self) -> Option<&Meta> {
589589
match self {
590590
Self::Agent(a) => a.meta.as_ref(),
591-
Self::Unknown(a) => a.meta.as_ref(),
591+
Self::Other(a) => a.meta.as_ref(),
592592
#[cfg(feature = "unstable_auth_methods")]
593593
Self::EnvVar(e) => e.meta.as_ref(),
594594
#[cfg(feature = "unstable_auth_methods")]
@@ -601,10 +601,10 @@ impl AuthMethod {
601601
#[skip_serializing_none]
602602
#[derive(Debug, Clone, Serialize, JsonSchema, PartialEq, Eq)]
603603
#[schemars(inline)]
604-
#[schemars(transform = unknown_auth_method_schema)]
604+
#[schemars(transform = other_auth_method_schema)]
605605
#[serde(rename_all = "camelCase")]
606606
#[non_exhaustive]
607-
pub struct UnknownAuthMethod {
607+
pub struct OtherAuthMethod {
608608
/// Custom or future authentication method type.
609609
///
610610
/// Values beginning with `_` are reserved for implementation-specific
@@ -630,7 +630,7 @@ pub struct UnknownAuthMethod {
630630
pub fields: BTreeMap<String, serde_json::Value>,
631631
}
632632

633-
impl UnknownAuthMethod {
633+
impl OtherAuthMethod {
634634
#[must_use]
635635
pub fn new(
636636
type_: impl Into<String>,
@@ -672,14 +672,14 @@ impl UnknownAuthMethod {
672672
}
673673
}
674674

675-
impl<'de> Deserialize<'de> for UnknownAuthMethod {
675+
impl<'de> Deserialize<'de> for OtherAuthMethod {
676676
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
677677
where
678678
D: serde::Deserializer<'de>,
679679
{
680680
#[derive(Deserialize)]
681681
#[serde(rename_all = "camelCase")]
682-
struct RawUnknownAuthMethod {
682+
struct RawOtherAuthMethod {
683683
#[serde(rename = "type")]
684684
type_: String,
685685
id: AuthMethodId,
@@ -691,7 +691,7 @@ impl<'de> Deserialize<'de> for UnknownAuthMethod {
691691
fields: BTreeMap<String, serde_json::Value>,
692692
}
693693

694-
let raw = RawUnknownAuthMethod::deserialize(deserializer)?;
694+
let raw = RawOtherAuthMethod::deserialize(deserializer)?;
695695
if is_known_auth_method_type(&raw.type_) {
696696
return Err(serde::de::Error::custom(format!(
697697
"known authentication method `{}` did not match its schema",
@@ -719,7 +719,7 @@ fn is_known_auth_method_type(type_: &str) -> bool {
719719
}
720720
}
721721

722-
fn unknown_auth_method_schema(schema: &mut Schema) {
722+
fn other_auth_method_schema(schema: &mut Schema) {
723723
super::schema_util::reject_known_string_discriminators(
724724
schema,
725725
"type",
@@ -2621,16 +2621,16 @@ pub enum SessionConfigKind {
26212621
/// payload when storing, replaying, proxying, or forwarding configuration
26222622
/// data, and otherwise ignore the option or display it generically.
26232623
#[serde(untagged)]
2624-
Unknown(UnknownSessionConfigKind),
2624+
Other(OtherSessionConfigKind),
26252625
}
26262626

26272627
/// Custom or future session configuration option payload.
26282628
#[derive(Debug, Clone, Serialize, JsonSchema, PartialEq, Eq)]
26292629
#[schemars(inline)]
2630-
#[schemars(transform = unknown_session_config_kind_schema)]
2630+
#[schemars(transform = other_session_config_kind_schema)]
26312631
#[serde(rename_all = "camelCase")]
26322632
#[non_exhaustive]
2633-
pub struct UnknownSessionConfigKind {
2633+
pub struct OtherSessionConfigKind {
26342634
/// Custom or future session configuration option type.
26352635
///
26362636
/// Values beginning with `_` are reserved for implementation-specific
@@ -2643,7 +2643,7 @@ pub struct UnknownSessionConfigKind {
26432643
pub fields: BTreeMap<String, serde_json::Value>,
26442644
}
26452645

2646-
impl UnknownSessionConfigKind {
2646+
impl OtherSessionConfigKind {
26472647
#[must_use]
26482648
pub fn new(type_: impl Into<String>, mut fields: BTreeMap<String, serde_json::Value>) -> Self {
26492649
fields.remove("type");
@@ -2654,7 +2654,7 @@ impl UnknownSessionConfigKind {
26542654
}
26552655
}
26562656

2657-
impl<'de> Deserialize<'de> for UnknownSessionConfigKind {
2657+
impl<'de> Deserialize<'de> for OtherSessionConfigKind {
26582658
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
26592659
where
26602660
D: serde::Deserializer<'de>,
@@ -2686,7 +2686,7 @@ fn is_known_session_config_kind_type(type_: &str) -> bool {
26862686
}
26872687
}
26882688

2689-
fn unknown_session_config_kind_schema(schema: &mut Schema) {
2689+
fn other_session_config_kind_schema(schema: &mut Schema) {
26902690
super::schema_util::reject_known_string_discriminators(
26912691
schema,
26922692
"type",
@@ -5889,7 +5889,7 @@ mod test_serialization {
58895889

58905890
assert_eq!(method.id().0.as_ref(), "oauth");
58915891
assert_eq!(method.name(), "OAuth");
5892-
let AuthMethod::Unknown(unknown) = method else {
5892+
let AuthMethod::Other(unknown) = method else {
58935893
panic!("expected unknown auth method");
58945894
};
58955895
assert_eq!(unknown.type_, "_oauth");
@@ -5899,7 +5899,7 @@ mod test_serialization {
58995899
);
59005900

59015901
assert_eq!(
5902-
serde_json::to_value(AuthMethod::Unknown(unknown)).unwrap(),
5902+
serde_json::to_value(AuthMethod::Other(unknown)).unwrap(),
59035903
json!({
59045904
"id": "oauth",
59055905
"name": "OAuth",
@@ -6484,7 +6484,7 @@ mod test_serialization {
64846484
.unwrap();
64856485

64866486
assert_eq!(option.id.to_string(), "verbosity");
6487-
let SessionConfigKind::Unknown(unknown) = &option.kind else {
6487+
let SessionConfigKind::Other(unknown) = &option.kind else {
64886488
panic!("expected unknown config kind");
64896489
};
64906490
assert_eq!(unknown.type_, "_slider");

0 commit comments

Comments
 (0)