MCPcopy Create free account
hub / github.com/Louisym/MiniCC / merge_hook_feedback

Function merge_hook_feedback

tutorials/08_hook_system.py:292–308  ·  view source on GitHub ↗

把 Hook 的反馈信息合并到工具输出中。 对应源码: conversation.rs:408-424

(hook_messages: list[str], output: str, denied: bool)

Source from the content-addressed store, hash-verified

290# 返回工具结果
291
292def merge_hook_feedback(hook_messages: list[str], output: str, denied: bool) -> str:
293 """
294 把 Hook 的反馈信息合并到工具输出中。
295
296 对应源码: conversation.rs:408-424
297 """
298 if not hook_messages:
299 return output
300
301 sections = []
302 if output.strip():
303 sections.append(output)
304
305 label = "Hook feedback (denied)" if denied else "Hook feedback"
306 sections.append(f"{label}:\n" + "\n".join(hook_messages))
307
308 return "\n\n".join(sections)
309
310
311# ============================================================

Callers 1

mainFunction · 0.70

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected