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:
2026-07-10 16:20:11 +02:00
parent 8976b5dc09
commit ac516a7e23
12 changed files with 187 additions and 3 deletions
+1
View File
@@ -150,6 +150,7 @@ mod tests {
),
metadata,
spawner: None,
context_reporter: None,
}
}
+1
View File
@@ -233,6 +233,7 @@ mod tests {
),
metadata,
spawner: None,
context_reporter: None,
}
}
+1
View File
@@ -131,6 +131,7 @@ mod tests {
),
metadata,
spawner: None,
context_reporter: None,
}
}
+1
View File
@@ -160,6 +160,7 @@ mod tests {
),
metadata,
spawner: None,
context_reporter: None,
}
}
+8
View File
@@ -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,
}
}
+1
View File
@@ -115,6 +115,7 @@ mod tests {
),
metadata,
spawner: None,
context_reporter: None,
}
}