From 09510a1b37f309b0f56438d0464f802915be2f6c Mon Sep 17 00:00:00 2001 From: Stephen Belanger Date: Wed, 25 Nov 2026 22:12:17 +0800 Subject: [PATCH 1/4] Keep attached Claude background agents open through completion --- bt-daemon/src/transcript_import/claude.rs | 50 ++++++++++++++++++++++- bt-daemon/src/transcript_import/mod.rs | 48 ++++++++++++++++++++++ bt-daemon/src/translate/claude.rs | 2 +- bt-daemon/src/translate/mod.rs | 4 +- 4 files changed, 100 insertions(+), 4 deletions(-) diff --git a/bt-daemon/src/transcript_import/claude.rs b/bt-daemon/src/transcript_import/claude.rs index c85ffaf4..3b806bfd 100644 --- a/bt-daemon/src/transcript_import/claude.rs +++ b/bt-daemon/src/transcript_import/claude.rs @@ -30,6 +30,7 @@ pub(super) struct Tail { completed_turns: usize, active_turn: Option, last_len: u64, + pending_background_stops: HashSet, } impl TailSession for Tail { @@ -55,6 +56,9 @@ impl TailSession for Tail { if events.len() < 2 { bail!("Claude import did not produce session boundary events"); } + // A cold historical import already has the complete child transcript. + // During attach, async launch results are links, not completion events. + let attaching = !finalize || self.started; let mut out = Vec::new(); if !self.started { out.push(events[0].clone()); @@ -77,10 +81,42 @@ impl TailSession for Tail { let start = turn_starts[turn]; let end = turn_starts.get(turn + 1).copied().unwrap_or(middle.len()); let skip = usize::from(self.active_turn == Some(turn)); - out.extend(middle[start + skip..end].iter().cloned()); + for event in &middle[start + skip..end] { + if attaching + && event.event == "SubagentStop" + && event + .payload + .get("_bt_import_background") + .and_then(Value::as_bool) + == Some(true) + { + if let Some(id) = string_at(&event.payload, "/agent_id") { + self.pending_background_stops.insert(id); + continue; + } + } + out.push(event.clone()); + } self.completed_turns += 1; self.active_turn = None; } + let notifications = turn_starts + .iter() + .filter_map(|&index| { + crate::translate::claude_task_notification_id( + middle[index].payload.get("prompt")?.as_str()?, + ) + }) + .collect::>(); + for event in middle.iter().filter(|event| event.event == "SubagentStop") { + let Some(id) = event.payload.get("agent_id").and_then(Value::as_str) else { + continue; + }; + if (finalize || notifications.contains(id)) && self.pending_background_stops.remove(id) + { + out.push(event.clone()); + } + } if !finalize && turn_count > 0 { let active = turn_count - 1; if self.active_turn != Some(active) { @@ -290,7 +326,8 @@ pub(super) fn envelopes( "agent_type": subagent.agent_type, "agent_transcript_path": subagent.path, "_bt_import_parent_agent_id": subagent.parent_agent_id, - "_bt_import_parent_tool_id": subagent.parent_tool_id + "_bt_import_parent_tool_id": subagent.parent_tool_id, + "_bt_import_background": subagent.background }); if !is_start { payload["last_assistant_message"] = json!(subagent @@ -359,6 +396,7 @@ struct Subagent { parent_agent_id: Option, parent_tool_id: Option, depth: usize, + background: bool, } fn subagents(path: &Path, records: &[Value]) -> anyhow::Result> { @@ -527,6 +565,10 @@ fn subagents(path: &Path, records: &[Value]) -> anyhow::Result> { parent_agent_id: None, parent_tool_id: None, depth: 0, + background: records[record_index] + .pointer("/toolUseResult/status") + .and_then(Value::as_str) + == Some("async_launched"), }) }) .collect::>(); @@ -643,6 +685,10 @@ fn subagents(path: &Path, records: &[Value]) -> anyhow::Result> { parent_agent_id: parent_id, parent_tool_id, depth, + background: records[record_index] + .pointer("/toolUseResult/status") + .and_then(Value::as_str) + == Some("async_launched"), }); linked.insert(agent_id.clone()); added = true; diff --git a/bt-daemon/src/transcript_import/mod.rs b/bt-daemon/src/transcript_import/mod.rs index 117a1669..63032499 100644 --- a/bt-daemon/src/transcript_import/mod.rs +++ b/bt-daemon/src/transcript_import/mod.rs @@ -1592,6 +1592,54 @@ mod tests { assert!(!tail.retry_envelopes); } + #[test] + fn claude_attach_keeps_background_agent_open_until_its_final_records_arrive() { + let temp = tempfile::tempdir().unwrap(); + let path = temp.path().join("session-a.jsonl"); + let child = temp.path().join("session-a/subagents/agent-child-a.jsonl"); + std::fs::create_dir_all(child.parent().unwrap()).unwrap(); + let write = |path: &Path, records: &[Value]| { + std::fs::write( + path, + records + .iter() + .map(|record| format!("{record}\n")) + .collect::(), + ) + .unwrap(); + }; + write( + &path, + &[ + json!({"type":"user","sessionId":"session-a","timestamp":"2026-01-01T00:00:01Z","message":{"content":"delegate"}}), + json!({"type":"assistant","timestamp":"2026-01-01T00:00:02Z","message":{"content":[{"type":"tool_use","id":"call-a","name":"Agent","input":{"subagent_type":"reviewer"}}]}}), + json!({"type":"user","timestamp":"2026-01-01T00:00:03Z","toolUseResult":{"agentId":"child-a","status":"async_launched"},"message":{"content":[{"type":"tool_result","tool_use_id":"call-a","content":"launched"}]}}), + json!({"type":"user","timestamp":"2026-01-01T00:00:04Z","message":{"content":"next prompt"}}), + ], + ); + let started = json!({"type":"user","timestamp":"2026-01-01T00:00:02Z","message":{"content":"review"}}); + write(&child, std::slice::from_ref(&started)); + + let mut tail = TranscriptTail::new(path, ImportSource::Claude); + let initial = tail.poll(false).unwrap(); + assert!(initial.iter().any(|event| event.event == "SubagentStart")); + assert!(!initial.iter().any(|event| event.event == "SubagentStop")); + write( + &child, + &[ + started, + json!({"type":"assistant","timestamp":"2026-01-01T00:00:06Z","message":{"id":"late","content":[{"type":"text","text":"reviewed"}]}}), + ], + ); + let terminal = tail.poll(true).unwrap(); + let stop = terminal + .iter() + .find(|event| event.event == "SubagentStop") + .unwrap(); + assert_eq!(stop.payload["last_assistant_message"], "reviewed"); + assert_eq!(stop.ts_ms, 1_767_225_606_000); + } + #[test] fn claude_tail_closes_only_completed_turns() { let temp = tempfile::tempdir().unwrap(); diff --git a/bt-daemon/src/translate/claude.rs b/bt-daemon/src/translate/claude.rs index 66db8853..342e4f5d 100644 --- a/bt-daemon/src/translate/claude.rs +++ b/bt-daemon/src/translate/claude.rs @@ -1656,7 +1656,7 @@ fn continuation_origin(payload: &Value) -> Option<(&'static str, &str)> { Some(("agent_message", id)) } -fn task_notification_id(prompt: &str) -> Option<&str> { +pub(crate) fn task_notification_id(prompt: &str) -> Option<&str> { let body = prompt .trim() .strip_prefix("")? diff --git a/bt-daemon/src/translate/mod.rs b/bt-daemon/src/translate/mod.rs index 87e8d6c9..d524c99b 100644 --- a/bt-daemon/src/translate/mod.rs +++ b/bt-daemon/src/translate/mod.rs @@ -22,7 +22,9 @@ mod muse; mod opencode; mod opencode_v2; mod pi; -pub(crate) use claude::successful_subagent_handback_message; +pub(crate) use claude::{ + successful_subagent_handback_message, task_notification_id as claude_task_notification_id, +}; pub(crate) use pi::request_config as pi_request_config; mod origins; pub(crate) mod recent; From 75a92a5185dce7d68ad34d72197a3523222cd0ae Mon Sep 17 00:00:00 2001 From: Stephen Belanger Date: Wed, 25 Nov 2026 23:26:20 +0800 Subject: [PATCH 2/4] Serialize legacy journal migration during capture and recovery --- bt-daemon/src/collections/legacy.rs | 34 +++++++++++++++++++++-------- bt-daemon/src/collections/tests.rs | 27 +++++++++++++++++++++++ 2 files changed, 52 insertions(+), 9 deletions(-) diff --git a/bt-daemon/src/collections/legacy.rs b/bt-daemon/src/collections/legacy.rs index 60853be3..43564bfd 100644 --- a/bt-daemon/src/collections/legacy.rs +++ b/bt-daemon/src/collections/legacy.rs @@ -22,6 +22,10 @@ const IMPORT_RECORDS: usize = 1024; const IMPORT_BYTES: usize = 8 * 1024 * 1024; const PI_MESSAGES_DELTA: &str = "_bt_messages_delta"; +// Recovery and live capture can both discover a legacy journal. Serialize +// reading, committing and removing those files. Modern sessions bypass this. +static IMPORT_LOCK: tokio::sync::Mutex<()> = tokio::sync::Mutex::const_new(()); + /// Import any legacy journals that hold records for this source session. pub(super) async fn import_session( data_dir: &Path, @@ -30,14 +34,19 @@ pub(super) async fn import_session( events: &SessionStorage, ) -> anyhow::Result<()> { let unqualified = journal_path(data_dir, session_id); - if unqualified + let unqualified_supported = unqualified .file_name() - .is_some_and(|name| name.len() <= crate::journal::MAX_FILE_NAME_BYTES) - && tokio::fs::try_exists(&unqualified).await? + .is_some_and(|name| name.len() <= crate::journal::MAX_FILE_NAME_BYTES); + let qualified = source_journal_path(data_dir, source, session_id); + if !(unqualified_supported && tokio::fs::try_exists(&unqualified).await?) + && !tokio::fs::try_exists(&qualified).await? { + return Ok(()); + } + let _guard = IMPORT_LOCK.lock().await; + if unqualified_supported && tokio::fs::try_exists(&unqualified).await? { import_unqualified(data_dir, &unqualified).await?; } - let qualified = source_journal_path(data_dir, source, session_id); if tokio::fs::try_exists(&qualified).await? { import_file(&qualified, source, events, None).await?; tokio::fs::remove_file(&qualified).await?; @@ -57,11 +66,18 @@ pub(crate) async fn import_all(data_dir: &Path) { continue; } let result = async { - let owners = sessions(&path).await?; - if owners.is_empty() { - // Nothing was ever acknowledged from a file without events. - tokio::fs::remove_file(&path).await?; - } + let owners = { + let _guard = IMPORT_LOCK.lock().await; + if !tokio::fs::try_exists(&path).await? { + return Ok(()); + } + let owners = sessions(&path).await?; + if owners.is_empty() { + // Nothing was ever acknowledged from a file without events. + tokio::fs::remove_file(&path).await?; + } + owners + }; for (source, session_id) in owners { SessionStorage::open(data_dir, &source, &session_id).await?; } diff --git a/bt-daemon/src/collections/tests.rs b/bt-daemon/src/collections/tests.rs index e3de1129..1974cc99 100644 --- a/bt-daemon/src/collections/tests.rs +++ b/bt-daemon/src/collections/tests.rs @@ -434,3 +434,30 @@ async fn compaction_returns_deleted_space_to_the_file_system() { assert_eq!(pragma("freelist_count"), 0); assert!(size() < bloated / 4, "{} of {bloated} bytes remain", size()); } + +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn simultaneous_legacy_open_preserves_capture() { + for qualified in [true, false] { + let temp = tempfile::tempdir().unwrap(); + let path = if qualified { + source_journal_path(temp.path(), "debug", "session") + } else { + journal_path(temp.path(), "session") + }; + let record = line( + &json!({"source":"debug","session_id":"session","event":"e","ts_ms":1,"payload":{}}), + ); + write_legacy(&path, &record).await; + let outcomes = futures::future::join_all( + (0..16).map(|_| SessionStorage::open(temp.path(), "debug", "session")), + ) + .await; + for storage in outcomes { + assert_eq!( + storage.unwrap().status().await.unwrap().event_tail, + record.len() as u64 + ); + } + assert!(!path.exists()); + } +} From 515a94dc7006f0d84ca72eac4cc2e7e608883300 Mon Sep 17 00:00:00 2001 From: Stephen Belanger Date: Wed, 25 Nov 2026 23:26:20 +0800 Subject: [PATCH 3/4] Keep Pi tracing compatible with Oh My Pi 19.2 --- bt-daemon/tests/agent_integration.rs | 7 +++++++ .../pi/content/src/daemon-adapter.test.ts | 18 ++++++------------ src/plugins/pi/content/src/index.ts | 18 ++++++------------ src/plugins/pi/content/src/pi-tui.ts | 18 ++++++++++++++++++ 4 files changed, 37 insertions(+), 24 deletions(-) create mode 100644 src/plugins/pi/content/src/pi-tui.ts diff --git a/bt-daemon/tests/agent_integration.rs b/bt-daemon/tests/agent_integration.rs index df5a5787..b26d3309 100644 --- a/bt-daemon/tests/agent_integration.rs +++ b/bt-daemon/tests/agent_integration.rs @@ -368,6 +368,13 @@ async fn pi_session_emits_traces() { if request.has_function_output("call_pi_1") { return MockReply::response(OpenAiTurn::text("PI_MOCK_OK")); } + // Oh My Pi sends auxiliary requests without tools to the same + // provider before the actual prompt. Only drive the shell turn when + // tools are offered. The assertions below still require the tool + // call, its result, and their delivered trace. + if request.tool_names().is_empty() { + return MockReply::response(OpenAiTurn::text("Integration test")); + } MockReply::response(shell_tool_call( &request, "call_pi_1", diff --git a/src/plugins/pi/content/src/daemon-adapter.test.ts b/src/plugins/pi/content/src/daemon-adapter.test.ts index fc081359..6a189f93 100644 --- a/src/plugins/pi/content/src/daemon-adapter.test.ts +++ b/src/plugins/pi/content/src/daemon-adapter.test.ts @@ -17,18 +17,12 @@ const mockState = vi.hoisted(() => ({ permalink: "https://www.braintrust.dev/trace/1" as string | undefined, })); -vi.mock("@earendil-works/pi-tui", async (importOriginal) => { - const original = await importOriginal(); - return { - ...original, - get getCapabilities() { - return mockState.ompTui ? undefined : () => ({ hyperlinks: mockState.hyperlinks }); - }, - get hyperlink() { - return mockState.ompTui ? undefined : original.hyperlink; - }, - }; -}); +vi.mock("./pi-tui.ts", () => ({ + loadPiHyperlinkHelpers: async () => + mockState.ompTui + ? {} + : { getCapabilities: () => ({ hyperlinks: mockState.hyperlinks }), hyperlink }, +})); vi.mock("./runtime/daemon-client.ts", () => ({ claimManagedTracingInstance: () => mockState.claim, diff --git a/src/plugins/pi/content/src/index.ts b/src/plugins/pi/content/src/index.ts index 96525040..21d82e68 100644 --- a/src/plugins/pi/content/src/index.ts +++ b/src/plugins/pi/content/src/index.ts @@ -1,10 +1,10 @@ import { createHash, randomUUID } from "node:crypto"; import { resolve } from "node:path"; import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent"; -import * as piTui from "@earendil-works/pi-tui"; import { loadConfig } from "./config.ts"; import { legacyContinuationFor, type LegacyContinuation } from "./legacy-session.ts"; import { runningPiPackage } from "./pi-package.ts"; +import { loadPiHyperlinkHelpers } from "./pi-tui.ts"; import { claimManagedTracingInstance, DaemonClient } from "./runtime/daemon-client.ts"; import { EXTENSION_VERSION } from "./version.ts"; @@ -18,13 +18,8 @@ const TRACE_LINK_POLL_TIMEOUT_MS = 40_000; const PI_VERSION = runningPiPackage().version; const PI_HOST_NAME = runningPiPackage().name; -/** - * Oh My Pi resolves this package to its own pi-tui, which exports neither - * helper. A named import would fail to link and OMP would silently drop the - * extension, so read them from the namespace and fall back to plain text. - */ -function terminalHyperlink(text: string, url: string): string | undefined { - const { getCapabilities, hyperlink } = piTui as Partial; +async function terminalHyperlink(text: string, url: string): Promise { + const { getCapabilities, hyperlink } = await loadPiHyperlinkHelpers(PI_HOST_NAME); if (typeof getCapabilities !== "function" || typeof hyperlink !== "function") return undefined; return getCapabilities().hyperlinks ? hyperlink(text, url) : undefined; } @@ -149,10 +144,9 @@ export default function braintrustPiExtension(pi: ExtensionAPI): void { if (daemonSession?.last_error) { ctx.ui.setStatus(STATUS_KEY, `Braintrust: ${daemonSession.last_error}`); } else { - ctx.ui.setStatus( - STATUS_KEY, - (permalink && terminalHyperlink(traceLabel, permalink)) || "Braintrust: connected", - ); + const label = permalink ? await terminalHyperlink(traceLabel, permalink) : undefined; + if (uiGeneration !== refreshGeneration || sessionId !== refreshSessionId) return; + ctx.ui.setStatus(STATUS_KEY, label ?? "Braintrust: connected"); } traceLinkShown = Boolean(permalink); }; diff --git a/src/plugins/pi/content/src/pi-tui.ts b/src/plugins/pi/content/src/pi-tui.ts new file mode 100644 index 00000000..6f9ecb53 --- /dev/null +++ b/src/plugins/pi/content/src/pi-tui.ts @@ -0,0 +1,18 @@ +type PiTui = typeof import("@earendil-works/pi-tui"); +type HyperlinkHelpers = Pick; + +/** Pi's UI helpers are optional for a tracing extension and unavailable in Oh My Pi. */ +export async function loadPiHyperlinkHelpers( + host: string | undefined, +): Promise> { + if (host === "@oh-my-pi/pi-coding-agent") return {}; + try { + // Resolve only in the Pi UI path. Oh My Pi rejects package imports of + // the old TUI at extension load time, including literal dynamic imports. + const url = import.meta.resolve("@earendil-works/pi-tui"); + return (await import(url)) as PiTui; + } catch { + // Some hosts supply the extension API without Pi's optional UI helpers. + return {}; + } +} From fd3b831527b93b263a741f4f9b80be0f90917a9c Mon Sep 17 00:00:00 2001 From: Stephen Belanger Date: Thu, 26 Nov 2026 00:28:13 +0800 Subject: [PATCH 4/4] Use typed Claude lifecycle payloads for background attach --- bt-daemon/src/transcript_import/claude.rs | 27 +++++++++---------- bt-daemon/src/translate/claude.rs | 6 +++-- .../src/translate/claude/subagent_hook.rs | 6 +++-- .../src/translate/claude/user_prompt_hook.rs | 24 +++++++++++++++++ bt-daemon/src/translate/mod.rs | 1 + 5 files changed, 45 insertions(+), 19 deletions(-) create mode 100644 bt-daemon/src/translate/claude/user_prompt_hook.rs diff --git a/bt-daemon/src/transcript_import/claude.rs b/bt-daemon/src/transcript_import/claude.rs index 3b806bfd..3e18b4f3 100644 --- a/bt-daemon/src/transcript_import/claude.rs +++ b/bt-daemon/src/transcript_import/claude.rs @@ -3,8 +3,10 @@ use super::{ string_at, timestamp_bounds, timestamp_ms, validate_session_id, IncrementalRecords, TailSession, TranscriptImport, TranscriptLayout, }; +use crate::translate::{claude_task_notification_id, ClaudeSubagentHook, ClaudeUserPromptHook}; use crate::wire::Envelope; use anyhow::bail; +use serde::Deserialize; use serde_json::{json, Value}; use std::collections::{HashMap, HashSet}; use std::io::BufRead; @@ -82,17 +84,12 @@ impl TailSession for Tail { let end = turn_starts.get(turn + 1).copied().unwrap_or(middle.len()); let skip = usize::from(self.active_turn == Some(turn)); for event in &middle[start + skip..end] { - if attaching - && event.event == "SubagentStop" - && event - .payload - .get("_bt_import_background") - .and_then(Value::as_bool) - == Some(true) - { - if let Some(id) = string_at(&event.payload, "/agent_id") { - self.pending_background_stops.insert(id); - continue; + if attaching && event.event == "SubagentStop" { + if let Ok(hook) = ClaudeSubagentHook::deserialize(&event.payload) { + if hook.import_background { + self.pending_background_stops.insert(hook.agent_id); + continue; + } } } out.push(event.clone()); @@ -103,15 +100,15 @@ impl TailSession for Tail { let notifications = turn_starts .iter() .filter_map(|&index| { - crate::translate::claude_task_notification_id( - middle[index].payload.get("prompt")?.as_str()?, - ) + let hook = ClaudeUserPromptHook::deserialize(&middle[index].payload).ok()?; + claude_task_notification_id(hook.text()?) }) .collect::>(); for event in middle.iter().filter(|event| event.event == "SubagentStop") { - let Some(id) = event.payload.get("agent_id").and_then(Value::as_str) else { + let Ok(hook) = ClaudeSubagentHook::deserialize(&event.payload) else { continue; }; + let id = hook.agent_id.as_str(); if (finalize || notifications.contains(id)) && self.pending_background_stops.remove(id) { out.push(event.clone()); diff --git a/bt-daemon/src/translate/claude.rs b/bt-daemon/src/translate/claude.rs index 342e4f5d..2c5088a2 100644 --- a/bt-daemon/src/translate/claude.rs +++ b/bt-daemon/src/translate/claude.rs @@ -17,17 +17,19 @@ mod timestamp_envelope; mod transcript_envelope; mod transcript_tool; mod transcript_tool_outcome; +mod user_prompt_hook; use hook_context::HookContext; use llm_call::LlmCall; use message_history::MessageHistory; use parsed_transcript::ParsedTranscript; -use subagent_hook::SubagentHook; +pub(crate) use subagent_hook::SubagentHook; #[cfg(test)] use timestamp_envelope::parse_rfc3339_timestamp; use timestamp_envelope::parse_timestamp_ms; use transcript_envelope::TranscriptEnvelope; use transcript_tool::TranscriptTool; +pub(crate) use user_prompt_hook::UserPromptHook; use super::git::GitMetadataCache; use super::recent::{RecentMap, RecentSet, RECENT_ID_CAPACITY}; @@ -1644,7 +1646,7 @@ fn continuation_origin(payload: &Value) -> Option<(&'static str, &str)> { return (!id.is_empty()).then_some(("agent_message", id)); } } - let prompt = payload.get("prompt")?.as_str()?.trim(); + let prompt = UserPromptHook::deserialize(payload).ok()?.text()?.trim(); if let Some(id) = task_notification_id(prompt) { return Some(("task_notification", id)); } diff --git a/bt-daemon/src/translate/claude/subagent_hook.rs b/bt-daemon/src/translate/claude/subagent_hook.rs index de74a472..c8cd3a23 100644 --- a/bt-daemon/src/translate/claude/subagent_hook.rs +++ b/bt-daemon/src/translate/claude/subagent_hook.rs @@ -2,11 +2,13 @@ use super::native_field::{deserialize_nonempty_string, deserialize_optional_stri use serde::{Deserialize, Serialize}; #[derive(Deserialize, Serialize)] -pub(super) struct SubagentHook { +pub(crate) struct SubagentHook { #[serde(deserialize_with = "deserialize_nonempty_string")] - pub(super) agent_id: String, + pub(crate) agent_id: String, #[serde(default, deserialize_with = "deserialize_optional_string")] pub(super) agent_type: Option, #[serde(default, deserialize_with = "deserialize_optional_string")] pub(super) agent_transcript_path: Option, + #[serde(rename = "_bt_import_background", default)] + pub(crate) import_background: bool, } diff --git a/bt-daemon/src/translate/claude/user_prompt_hook.rs b/bt-daemon/src/translate/claude/user_prompt_hook.rs new file mode 100644 index 00000000..a5f10a74 --- /dev/null +++ b/bt-daemon/src/translate/claude/user_prompt_hook.rs @@ -0,0 +1,24 @@ +use serde::Deserialize; + +/// Text projection of a prompt hook. Imported prompts may also contain blocks. +#[derive(Deserialize)] +pub(crate) struct UserPromptHook<'a> { + #[serde(default, borrow)] + prompt: Option>, +} + +#[derive(Deserialize)] +#[serde(untagged)] +enum PromptText<'a> { + Text(&'a str), + Other(serde::de::IgnoredAny), +} + +impl<'a> UserPromptHook<'a> { + pub(crate) fn text(&self) -> Option<&'a str> { + match self.prompt.as_ref()? { + PromptText::Text(text) => Some(text), + PromptText::Other(_) => None, + } + } +} diff --git a/bt-daemon/src/translate/mod.rs b/bt-daemon/src/translate/mod.rs index d524c99b..0bbffd05 100644 --- a/bt-daemon/src/translate/mod.rs +++ b/bt-daemon/src/translate/mod.rs @@ -24,6 +24,7 @@ mod opencode_v2; mod pi; pub(crate) use claude::{ successful_subagent_handback_message, task_notification_id as claude_task_notification_id, + SubagentHook as ClaudeSubagentHook, UserPromptHook as ClaudeUserPromptHook, }; pub(crate) use pi::request_config as pi_request_config; mod origins;