{"record":{"id":"de27cf4a0beba12e","repo":"zed-industries/zed","slug":"not-supported","errorCode":null,"errorMessage":"not supported","messagePattern":"not supported","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/acp_thread/src/acp_thread.rs","lineNumber":4024,"sourceCode":"                git_store\n                    .update(cx, |git, cx| git.restore_checkpoint(checkpoint, cx))\n                    .await?;\n            }\n\n            Ok(())\n        })\n    }\n\n    /// Rewinds this thread to before the entry at `index`, removing it and all\n    /// subsequent entries while rejecting any action_log changes made from that point.\n    /// Unlike `restore_checkpoint`, this method does not restore from git.\n    pub fn rewind(\n        &mut self,\n        client_id: ClientUserMessageId,\n        cx: &mut Context<Self>,\n    ) -> Task<Result<()>> {\n        let Some(truncate) = self.connection.truncate(&self.session_id, cx) else {\n            return Task::ready(Err(anyhow!(\"not supported\")));\n        };\n\n        Self::flush_streaming_text(&mut self.streaming_text_buffer, cx);\n        let telemetry = ActionLogTelemetry::from(&*self);\n        cx.spawn(async move |this, cx| {\n            cx.update(|cx| truncate.run(client_id.clone(), cx)).await?;\n            this.update(cx, |this, cx| {\n                if let Some((ix, _)) = this.user_message_mut(&client_id) {\n                    // Collect all terminals from entries that will be removed\n                    let terminals_to_remove: Vec<acp::TerminalId> = this.entries[ix..]\n                        .iter()\n                        .flat_map(|entry| entry.terminals())\n                        .filter_map(|terminal| terminal.read(cx).id().clone().into())\n                        .collect();\n\n                    let range = ix..this.entries.len();\n                    this.entries.truncate(ix);\n                    cx.emit(AcpThreadEvent::EntriesRemoved(range));","sourceCodeStart":4006,"sourceCodeEnd":4042,"githubUrl":"https://github.com/zed-industries/zed/blob/bc538def4545534201bbfcac4e95ac34ea6501b6/crates/acp_thread/src/acp_thread.rs#L4006-L4042","documentation":"rewind() depends on connection.truncate(&self.session_id, cx) returning Some(truncate). When the connected agent does not implement session truncation, it returns None and rewind fails immediately with 'not supported'. This is a backend capability gap, not a data problem — restore_checkpoint is the git-backed alternative.","triggerScenarios":"Calling rewind on a session whose ACP connection does not advertise/implement truncate: a third-party agent that never implemented session/truncate, or an agent speaking an older protocol version.","commonSituations":"Using Zed's agent panel against an external ACP agent lacking truncate support; version mismatch after updating one side; UI offers rewind because a checkpoint exists even though the connection cannot truncate.","solutions":["Use restore_checkpoint instead — it rewinds entries and restores the git working tree","Feature-check truncate support before showing the rewind affordance in the client","Update the agent implementation to support session truncate"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"// Feature-check truncate support before offering rewind\nlet supports_truncate = agent\n    .connection()\n    .truncate(&session_id, cx)\n    .is_some();\nrewind_button.set_visible(supports_truncate);","typeGuard":"fn connection_supports_rewind(agent: &Agent, session_id: &acp::SessionId, cx: &App) -> bool {\n    agent.connection().truncate(session_id, cx).is_some()\n}","tryCatchPattern":"let task = thread.update(cx, |thread, cx| thread.rewind(client_id.clone(), cx));\nmatch task.await {\n    Err(error) if error.to_string().contains(\"not supported\") => {\n        // Fall back to the git-backed path, which also rewinds entries.\n        return thread.update(cx, |thread, cx| {\n            thread.restore_checkpoint(client_id.clone(), cx)\n        }).await;\n    }\n    other => other?,\n}","preventionTips":["Advertise rewind in the UI only when the connection implements truncate","Keep restore_checkpoint as the user-visible fallback for agents without truncate","Version-check external ACP agents for truncate support during onboarding"],"tags":["rust","zed","agent","acp","rewind","capability"],"backgroundTag":null,"analyzedSha":"bc538def4545534201bbfcac4e95ac34ea6501b6","analyzedAt":"2026-08-16T07:30:46.435Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}