Skip to main content

converge_queue_auto

Function converge_queue_auto 

Source
pub fn converge_queue_auto(doc: &str, want_auto: bool) -> Option<String>
Expand description

Converge the agent:queue opening-tag auto attribute to want_auto.

A content patch (the only editor-visible IPC seam for template documents) replaces a component’s body between its markers — it cannot add or remove an attribute on the <!-- agent:queue auto --> opening tag. After a queue halt strips auto on disk, a live route-owned editor buffer that still shows <!-- agent:queue auto --> re-diverges from the committed inactive snapshot on its next flush, regenerating the snapshot/HEAD drift loop on every preflight (#adoc-queue-ipc-buffer-divergence). Editor plugins call this (via the agent_doc_converge_queue_auto FFI export) to converge the live buffer’s queue tag to the committed shape.

Returns Some(new_doc) when the tag changed, None when there is no queue component or the tag already matches want_auto. Other opening-tag attributes (e.g. patch=append) are preserved.