Remove dbg!

Co-authored-by: Antonio Scandurra <me@as-cii.com>
This commit is contained in:
Conrad Irwin 2025-08-18 11:25:22 -06:00
parent fc076e84ca
commit cc196427f0
5 changed files with 1 additions and 16 deletions

View file

@ -263,20 +263,15 @@ impl NativeAgent {
} }
fn save_thread(&mut self, thread: Entity<Thread>, cx: &mut Context<Self>) { fn save_thread(&mut self, thread: Entity<Thread>, cx: &mut Context<Self>) {
dbg!();
let id = thread.read(cx).id().clone(); let id = thread.read(cx).id().clone();
dbg!();
let Some(session) = self.sessions.get_mut(&id) else { let Some(session) = self.sessions.get_mut(&id) else {
return; return;
}; };
dbg!();
let thread = thread.downgrade(); let thread = thread.downgrade();
let thread_database = self.thread_database.clone(); let thread_database = self.thread_database.clone();
dbg!();
session.save_task = cx.spawn(async move |this, cx| { session.save_task = cx.spawn(async move |this, cx| {
cx.background_executor().timer(SAVE_THREAD_DEBOUNCE).await; cx.background_executor().timer(SAVE_THREAD_DEBOUNCE).await;
dbg!();
let db_thread = thread.update(cx, |thread, cx| thread.to_db(cx))?.await; let db_thread = thread.update(cx, |thread, cx| thread.to_db(cx))?.await;
thread_database.save_thread(id, db_thread).await?; thread_database.save_thread(id, db_thread).await?;
this.update(cx, |this, cx| this.reload_history(cx))?; this.update(cx, |this, cx| this.reload_history(cx))?;
@ -285,13 +280,11 @@ impl NativeAgent {
} }
fn reload_history(&mut self, cx: &mut Context<Self>) { fn reload_history(&mut self, cx: &mut Context<Self>) {
dbg!("");
let thread_database = self.thread_database.clone(); let thread_database = self.thread_database.clone();
self.load_history = cx.spawn(async move |this, cx| { self.load_history = cx.spawn(async move |this, cx| {
let results = cx let results = cx
.background_spawn(async move { .background_spawn(async move {
let results = thread_database.list_threads().await?; let results = thread_database.list_threads().await?;
dbg!(&results);
anyhow::Ok( anyhow::Ok(
results results
.into_iter() .into_iter()
@ -1289,7 +1282,7 @@ mod tests {
cx.run_until_parked(); cx.run_until_parked();
model.send_last_completion_stream_text_chunk("Hey"); model.send_last_completion_stream_text_chunk("Hey");
model.end_last_completion_stream(); model.end_last_completion_stream();
dbg!(send.await.unwrap()); send.await.unwrap();
cx.executor().advance_clock(SAVE_THREAD_DEBOUNCE); cx.executor().advance_clock(SAVE_THREAD_DEBOUNCE);
let history = history_store.update(cx, |store, cx| store.entries(cx)); let history = history_store.update(cx, |store, cx| store.entries(cx));

View file

@ -1283,7 +1283,6 @@ impl Thread {
} }
self.messages.push(Message::Agent(message)); self.messages.push(Message::Agent(message));
dbg!("!!!!!!!!!!!!!!!!!!!!!!!");
cx.notify() cx.notify()
} }

View file

@ -440,7 +440,6 @@ impl AgentTool for EditFileTool {
event_stream: ToolCallEventStream, event_stream: ToolCallEventStream,
cx: &mut App, cx: &mut App,
) -> Result<()> { ) -> Result<()> {
dbg!(&output);
event_stream.update_diff(cx.new(|cx| { event_stream.update_diff(cx.new(|cx| {
Diff::finalized( Diff::finalized(
output.input_path, output.input_path,

View file

@ -98,7 +98,6 @@ impl AcpThreadHistory {
}) })
.detach(); .detach();
dbg!("hello!");
let search_editor = cx.new(|cx| { let search_editor = cx.new(|cx| {
let mut editor = Editor::single_line(window, cx); let mut editor = Editor::single_line(window, cx);
editor.set_placeholder_text("Search threads...", cx); editor.set_placeholder_text("Search threads...", cx);

View file

@ -102,8 +102,6 @@ pub struct FakeLanguageModel {
impl Default for FakeLanguageModel { impl Default for FakeLanguageModel {
fn default() -> Self { fn default() -> Self {
dbg!("default......");
eprintln!("{}", std::backtrace::Backtrace::force_capture());
Self { Self {
provider_id: LanguageModelProviderId::from("fake".to_string()), provider_id: LanguageModelProviderId::from("fake".to_string()),
provider_name: LanguageModelProviderName::from("Fake".to_string()), provider_name: LanguageModelProviderName::from("Fake".to_string()),
@ -151,14 +149,12 @@ impl FakeLanguageModel {
} }
pub fn end_completion_stream(&self, request: &LanguageModelRequest) { pub fn end_completion_stream(&self, request: &LanguageModelRequest) {
dbg!("remove...");
self.current_completion_txs self.current_completion_txs
.lock() .lock()
.retain(|(req, _)| req != request); .retain(|(req, _)| req != request);
} }
pub fn send_last_completion_stream_text_chunk(&self, chunk: impl Into<String>) { pub fn send_last_completion_stream_text_chunk(&self, chunk: impl Into<String>) {
dbg!("read...");
self.send_completion_stream_text_chunk(self.pending_completions().last().unwrap(), chunk); self.send_completion_stream_text_chunk(self.pending_completions().last().unwrap(), chunk);
} }
@ -227,7 +223,6 @@ impl LanguageModel for FakeLanguageModel {
>, >,
> { > {
let (tx, rx) = mpsc::unbounded(); let (tx, rx) = mpsc::unbounded();
dbg!("insert...");
self.current_completion_txs.lock().push((request, tx)); self.current_completion_txs.lock().push((request, tx));
async move { Ok(rx.map(Ok).boxed()) }.boxed() async move { Ok(rx.map(Ok).boxed()) }.boxed()
} }