对应 conversation.rs:408-425
(
hook_messages: list[str],
tool_output: str,
denied: bool,
)
| 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 |
no test coverage detected