mirror of
https://github.com/instructkr/claw-code.git
synced 2026-04-05 23:54:50 +08:00
feat(tools): wire SummaryCompressor into lane.finished event detail
The SummaryCompressor (runtime::summary_compression) was exported but called nowhere. Lane events emitted a Finished variant with detail: None even when the agent produced a result string. Wire compress_summary_text() into the Finished event detail field so that: - result prose is compressed to ≤1200 chars / 24 lines before storage - duplicate lines and whitespace noise are removed - the event detail is machine-readable, not raw prose blob - None is still emitted when result is empty/None (no regression) This is the P1.4 wiring item from ROADMAP: 'Wire SummaryCompressor into the lane event pipeline — exported but called nowhere; LaneEvent stream never fed through compressor.' cargo test --workspace: 643 pass (1 pre-existing flaky), fmt clean.
This commit is contained in:
@@ -16,6 +16,7 @@ use runtime::{
|
||||
mcp_tool_bridge::McpToolRegistry,
|
||||
permission_enforcer::{EnforcementResult, PermissionEnforcer},
|
||||
read_file,
|
||||
summary_compression::compress_summary_text,
|
||||
task_registry::TaskRegistry,
|
||||
team_cron_registry::{CronRegistry, TeamRegistry},
|
||||
worker_boot::{WorkerReadySnapshot, WorkerRegistry},
|
||||
@@ -3162,12 +3163,15 @@ fn persist_agent_terminal_state(
|
||||
});
|
||||
} else {
|
||||
next_manifest.current_blocker = None;
|
||||
let compressed_detail = result
|
||||
.filter(|value| !value.trim().is_empty())
|
||||
.map(|value| compress_summary_text(value.trim()));
|
||||
next_manifest.lane_events.push(LaneEvent {
|
||||
event: LaneEventName::Finished,
|
||||
status: status.to_string(),
|
||||
emitted_at: iso8601_now(),
|
||||
failure_class: None,
|
||||
detail: None,
|
||||
detail: compressed_detail,
|
||||
});
|
||||
}
|
||||
write_agent_manifest(&next_manifest)
|
||||
|
||||
Reference in New Issue
Block a user