@@ -10517,21 +10533,6 @@ pub struct SessionShellKillResult {
pub killed: bool,
}
-/// Identifies the target session.
-///
-///
-///
-/// **Experimental.** This type is part of an experimental wire-protocol surface
-/// and may change or be removed in future SDK or CLI releases.
-///
-///
-#[derive(Debug, Clone, Default, Serialize, Deserialize)]
-#[serde(rename_all = "camelCase")]
-pub struct SessionHistoryCompactParams {
- /// Target session identifier
- pub session_id: SessionId,
-}
-
/// Compaction outcome with the number of tokens and messages removed, summary text, and the resulting context window breakdown.
///
///
diff --git a/rust/src/generated/rpc.rs b/rust/src/generated/rpc.rs
index 5831a4553..f73d1bc00 100644
--- a/rust/src/generated/rpc.rs
+++ b/rust/src/generated/rpc.rs
@@ -2174,6 +2174,39 @@ impl<'a> SessionRpcHistory<'a> {
Ok(serde_json::from_value(_value)?)
}
+ /// Compacts the session history to reduce context usage.
+ ///
+ /// Wire method: `session.history.compact`.
+ ///
+ /// # Parameters
+ ///
+ /// * `params` - Optional compaction parameters.
+ ///
+ /// # Returns
+ ///
+ /// Compaction outcome with the number of tokens and messages removed, summary text, and the resulting context window breakdown.
+ ///
+ ///
+ ///
+ /// **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 compact_with_params(
+ &self,
+ params: HistoryCompactRequest,
+ ) -> 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_HISTORY_COMPACT, Some(wire_params))
+ .await?;
+ Ok(serde_json::from_value(_value)?)
+ }
+
/// Truncates persisted session history to a specific event.
///
/// Wire method: `session.history.truncate`.
diff --git a/rust/src/generated/session_events.rs b/rust/src/generated/session_events.rs
index 053c4f8f8..319d632c1 100644
--- a/rust/src/generated/session_events.rs
+++ b/rust/src/generated/session_events.rs
@@ -954,6 +954,9 @@ pub struct SessionCompactionCompleteData {
/// Token count from non-system messages (user, assistant, tool) after compaction
#[serde(skip_serializing_if = "Option::is_none")]
pub conversation_tokens: Option,
+ /// User-supplied focus instructions provided to a manual `/compact` invocation. Omitted for automatic compaction and for manual compaction with no focus text.
+ #[serde(skip_serializing_if = "Option::is_none")]
+ pub custom_instructions: Option,
/// Error message if compaction failed
#[serde(skip_serializing_if = "Option::is_none")]
pub error: Option,
@@ -1232,9 +1235,9 @@ pub struct AssistantUsageQuotaSnapshot {
pub entitlement_requests: i64,
/// Whether the user has an unlimited usage entitlement
pub is_unlimited_entitlement: bool,
- /// Number of requests over the entitlement limit
+ /// Number of additional usage requests made this period
pub overage: f64,
- /// Whether overage is allowed when quota is exhausted
+ /// Whether additional usage is allowed when quota is exhausted
pub overage_allowed_with_exhausted_quota: bool,
/// Percentage of quota remaining (0 to 100)
pub remaining_percentage: f64,
diff --git a/test/harness/package-lock.json b/test/harness/package-lock.json
index 540108690..690cfab45 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.51",
+ "@github/copilot": "^1.0.52-0",
"@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.51",
- "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.51.tgz",
- "integrity": "sha512-yKXbMeApxO8P68/BeSS/lmIRsCprcMdY8MRRp+Vp/QymCv59o4lxDcAIVq2h/CD8vJHoiG4OijdWydd76yoqLw==",
+ "version": "1.0.52-0",
+ "resolved": "https://registry.npmjs.org/@github/copilot/-/copilot-1.0.52-0.tgz",
+ "integrity": "sha512-OpeTdTaPgOwnhdGz5eSQLpcXLm5SPLWDcBRTMtCKANSyNVZCB3xHVEfMtzis+BVdePr1fSnnGIAYaG5wYnsdSg==",
"dev": true,
"license": "SEE LICENSE IN LICENSE.md",
"dependencies": {
@@ -476,20 +476,20 @@
"copilot": "npm-loader.js"
},
"optionalDependencies": {
- "@github/copilot-darwin-arm64": "1.0.51",
- "@github/copilot-darwin-x64": "1.0.51",
- "@github/copilot-linux-arm64": "1.0.51",
- "@github/copilot-linux-x64": "1.0.51",
- "@github/copilot-linuxmusl-arm64": "1.0.51",
- "@github/copilot-linuxmusl-x64": "1.0.51",
- "@github/copilot-win32-arm64": "1.0.51",
- "@github/copilot-win32-x64": "1.0.51"
+ "@github/copilot-darwin-arm64": "1.0.52-0",
+ "@github/copilot-darwin-x64": "1.0.52-0",
+ "@github/copilot-linux-arm64": "1.0.52-0",
+ "@github/copilot-linux-x64": "1.0.52-0",
+ "@github/copilot-linuxmusl-arm64": "1.0.52-0",
+ "@github/copilot-linuxmusl-x64": "1.0.52-0",
+ "@github/copilot-win32-arm64": "1.0.52-0",
+ "@github/copilot-win32-x64": "1.0.52-0"
}
},
"node_modules/@github/copilot-darwin-arm64": {
- "version": "1.0.51",
- "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.51.tgz",
- "integrity": "sha512-i713sW3GzbeLKowGVY6/A97lGkUMJNVdUD0oaUWTWmXX08u+hWsnVKbqL4EQlw7x8xU511X5vkgFMi31DWyCuQ==",
+ "version": "1.0.52-0",
+ "resolved": "https://registry.npmjs.org/@github/copilot-darwin-arm64/-/copilot-darwin-arm64-1.0.52-0.tgz",
+ "integrity": "sha512-LgnSEze1LmrmnKNFP4fYRhH4tmxk0xz7yjXtWb/cuMBkXgAS4nUb5HaO5NZWVbldHshXWuPfOl0cuG7oFuDX8Q==",
"cpu": [
"arm64"
],
@@ -504,9 +504,9 @@
}
},
"node_modules/@github/copilot-darwin-x64": {
- "version": "1.0.51",
- "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.51.tgz",
- "integrity": "sha512-c67SbMznclcHqlJINXBCwudhqRgE5HNaY9fqMQqu954+ezVa6Q/2hwhCU51PNbYLWtZTGgXsgWnrxOg77hh0ug==",
+ "version": "1.0.52-0",
+ "resolved": "https://registry.npmjs.org/@github/copilot-darwin-x64/-/copilot-darwin-x64-1.0.52-0.tgz",
+ "integrity": "sha512-WFyeJIN5YsGRrdJPMnRBQrhU6BP0yt0PGOqOR1yvCp3n0cIVAF9sDn0fvQTCMo6cI7XAeqIrlI1xSc4nFidZDg==",
"cpu": [
"x64"
],
@@ -521,9 +521,9 @@
}
},
"node_modules/@github/copilot-linux-arm64": {
- "version": "1.0.51",
- "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.51.tgz",
- "integrity": "sha512-MlQeTB4CSPnG2BZTxsPSV5a7rjsqFOzhTCVCNjLeht3ODObWjrIYhtzVF7h/nue9ii96u9RBB0gIAfoBReryTw==",
+ "version": "1.0.52-0",
+ "resolved": "https://registry.npmjs.org/@github/copilot-linux-arm64/-/copilot-linux-arm64-1.0.52-0.tgz",
+ "integrity": "sha512-bOE+v954tpSXq75S3kN/Qz+91KrM8i7b3P+2+4OA2zSGNy3sKUfadKsLGJf6cmGefJCe+BVrYhVxhYhltSQJJA==",
"cpu": [
"arm64"
],
@@ -538,9 +538,9 @@
}
},
"node_modules/@github/copilot-linux-x64": {
- "version": "1.0.51",
- "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.51.tgz",
- "integrity": "sha512-fniGTwR5KLFfNDjSFbWvZ3Bno+2bXsMdNM0l3dFHwVTHyBqQSXZ3xvEEDadGimCxgKfRDRt1M1FYnUpqhLYf/Q==",
+ "version": "1.0.52-0",
+ "resolved": "https://registry.npmjs.org/@github/copilot-linux-x64/-/copilot-linux-x64-1.0.52-0.tgz",
+ "integrity": "sha512-5NCuxj2nIq4Qu5QzlK8SYxi2K2zge4ZFUGJEAgt6bTac7MFIHoBAX/59GSRca1BAR+fi61HS6W5SQUHVuWA7rQ==",
"cpu": [
"x64"
],
@@ -555,9 +555,9 @@
}
},
"node_modules/@github/copilot-linuxmusl-arm64": {
- "version": "1.0.51",
- "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.51.tgz",
- "integrity": "sha512-vg9sWZw4u/bqHa7ylF/GZeuznt+k4/Em899C++CTBU4CKhtAaxd2TZDsEV0Ap2DXzP2UFxCn77vZoHyxByMI5A==",
+ "version": "1.0.52-0",
+ "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-arm64/-/copilot-linuxmusl-arm64-1.0.52-0.tgz",
+ "integrity": "sha512-0l6CSFNDtGwhLBuUMEBpnQB8olPeTwTc9yfCWhq1z4LtbJ4U/tdQdEJsd/EZIOzWJbXZKqDyL6iMkkme6v3B8w==",
"cpu": [
"arm64"
],
@@ -572,9 +572,9 @@
}
},
"node_modules/@github/copilot-linuxmusl-x64": {
- "version": "1.0.51",
- "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.51.tgz",
- "integrity": "sha512-zxXRdzjshHTQd/LDWmOIDXt0T8nvw66ue6cneAXHhLXWzuiv5mqPKnxuHQyvQDt+IBEyq9utuetlKxcAVo+gYw==",
+ "version": "1.0.52-0",
+ "resolved": "https://registry.npmjs.org/@github/copilot-linuxmusl-x64/-/copilot-linuxmusl-x64-1.0.52-0.tgz",
+ "integrity": "sha512-gDAf2jrK4uKly/tdoZK4PiOx7wOvHbpFgbdXBDby/tph7/l4+hKxPsXNak+bEbBoCrLeYaSMIurbaubC8UoXUg==",
"cpu": [
"x64"
],
@@ -589,9 +589,9 @@
}
},
"node_modules/@github/copilot-win32-arm64": {
- "version": "1.0.51",
- "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.51.tgz",
- "integrity": "sha512-/SP8DfOukjllCXavgBNI0qwJa+8hCFRNK7Q3/Q3qzAOvaWUZZkabKSVZfXaGxerTGpGq009Zg3nyIPR0jfm60w==",
+ "version": "1.0.52-0",
+ "resolved": "https://registry.npmjs.org/@github/copilot-win32-arm64/-/copilot-win32-arm64-1.0.52-0.tgz",
+ "integrity": "sha512-DdmNzqGMZC2TkR6Bu4V4rRo6fb8KmKKlJ7FIRLkBiX33Khps1PVxKqk/TTuao6w4WvT/Sxk5gGh63mshRYlASA==",
"cpu": [
"arm64"
],
@@ -606,9 +606,9 @@
}
},
"node_modules/@github/copilot-win32-x64": {
- "version": "1.0.51",
- "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.51.tgz",
- "integrity": "sha512-ZB5Jr9m4ZR8gFOwXnYGNfdU+bMFeUgj1OCU3x64Tx5GC6Uln/pf8Ue5LHlsBkBq/NuKvkp/g4GARDIHBCKXEnQ==",
+ "version": "1.0.52-0",
+ "resolved": "https://registry.npmjs.org/@github/copilot-win32-x64/-/copilot-win32-x64-1.0.52-0.tgz",
+ "integrity": "sha512-uvUsnPAwZwNQEmC0yQ6o8O2odQzU6RU4JE9pHTyZGmvScZ9iRvb/ZQ8oR+Dmd+RapJbCnfLMm+39yValmtGG5g==",
"cpu": [
"x64"
],
diff --git a/test/harness/package.json b/test/harness/package.json
index 4da4c5b52..90d2eb804 100644
--- a/test/harness/package.json
+++ b/test/harness/package.json
@@ -11,7 +11,7 @@
"test": "vitest run"
},
"devDependencies": {
- "@github/copilot": "^1.0.51",
+ "@github/copilot": "^1.0.52-0",
"@modelcontextprotocol/sdk": "^1.26.0",
"@types/node": "^25.3.3",
"@types/node-forge": "^1.3.14",