M4: subagent context-file reporting to the job board
Lets subagents report context files back to the job board (surfaced from the read tool) so the parent session's next-turn context includes what a background child has been looking at.
This commit is contained in:
@@ -150,6 +150,7 @@ mod tests {
|
||||
),
|
||||
metadata,
|
||||
spawner: None,
|
||||
context_reporter: None,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -233,6 +233,7 @@ mod tests {
|
||||
),
|
||||
metadata,
|
||||
spawner: None,
|
||||
context_reporter: None,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -131,6 +131,7 @@ mod tests {
|
||||
),
|
||||
metadata,
|
||||
spawner: None,
|
||||
context_reporter: None,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -160,6 +160,7 @@ mod tests {
|
||||
),
|
||||
metadata,
|
||||
spawner: None,
|
||||
context_reporter: None,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -102,6 +102,13 @@ impl Tool for ReadTool {
|
||||
"(empty file or offset past end)".to_string(),
|
||||
));
|
||||
}
|
||||
|
||||
// In a subagent session, advertise this read on the job board.
|
||||
if let Some(reporter) = &ctx.context_reporter {
|
||||
let reported = paths::relative_pattern(&ctx.cwd, &path);
|
||||
reporter.report_file(reported, numbered.len() as u32).await;
|
||||
}
|
||||
|
||||
Ok(ToolOutput::new(
|
||||
params.file_path.clone(),
|
||||
numbered.join("\n"),
|
||||
@@ -140,6 +147,7 @@ mod tests {
|
||||
),
|
||||
metadata,
|
||||
spawner: None,
|
||||
context_reporter: None,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -115,6 +115,7 @@ mod tests {
|
||||
),
|
||||
metadata,
|
||||
spawner: None,
|
||||
context_reporter: None,
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user