Synced from monorepo

Synced from monorepo

Changes:
- Release a shell session's resources in one drop
- Make the tools blocking-wait cap client-configurable and self-describing
- Recognize API "exceeds budget" errors as context overflow
- Retry /btw on model overload
- Carry running background tasks and subagents across compaction
- Require round-trip time for SDK liveness checks
- Background-subagent completion reminders with a selectable delivery surface
- Make a PTY shell reap itself until it reaches the registry
- Recover the OS error code from a TLS-phase connection reset
- Consume the attached-client signal and report why idle is withheld
- Treat `.grok/sandbox.toml` edits as protected so auto mode prompts before writing
- Surface history/search in the Ctrl+. cheatsheet and keep it working in history view
- Delete sessions from the dashboard and welcome list
- Release a session's activity record when the session ends
- Stop charging auth-retry budget for fail-closed 401s; reset it across suspends
- Scope skills watches on project vendor roots
- Make [stop] cancel in-flight compaction
- Make the leader soak measure the leader, not its harness

Source-Revision: 8d69c91f02bcacf01e98d5aebbf2f92547c45738
This commit is contained in:
grokkybara[bot] 2026-07-31 18:08:03 +00:00
commit a422116582
165 changed files with 15161 additions and 1969 deletions

View file

@ -7,6 +7,7 @@
//! - `x.ai/session/rename` rename a session locally + remote
//! - `x.ai/session/delete` delete a session locally + remote
//! - `x.ai/session/update_mcp_servers` mid-session MCP server swap
//! - `x.ai/session/add_local_workspace` mid-session local workspace add-only (chat)
//! - `x.ai/session/fork` fork a session into a new one
//! - `x.ai/internal/reload_all_mcp_servers` config hot-reload, all sessions
//! - `x.ai/internal/reload_project_mcp_servers` config hot-reload, cwd-scoped
@ -39,6 +40,8 @@ pub async fn handle(agent: &MvpAgent, args: &acp::ExtRequest) -> ExtResult {
"x.ai/session/rename" => handle_session_rename(agent, args).await,
"x.ai/session/delete" => handle_session_delete(agent, args).await,
"x.ai/session/update_mcp_servers" => handle_update_mcp_servers(agent, args).await,
#[cfg(feature = "local-workspace")]
"x.ai/session/add_local_workspace" => handle_add_local_workspace(agent, args).await,
"x.ai/session/fork" => handle_session_fork(agent, args).await,
"x.ai/internal/reload_all_mcp_servers" => handle_reload_all_mcp_servers(agent).await,
"x.ai/internal/reload_project_mcp_servers" => {
@ -371,6 +374,43 @@ async fn handle_update_mcp_servers(agent: &MvpAgent, args: &acp::ExtRequest) ->
.map_err(|e| acp::Error::internal_error().data(e.to_string()))
}
// session/add_local_workspace (add-only; local-workspace feature)
#[cfg(feature = "local-workspace")]
async fn handle_add_local_workspace(agent: &MvpAgent, args: &acp::ExtRequest) -> ExtResult {
#[derive(Deserialize)]
#[serde(rename_all = "camelCase")]
struct Params {
session_id: acp::SessionId,
#[serde(default)]
meta: Option<acp::Meta>,
}
let params: Params = parse_params(args)?;
let cwd = {
let sessions = agent.sessions.borrow();
let h = sessions
.get(&params.session_id)
.ok_or_else(|| acp::Error::invalid_params().data("unknown session id"))?;
std::path::PathBuf::from(&h.info.cwd)
};
// Gate on actual chat kind — not `requires_gateway` (true for non-chat
// GatewayAttach; false for unknown ids).
if !agent.is_chat_kind_session(&params.session_id) {
return Err(acp::Error::invalid_params().data(serde_json::json!({
"code": "local_workspace_chat_only",
"message": "x.ai/session/add_local_workspace is only available on chat-kind sessions",
})));
}
let result = agent
.add_local_workspace_mid_session(&params.session_id, params.meta, &cwd)
.await?;
ExtMethodResult::success(result)
.to_ext_response()
.map_err(|e| acp::Error::internal_error().data(e.to_string()))
}
// internal/reload_skills
/// Reload skills for ALL active sessions. Called by the skills file watcher