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

Function merge_hook_feedback

tutorials/19_process_and_pipe_communication.py:706–722  ·  view source on GitHub ↗

对应 conversation.rs:408-425

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

Source from the content-addressed store, hash-verified

704
705 # ---- merge_hook_feedback (conversation.rs:408-425) ----
706 def merge_hook_feedback(
707 hook_messages: list[str],
708 tool_output: str,
709 denied: bool,
710 ) -> str:
711 """对应 conversation.rs:408-425"""
712 if not hook_messages:
713 return tool_output
714
715 sections = []
716 if tool_output.strip():
717 sections.append(tool_output)
718
719 label = "Hook feedback (denied)" if denied else "Hook feedback"
720 sections.append(f"<{label}>\n" + "\n".join(hook_messages) + f"\n</{label}>")
721
722 return "\n\n".join(sections)
723
724 # ---- 运行完整演示 ----
725

Callers 1

Calls 1

appendMethod · 0.80

Tested by

no test coverage detected