Something went wrong. Try again.
small gleam coding and persistent agent daemon with a detachable cli and a canvas ui forked from okami.mom/albedo
Something went wrong. Try again.
# agents
a subagent is a session with a parent. a message is mail. both are daemon primitives; the `mail` and `agents` extensions (on by default) give the model its python surface.
## python
```python
m = await agents.models() # required once before spawning
kid = await agents.self.spawn("map every wake path", name="scout", model=m[0],
deliverable="notes/wakes.md") # returns at once
await mail.submit(kid, "also cover schedules") # or "parent", a name, a session id
kids = await agents.self.children() # snapshots: running, closed
await kid.cancel() # stop its turn, keep everything
await kid.close() # done: keep messages + files, free the kernel
other = await agents.get("a1b2c3") # "parent", a family name, or any session id
page = await other.messages(seq=0) # page of its rows: content, next_offset
hits = await kid.search_messages("error") # rows by seq, with previews
await agents.progress("on turn.gleam now") # shows in /agents, starts no turn
```
- spawn never returns the child's answer: the answer arrives later as `<mail>` and starts the parent's next turn. a child whose turn ends without answering forwards its last message, marked `unreviewed`.
- names resolve inside the family (children, siblings, parent); anything else takes a session id.
- any session may look up and read any other: `get`, `messages`, and `search_messages` resolve names and ids the way mail does, and closed agents stay readable. cancel and close work on your own children only. the model cannot delete an agent; it asks the user.
- limits: 3 deep, 12 open children per parent, 1 MiB per letter, 1000 undelivered letters per session.
## mail delivery
a letter is stored first and marked delivered in the same transaction that writes it into the recipient's transcript. an idle recipient starts a turn; a running one reads it at its next step. undelivered letters retry every 15 seconds, so…