mirror of
https://github.com/instructkr/claw-code.git
synced 2026-04-07 00:24: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,
|
mcp_tool_bridge::McpToolRegistry,
|
||||||
permission_enforcer::{EnforcementResult, PermissionEnforcer},
|
permission_enforcer::{EnforcementResult, PermissionEnforcer},
|
||||||
read_file,
|
read_file,
|
||||||
|
summary_compression::compress_summary_text,
|
||||||
task_registry::TaskRegistry,
|
task_registry::TaskRegistry,
|
||||||
team_cron_registry::{CronRegistry, TeamRegistry},
|
team_cron_registry::{CronRegistry, TeamRegistry},
|
||||||
worker_boot::{WorkerReadySnapshot, WorkerRegistry},
|
worker_boot::{WorkerReadySnapshot, WorkerRegistry},
|
||||||
@@ -3162,12 +3163,15 @@ fn persist_agent_terminal_state(
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
next_manifest.current_blocker = None;
|
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 {
|
next_manifest.lane_events.push(LaneEvent {
|
||||||
event: LaneEventName::Finished,
|
event: LaneEventName::Finished,
|
||||||
status: status.to_string(),
|
status: status.to_string(),
|
||||||
emitted_at: iso8601_now(),
|
emitted_at: iso8601_now(),
|
||||||
failure_class: None,
|
failure_class: None,
|
||||||
detail: None,
|
detail: compressed_detail,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
write_agent_manifest(&next_manifest)
|
write_agent_manifest(&next_manifest)
|
||||||
|
|||||||
Reference in New Issue
Block a user