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

Method read_inbox

s15_agent_teams/code.py:618–625  ·  view source on GitHub ↗
(self, agent: str)

Source from the content-addressed store, hash-verified

616 f"{content[:50]}\033[0m")
617
618 def read_inbox(self, agent: str) -> list[dict]:
619 inbox = MAILBOX_DIR / f"{agent}.jsonl"
620 if not inbox.exists():
621 return []
622 msgs = [json.loads(line) for line in inbox.read_text().splitlines()
623 if line.strip()]
624 inbox.unlink() # consume: read + delete
625 return msgs
626
627 def peek(self, agent: str) -> bool:
628 """Non-destructive: True if the agent has unread inbox messages.

Callers 3

runFunction · 0.45
run_check_inboxFunction · 0.45
code.pyFile · 0.45

Calls 1

existsMethod · 0.80

Tested by

no test coverage detected