Package the peer CLI output for injection into Codey's context.
(self, cli_name: str, output: str, original_task: str)
| 268 | return bool(output and output.startswith("[PEER_ERROR:")) |
| 269 | |
| 270 | def summarize_result(self, cli_name: str, output: str, original_task: str) -> str: |
| 271 | """Package the peer CLI output for injection into Codey's context.""" |
| 272 | if not output or len(output.strip()) < 10: |
| 273 | return f"[Peer: {cli_name} produced no readable output]" |
| 274 | if self.is_peer_error(output): |
| 275 | return output # pass the error sentinel through as-is |
| 276 | preview = output[:2000].strip() |
| 277 | return ( |
| 278 | f"[Peer CLI — {cli_name}]\n" |
| 279 | f"Task: {original_task[:120]}\n" |
| 280 | f"Output:\n{preview}" |
| 281 | + ("\n… [truncated]" if len(output) > 2000 else "") |
| 282 | ) |
| 283 | |
| 284 | |
| 285 | # ── Singleton + entry point ──────────────────────────────────────────────────── |
no test coverage detected