summaryrefslogtreecommitdiffstats
path: root/src/render
diff options
context:
space:
mode:
authoraichat-agent <agent@aichat.local>2026-10-01 14:58:06 +0000
committeraichat-agent <agent@aichat.local>2026-10-01 15:54:19 +0000
commit83a2cd1ac24ca0feda34ae877aaf31f41b58b86c (patch)
treecbc83678fa05fe6a82908c448a4e20eae673a9c7 /src/render
parent82976d349ad97ac9aae0655ad631dace5e2a6385 (diff)
downloadaichat-83a2cd1ac24ca0feda34ae877aaf31f41b58b86c.tar.gz
feat: add built-in subquery tool with hierarchical query ids
* Add config options subquery and subquery_max_depth. * Register an internal subquery function that spawns a fresh LLM query with the current model configuration but without the full context. The model selects context numerically (message_indexes) or by text excerpt (excerpts). * Subqueries can use tools, including further nested subqueries up to subquery_max_depth. * Queries and subqueries get hierarchical ids ([0], [0/1], [0/1/2]) that prefix tool-call prints and spinner messages.
Diffstat (limited to 'src/render')
-rw-r--r--src/render/stream.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/render/stream.rs b/src/render/stream.rs
index d6cadde..af69176 100644
--- a/src/render/stream.rs
+++ b/src/render/stream.rs
@@ -36,7 +36,10 @@ pub async fn raw_stream(
mut rx: UnboundedReceiver<SseEvent>,
abort_signal: &AbortSignal,
) -> Result<()> {
- let mut spinner = Some(spawn_spinner("Generating"));
+ let mut spinner = Some(spawn_spinner(&match crate::utils::current_query_scope() {
+ Some(scope) => format!("{scope} Generating"),
+ None => "Generating".to_string(),
+ }));
loop {
if abort_signal.aborted() {
@@ -75,7 +78,10 @@ async fn markdown_stream_inner(
let columns = terminal::size()?.0;
- let mut spinner = Some(spawn_spinner("Generating"));
+ let mut spinner = Some(spawn_spinner(&match crate::utils::current_query_scope() {
+ Some(scope) => format!("{scope} Generating"),
+ None => "Generating".to_string(),
+ }));
'outer: loop {
if abort_signal.aborted() {