MCPcopy
hub / github.com/shareAI-lab/learn-claude-code / handle_inbox_message

Function handle_inbox_message

s19_mcp_plugin/code.py:445–459  ·  view source on GitHub ↗
(name: str, msg: dict, messages: list)

Source from the content-addressed store, hash-verified

443 f"If a task has a worktree, work in that directory.")
444
445 def handle_inbox_message(name: str, msg: dict, messages: list):
446 msg_type = msg.get("type", "message")
447 meta = msg.get("metadata", {})
448 req_id = meta.get("request_id", "")
449 if msg_type == "shutdown_request":
450 BUS.send(name, "lead", "Shutting down.",
451 "shutdown_response",
452 {"request_id": req_id, "approve": True})
453 return True
454 if msg_type == "plan_approval_response":
455 approve = meta.get("approve", False)
456 messages.append({"role": "user",
457 "content": "[Plan approved]" if approve
458 else f"[Plan rejected] {msg['content']}"})
459 return False
460
461 def run():
462 wt_ctx = {"path": None}

Callers 1

runFunction · 0.70

Calls 2

getMethod · 0.45
sendMethod · 0.45

Tested by

no test coverage detected