harness-tools + app: subagent context-file reporting to the job board (M4)

A ContextReporter wired into subagent sessions lets the read tool advertise the
files it reads (≥10 lines) on its job board entry, so a completed specialist
shows what it already looked at. Root sessions report nothing (no parent board).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-09 06:34:04 +02:00
co-authored by Claude Opus 4.8
parent ecb3267a50
commit 54f91b7e4c
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,
}
}