MCPcopy Create free account
hub / github.com/Ishabdullah/Codey-v2 / summarize_result

Method summarize_result

core/peer_cli.py:270–282  ·  view source on GitHub ↗

Package the peer CLI output for injection into Codey's context.

(self, cli_name: str, output: str, original_task: str)

Source from the content-addressed store, hash-verified

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 ────────────────────────────────────────────────────

Callers 3

handle_commandFunction · 0.80
escalateFunction · 0.80
run_agentFunction · 0.80

Calls 1

is_peer_errorMethod · 0.95

Tested by

no test coverage detected