Skip to content
pi-c Artifact [834a71e309]
Login

Artifact [834a71e309]

Artifact 834a71e309e787847c210f60b8dfa6f9eb423bbab1f5e6ef998d070b6b9074ab:


# Conversations messaging each other

One conversation can hand work or a finding to another of yours, in the same workspace or another
one, with the `send_message` tool, which every conversation has by default. `pic settings
grapevine.sendMessage false` takes it away from new conversations, and `--tools -send_message` from
one run. A conversation keeps the tools it started with.

Tell the model which conversation to write to: its id, the start of its id, or its name (`/name` in
the terminal, `pic name ID NAME`). `pic sessions` lists this workspace's conversations and `pic
sessions --all` every workspace's; for another workspace the model also names its directory. pic
must have been used there once, so it knows where that workspace keeps its conversations.

## What the other conversation sees

The message arrives as a message from that conversation, framed so its model knows it is not from
you: `[A message from another pic conversation, NAME, in WORKSPACE. It is not from the user: ...]`
and then the text. It never acts as you: it cannot answer a question or an approval meant for you.

- If a request is running there, the message runs after it, as a follow-up would.
- If nothing is running there, it waits until a request runs there (you open it, or a script
  runs `pic run --session ID`), and then runs after that request. With `pic settings grapevine.wake
  true`, pic starts a request there for it at once instead.

The tool's result says which happened. The terminal shows the message where it lands, and `pic
attach` marks it with `origin` (`session:...`).

## Limits

Two conversations that keep answering each other stop: a message counts the conversations it has
passed through, and one past `grapevine.maxHops` (8) is refused. A conversation can be started by
messages at most `grapevine.maxWakes` (3) times since you last prompted it; after that a waking
message is refused until you prompt there again.

A `UserPromptSubmit` hook sees who sent a message in its input's `origin` (`user` for you,
`session:JOURNAL/CONVERSATION` for another conversation), so a hook that exits 2 refuses messages
from a conversation it does not trust ([hooks](hooks.md)).

Messages are the inbox's, as `pic send` uses: saved before anything acts on them, delivered once
([remote control](remote-control.md)). A crash while the tool runs sends nothing twice.