Skip to main content

Module talk

Module talk 

Source
Expand description

The standing conversation: a place to think out loud with an agent between tasks, reachable from a phone.

crate::chat is an interview with one purpose - arrive at a task file and file it - and it ends the moment that happens. This module is the other kind of conversation an operator wants: one that stays open. Ask a question, have the agent read a file or run a command to check something, talk through an idea, and when it is time to act, tell it to file the work rather than do it here. The conversation does not end; it is what the operator opens the next time something comes up.

§Talking is not implementing

Every turn here runs with allow_write: false - the same restriction crate::chat puts on its own interview, for the same reason. An agent that can edit files while the operator is mid-thought can leave the checkout in a state neither of them chose. When the operator wants a change made, the agent is told to run magi task add --solo (briefing) rather than reach for an editor: the change goes through magi’s own queue, on the repository’s own terms, and the operator can watch it happen instead of trusting that it did.

--solo rather than a plain magi task add is the point of pairing this module with crate::queue::Task::solo. A task that came out of a conversation the operator just had is a decision already made, not a design question worth three independent takes - so it runs through one implementer and straight into review, the way crate::graph::Runner already degrades a single-candidate run.

§Shape

The same split crate::chat and crate::queue use: Talk is data plus pure helpers, Talks owns the I/O and is constructed with its root, so every test here drives a real store in a temp directory rather than the operator’s own home.

Structs§

Talk
One standing conversation.
Talks
A conversation store on disk.
Turn
One message in the conversation.

Enums§

TalkStatus
Where a conversation is in its life. Unlike crate::chat::ChatStatus there is no filed: this conversation can file any number of tasks without ending, so it only ever moves once, from open to closed.
Who
Who said something.

Constants§

SCHEMA
On-disk format for a conversation. Bumped when a field’s meaning changes.

Functions§

begin
Open a conversation. Unlike crate::chat::start this takes no agent turn: there is no idea to answer yet, and a conversation the operator has not said anything into yet is a normal, valid thing to have sitting on the phone.
briefing
The briefing the agent opens with, sent once as part of its first turn.
close
Close a conversation. Idempotent: closing an already-closed conversation is not an error, since the operator’s intent - “I am done with this” - is already satisfied.
record
Append the operator’s turn and flush it, without invoking anything.
respond
The agent’s half of a turn: invoke, append, flush. Pairs with record, the same way crate::chat::respond pairs with crate::chat::record.
say
One operator turn and one agent turn, appended - the synchronous form, used by tests and by anything that is fine waiting out the turn itself.
tasks_of
Queue tasks this conversation has filed, oldest first.