Skip to main content

Module chat_control

Module chat_control 

Source
Expand description

Direct task and run control for the standing chat: magi task control ....

A chat agent can resume a run, hold or release a task, retry a task with a changed instruction, rerun the failed checks of a pull request and abandon a dead run by command, with no question or offered choice in between. Every command goes through the transitions the rest of magi already uses ([crate::resume], Task::hold_manual, Task::release_operator, Task::edit, [crate::daemon::rerun_checks_once], [crate::driver::abandon_proven_dead]); this module only decides who may ask and about what.

  • Authorization. MAGI_NODE=chat and MAGI_RUN equal to the exact id of an open conversation (crate::chat_watch::authorize).
  • Scope. Only tasks that conversation filed itself (Task::filed_by_chat) and the runs recorded in their runs. A follow-up’s inherited origin_chat does not count. Task ids and run ids are checked against the queue under the task’s claim, not trusted.
  • Resume starts nothing here. It pins the owning task to the run and queues it; the loop’s ordinary start logic resumes it under the graph’s execution lease, so a second driver cannot appear.
  • Abandon is individually confirmed. The owner’s latest persisted send must be exactly abandon-run: <full run id> and --quote must equal it; liveness is then judged by the shared judge under the owner lock.
  • Merging is not here. It stays behind the approval gate.

Enums§

Operation
Only these operations cross the standing turn’s inherited capability. Paths, commands, merge decisions and conversation identities are not input.

Functions§

abandon
Abandon a run of this conversation’s task whose driver is proven gone. quote must be the entire latest persisted owner send, and that send must be exactly abandon_instruction. The evidence guard is held through the abandon, so the owner cannot retract in between.
abandon_instruction
The exact owner instruction that confirms abandoning run.
authorize
The conversation this process speaks for, or why it may not act.
describe
One line a person or agent can read after a successful command.
dispatch
The CLI sends only a typed operation when it inherited a turn capability. Outside a launched turn the existing, authorized local route remains usable.
hold
Hold a task of this conversation for the owner.
owned_run_task
The task of this conversation that recorded run (a full run id).
owned_task
A task of this conversation, from a full or unambiguous-prefix id.
release
Release a task of this conversation (the same transition as magi task release: the attempt count restarts, the history stays).
rerun_checks
チャットのリクエスト単位で受付記録を残し、共通遷移でチェックを再実行する。
resume
Resume a stopped, blocked or parked run of this conversation’s task. Only queues the pinned resume; returns the owning task.
retry
Change a queued or held task’s instruction and queue it again, in one save under one claim. Only what Task::edit allows can be retried; the attempt count follows Task::release (restarts), while runs, passes and the resumption history are kept.