@@ -11915,6 +12059,8 @@ pub struct SessionMetadataContextInfoResultContextInfo {
pub conversation_tokens: i64,
/// Total context limit for /context display. promptTokenLimit + min(32k or 64k, outputTokenLimit) depending on model.
pub limit: i64,
+ /// Tokens consumed by MCP tool definitions (subset of toolDefinitionsTokens, excludes deferred tools)
+ pub mcp_tools_tokens: i64,
/// The model used for token counting
pub model_name: String,
/// Maximum prompt tokens allowed by the model (or DEFAULT_TOKEN_LIMIT if unspecified)
@@ -13732,6 +13878,20 @@ pub enum ModelPolicyState {
Unknown,
}
+#[derive(Debug, Clone, Default, PartialEq, Eq, Serialize, Deserialize)]
+pub enum ModelSwitchToRequestContextTier {
+ /// Use the model's default context window.
+ #[serde(rename = "default")]
+ Default,
+ /// Pin the session to the long-context tier when supported.
+ #[serde(rename = "long_context")]
+ LongContext,
+ /// Unknown variant for forward compatibility.
+ #[default]
+ #[serde(other)]
+ Unknown,
+}
+
/// How env values are passed to MCP servers (`direct` inlines literal values; `indirect` resolves at launch).
///
///
diff --git a/rust/src/generated/rpc.rs b/rust/src/generated/rpc.rs
index 34dcc8ae7..25726978e 100644
--- a/rust/src/generated/rpc.rs
+++ b/rust/src/generated/rpc.rs
@@ -83,6 +83,13 @@ impl<'a> ClientRpc<'a> {
}
}
+ /// `user.*` sub-namespace.
+ pub fn user(&self) -> ClientRpcUser<'a> {
+ ClientRpcUser {
+ client: self.client,
+ }
+ }
+
/// Checks server responsiveness and returns protocol information.
///
/// Wire method: `ping`.
@@ -347,6 +354,18 @@ impl<'a> ClientRpcMcpConfig<'a> {
.await?;
Ok(())
}
+
+ /// Drops this runtime process's in-memory MCP server-definition cache so the next MCP config read observes disk.
+ ///
+ /// Wire method: `mcp.config.reload`.
+ pub async fn reload(&self) -> Result<(), Error> {
+ let wire_params = serde_json::json!({});
+ let _value = self
+ .client
+ .call(rpc_methods::MCP_CONFIG_RELOAD, Some(wire_params))
+ .await?;
+ Ok(())
+ }
}
/// `models.*` RPCs.
@@ -1162,6 +1181,41 @@ impl<'a> ClientRpcTools<'a> {
}
}
+/// `user.*` RPCs.
+#[derive(Clone, Copy)]
+pub struct ClientRpcUser<'a> {
+ pub(crate) client: &'a Client,
+}
+
+impl<'a> ClientRpcUser<'a> {
+ /// `user.settings.*` sub-namespace.
+ pub fn settings(&self) -> ClientRpcUserSettings<'a> {
+ ClientRpcUserSettings {
+ client: self.client,
+ }
+ }
+}
+
+/// `user.settings.*` RPCs.
+#[derive(Clone, Copy)]
+pub struct ClientRpcUserSettings<'a> {
+ pub(crate) client: &'a Client,
+}
+
+impl<'a> ClientRpcUserSettings<'a> {
+ /// Drops this runtime process's in-memory user settings cache so the next settings read observes disk.
+ ///
+ /// Wire method: `user.settings.reload`.
+ pub async fn reload(&self) -> Result<(), Error> {
+ let wire_params = serde_json::json!({});
+ let _value = self
+ .client
+ .call(rpc_methods::USER_SETTINGS_RELOAD, Some(wire_params))
+ .await?;
+ Ok(())
+ }
+}
+
/// Typed view over a [`Session`]'s RPC namespace.
#[derive(Clone, Copy)]
pub struct SessionRpc<'a> {
@@ -3439,7 +3493,7 @@ impl<'a> SessionRpcModel<'a> {
///
/// # Parameters
///
- /// * `params` - Target model identifier and optional reasoning effort, summary, and capability overrides.
+ /// * `params` - Target model identifier and optional reasoning effort, summary, capability overrides, and context tier.
///
/// # Returns
///
@@ -3501,6 +3555,64 @@ impl<'a> SessionRpcModel<'a> {
.await?;
Ok(serde_json::from_value(_value)?)
}
+
+ /// Lists models available to this session using its own auth and integration context. Connected hosts (CLI TUI, GitHub App) should call this through the session client so remote sessions return the remote CLI's available models rather than the caller's.
+ ///
+ /// Wire method: `session.model.list`.
+ ///
+ /// # Returns
+ ///
+ /// The list of models available to this session.
+ ///
+ ///
+ ///
+ /// **Experimental.** This API is part of an experimental wire-protocol surface
+ /// and may change or be removed in future SDK or CLI releases. Pin both the
+ /// SDK and CLI versions if your code depends on it.
+ ///
+ ///
+ pub async fn list(&self) -> Result
{
+ let wire_params = serde_json::json!({ "sessionId": self.session.id() });
+ let _value = self
+ .session
+ .client()
+ .call(rpc_methods::SESSION_MODEL_LIST, Some(wire_params))
+ .await?;
+ Ok(serde_json::from_value(_value)?)
+ }
+
+ /// Lists models available to this session using its own auth and integration context. Connected hosts (CLI TUI, GitHub App) should call this through the session client so remote sessions return the remote CLI's available models rather than the caller's.
+ ///
+ /// Wire method: `session.model.list`.
+ ///
+ /// # Parameters
+ ///
+ /// * `params` - Optional listing options.
+ ///
+ /// # Returns
+ ///
+ /// The list of models available to this session.
+ ///
+ ///
+ ///
+ /// **Experimental.** This API is part of an experimental wire-protocol surface
+ /// and may change or be removed in future SDK or CLI releases. Pin both the
+ /// SDK and CLI versions if your code depends on it.
+ ///
+ ///
+ pub async fn list_with_params(
+ &self,
+ params: ModelListRequest,
+ ) -> Result {
+ let mut wire_params = serde_json::to_value(params)?;
+ wire_params["sessionId"] = serde_json::Value::String(self.session.id().to_string());
+ let _value = self
+ .session
+ .client()
+ .call(rpc_methods::SESSION_MODEL_LIST, Some(wire_params))
+ .await?;
+ Ok(serde_json::from_value(_value)?)
+ }
}
/// `session.name.*` RPCs.
@@ -5450,6 +5562,34 @@ impl<'a> SessionRpcTools<'a> {
.await?;
Ok(serde_json::from_value(_value)?)
}
+
+ /// Returns lightweight metadata for the session's currently initialized tools.
+ ///
+ /// Wire method: `session.tools.getCurrentMetadata`.
+ ///
+ /// # Returns
+ ///
+ /// Current lightweight tool metadata snapshot for the session.
+ ///
+ ///
+ ///
+ /// **Experimental.** This API is part of an experimental wire-protocol surface
+ /// and may change or be removed in future SDK or CLI releases. Pin both the
+ /// SDK and CLI versions if your code depends on it.
+ ///
+ ///
+ pub async fn get_current_metadata(&self) -> Result {
+ let wire_params = serde_json::json!({ "sessionId": self.session.id() });
+ let _value = self
+ .session
+ .client()
+ .call(
+ rpc_methods::SESSION_TOOLS_GETCURRENTMETADATA,
+ Some(wire_params),
+ )
+ .await?;
+ Ok(serde_json::from_value(_value)?)
+ }
}
/// `session.ui.*` RPCs.
diff --git a/rust/src/session.rs b/rust/src/session.rs
index 1fcf433a5..58570ab6b 100644
--- a/rust/src/session.rs
+++ b/rust/src/session.rs
@@ -525,6 +525,7 @@ impl Session {
reasoning_effort: opts.reasoning_effort,
reasoning_summary: opts.reasoning_summary,
model_capabilities: opts.model_capabilities,
+ ..ModelSwitchToRequest::default()
};
self.rpc().model().switch_to(request).await?;
Ok(())
diff --git a/rust/tests/e2e/rpc_session_state.rs b/rust/tests/e2e/rpc_session_state.rs
index 80b6d1bfb..956a8c90e 100644
--- a/rust/tests/e2e/rpc_session_state.rs
+++ b/rust/tests/e2e/rpc_session_state.rs
@@ -75,6 +75,7 @@ async fn should_call_session_rpc_model_switchto() {
reasoning_effort: Some("none".to_string()),
model_capabilities: None,
reasoning_summary: None,
+ ..Default::default()
})
.await
.expect("switch model");
diff --git a/test/harness/package-lock.json b/test/harness/package-lock.json
index 66987acd5..37f3b1a88 100644
--- a/test/harness/package-lock.json
+++ b/test/harness/package-lock.json
@@ -9,7 +9,7 @@
"version": "1.0.0",
"license": "ISC",
"devDependencies": {
- "@github/copilot": "^1.0.55-7",
+ "@github/copilot": "^1.0.55",
"@modelcontextprotocol/sdk": "^1.26.0",
"@types/node": "^25.3.3",
"@types/node-forge": "^1.3.14",
@@ -464,9 +464,9 @@
}
},
"node_modules/@github/copilot": {
- "version": "1.0.55-7",
- "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.55-7.tgz",
- "integrity": "sha512-TczFrIaHH2sel6FM007H4FzT+Ipkj++I5u8Vx2ECWz9u24H7WOx/RpWcp6ExnSY1KSK1MtXaGcniAuqVi8Khaw==",
+ "version": "1.0.55",
+ "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.55.tgz",
+ "integrity": "sha512-wqzI0L7krORW6jDAQPx7VnInka5BYN5yVgu+dpUK4w8xP5RgnOBa6kRoXpydj/9O1ufs0k6RKRtQjsVLp52TRw==",
"dev": true,
"license": "SEE LICENSE IN LICENSE.md",
"dependencies": {
@@ -476,20 +476,20 @@
"copilot": "npm-loader.js"
},
"optionalDependencies": {
- "@github/copilot-darwin-arm64": "1.0.55-7",
- "@github/copilot-darwin-x64": "1.0.55-7",
- "@github/copilot-linux-arm64": "1.0.55-7",
- "@github/copilot-linux-x64": "1.0.55-7",
- "@github/copilot-linuxmusl-arm64": "1.0.55-7",
- "@github/copilot-linuxmusl-x64": "1.0.55-7",
- "@github/copilot-win32-arm64": "1.0.55-7",
- "@github/copilot-win32-x64": "1.0.55-7"
+ "@github/copilot-darwin-arm64": "1.0.55",
+ "@github/copilot-darwin-x64": "1.0.55",
+ "@github/copilot-linux-arm64": "1.0.55",
+ "@github/copilot-linux-x64": "1.0.55",
+ "@github/copilot-linuxmusl-arm64": "1.0.55",
+ "@github/copilot-linuxmusl-x64": "1.0.55",
+ "@github/copilot-win32-arm64": "1.0.55",
+ "@github/copilot-win32-x64": "1.0.55"
}
},
"node_modules/@github/copilot-darwin-arm64": {
- "version": "1.0.55-7",
- "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.55-7.tgz",
- "integrity": "sha512-QReU4F5+W0x/Nuc6qO+xYPeNnRjuHIIAeMBc1S+RFQ0T+YWynxRzNHGs9ZkUiIcLJ1F/y8GDq6sq7760Cn+onQ==",
+ "version": "1.0.55",
+ "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.55.tgz",
+ "integrity": "sha512-v59pOpA7YO8j/lpDU/1E8l1Ag0hd26hIiEzTNbzqKd7tJpvhN0XTDWDCink50wXL656XIXt8lD8i8sGeD6yPfA==",
"cpu": [
"arm64"
],
@@ -504,9 +504,9 @@
}
},
"node_modules/@github/copilot-darwin-x64": {
- "version": "1.0.55-7",
- "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.55-7.tgz",
- "integrity": "sha512-qQ0d+XyvIPbNiaIydHBSCTQfWK5s0x1XnlrUKSzadgOnsFobGeldLSKtB159zJEiz0F/in5ythiUGJjWoAQVrA==",
+ "version": "1.0.55",
+ "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.55.tgz",
+ "integrity": "sha512-XrJ9ent/9ogLk8yNp3TMsNVW0qTRDlkw/b34VnTgbAkJCaI3UVqaqpFn60Laa6J5mOPW0/JeKIkkva+7IJdqpQ==",
"cpu": [
"x64"
],
@@ -521,9 +521,9 @@
}
},
"node_modules/@github/copilot-linux-arm64": {
- "version": "1.0.55-7",
- "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.55-7.tgz",
- "integrity": "sha512-+2zlHahK3fUfkrnlHqbdQsZMPZwRfchoTxDZd9UHbEhQF7eNLzYN+7frWs6AZujU+h/1i92+mcLT18AQXI3KxQ==",
+ "version": "1.0.55",
+ "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.55.tgz",
+ "integrity": "sha512-5Q46Q72/l/U8KQRcBwYjzFPNXBCPG177FTmjEVOAH0qk7w58fMUDBEpnf9n1IpxYJDWQJ5BFGtLdfYgVVtkevw==",
"cpu": [
"arm64"
],
@@ -538,9 +538,9 @@
}
},
"node_modules/@github/copilot-linux-x64": {
- "version": "1.0.55-7",
- "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.55-7.tgz",
- "integrity": "sha512-SGmvWcJHIKDIsjYZdFQloGw3Re6r2N1Zv1VuB1yV1ClVqfG5i5pTvai6vzX8d3WgGgRzrkLksDrzZKR27zJZ7A==",
+ "version": "1.0.55",
+ "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.55.tgz",
+ "integrity": "sha512-KWmMCDmKJivvOyDAAe5K8r7uSlVq8aZCh20VfrVXsc4bckO6KjXY/TOagrdBNqkk5rh8v63ghBbxFdWIOvEJRA==",
"cpu": [
"x64"
],
@@ -555,9 +555,9 @@
}
},
"node_modules/@github/copilot-linuxmusl-arm64": {
- "version": "1.0.55-7",
- "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.55-7.tgz",
- "integrity": "sha512-rJkZLvz4KeGoLgyX6gcONgTNfFxeoQvN4jaAXlbD1nFP3hJbLTuY0CB4fBHmZWktrPkRL/j5aDGxrcIcl+Xg3A==",
+ "version": "1.0.55",
+ "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.55.tgz",
+ "integrity": "sha512-Jb5ug9Ic1pzxB2ZT1xoR8b3Ea1xnvCa4h8cBque51+TevXe6QF98vAfSUIwLe4xu+K6JKhiKEA0SD3w29Z74eA==",
"cpu": [
"arm64"
],
@@ -572,9 +572,9 @@
}
},
"node_modules/@github/copilot-linuxmusl-x64": {
- "version": "1.0.55-7",
- "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.55-7.tgz",
- "integrity": "sha512-uPb08qgJHY1QW2YhA1OBJ9PB0CDwCvtuttWbeZ+AW+qfFVsvBpARU1cdEl/xT4IXMhBFoJiePv3BnLGjVZtoWA==",
+ "version": "1.0.55",
+ "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.55.tgz",
+ "integrity": "sha512-qMGIjHxKmW9q26EpoaNKWpmEVGyL/IM8ThVkh7yolDzv9lECFudPzT5yLX7f+VIiF6qWQlrQyzmamp7/fNQ2Zg==",
"cpu": [
"x64"
],
@@ -589,9 +589,9 @@
}
},
"node_modules/@github/copilot-win32-arm64": {
- "version": "1.0.55-7",
- "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.55-7.tgz",
- "integrity": "sha512-mb4Sg2sJjmK9Rq8XCRuhoIOjUScB5p2Ct9ZtTbC3ipvONWMOMjYPbLvC8K9GAHcYcHLdv98hvzv3+qjBhb5tZQ==",
+ "version": "1.0.55",
+ "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.55.tgz",
+ "integrity": "sha512-TO4EJ8it6Qki7wMKYHqGUEDYmB0EAToy+pE5++OpydB6FijyQ31+/XwjvdnEFkuB4ZgPqu/6Y8hxMKucl2+FYg==",
"cpu": [
"arm64"
],
@@ -606,9 +606,9 @@
}
},
"node_modules/@github/copilot-win32-x64": {
- "version": "1.0.55-7",
- "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.55-7.tgz",
- "integrity": "sha512-GL9jAtkn2Kx4IO9ZfTiMC3LFd539KuuOx3uOIKciWKMuCvcfct0rdVkXlDr+EnrmPzu1A4PavcJ0RScpI39jUQ==",
+ "version": "1.0.55",
+ "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.55.tgz",
+ "integrity": "sha512-TBMiSZMz8Dhx79JeSEM+7ONGxR5NmxfiDUdySo6thVbRmjS9D8msyAP8ucTsbLBJcTFeb7vsaeObD/ujYQgDtA==",
"cpu": [
"x64"
],
diff --git a/test/harness/package.json b/test/harness/package.json
index 987137af3..fc2043356 100644
--- a/test/harness/package.json
+++ b/test/harness/package.json
@@ -11,7 +11,7 @@
"test": "vitest run"
},
"devDependencies": {
- "@github/copilot": "^1.0.55-7",
+ "@github/copilot": "^1.0.55",
"@modelcontextprotocol/sdk": "^1.26.0",
"@types/node": "^25.3.3",
"@types/node-forge": "^1.3.14",