Expand description
Handing an open question to the chat conversation its task came from.
A task filed by the standing chat (Source::Agent with
crate::queue::CHAT_NODE, whose run is the conversation’s id) can raise
a question the owner would rather talk through where the task started. The
owner passes it on; the chat agent carries out the owner’s decision with
magi answer, or puts the decision points to the owner in the conversation.
Three rules, each with a reason:
- One place decides.
origin_talkis the only judge of “does this question have a chat to ask”; the web view and both entry points use it.associated_talkresolves typed ownership links for navigation, independently of consultation eligibility. - Not a choice. The hand-over never goes into
Question::choicesand never touchesQuestion::answer: the question staysOpen, its validation and the choice actions stay as they were. - No new seat, no new waiter. The text is queued as a draft of the existing talk, so the chat’s own turn machinery (its session, its turn gate) runs it exactly as if the owner had typed it.
Structs§
- Consult
Outcome - A non-answer never wakes a waiter or executes a choice action.
Enums§
- Started
- What
start_turndid.
Functions§
- active_
consult - Consultation activity is separate from the question’s waiting state.
- associated_
talk - The existing conversation associated with a question, regardless of whether the question is still eligible for consultation.
- begin
- Record the hand-over and queue the question as the chat’s next message.
- chat_
talk_ of - The talk
startdescends from: the id recorded on a task (Task::chat_talk) wins, so deleted ancestors do not matter; tasks written before it existed are resolved by walking the ancestry. - drain_
turns - Run the talk’s turns under
leaseuntil no draft is owed. - origin_
talk - The conversation
qmay be handed to, if any. - pending_
consults - Is any question handed to talk
talk_idstill open? - publication_
guard - Serialize queue/record -> worker acknowledgement against a drainer’s generation scan + promotion. Never hold this fence across an agent call.
- record_
other - Store the owner’s alternative as a note and end only the consultation: the question stays open and its waiter stays held.
- reply_
other magi answer --reply-otheron questionid(a full id):record_otherunder the store’s lock, then what to print. Shared by the terminal’s direct path and a chat turn’s control bridge.- run_
service_ worker - One leased service tick. Existing question leases, seat records, and release receipts remain the only authorities for delivery and once-only effects.
- run_
turn_ worker - Hidden worker entry point. The original talk/session and cross-process lease stay authoritative even when an older worker is still responding.
- spawn_
recorded_ turn - Continue an operator turn already persisted by the HTTP admission path. Reserve this job before releasing the caller’s turn lease.
- spawn_
turn - Reserve and launch a detached drainer for an explicitly submitted draft.
- start_
services - Finite service work outlives the scheduler, but never pins a service host to an obsolete executable. Its next tick is started by the new scheduler.
- start_
turn begin, then run the chat’s turn here, under the talk’s own lease.- try_
publication_ guard - Try the short cross-process draft-publication fence for one talk.
- turn_
worker_ active - Includes startup reservations, before the child acquires the turn lease.