Document how to hand off control to a human - #893
Open
Excelius-Wang wants to merge 2 commits into
Open
Conversation
The mechanics for pausing an agent to collect human input were only discoverable by reading the email-assistant example, so add a concepts page that spells out the halt_before + inputs loop and links the existing examples that already use it. Closes apache#56 Co-authored-by: Cursor <cursoragent@cursor.com>
7 tasks
Two section rules were shorter than their titles, and the shorthand :ref: links to applications / state-persistence had no caption because those labels sit after the headings. Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #56.
Handing control back to a person is a pattern Burr already supports well, but the mechanics were only discoverable by reading
examples/email-assistantand piecing togetherhalt_beforefrom the applications page. This adds a concepts page that states the pattern directly.Changes
docs/concepts/human-in-the-loop.rst, listed indocs/concepts/index.rstafterstate-machine.Runtime Inputssection ofactions.rstand theStepsection ofstate-machine.rst, since those are where a reader is most likely to be when the question comes up.The page covers: why the person stays outside the graph; the
run(halt_before=[...])/ collect /run(inputs=...)loop and the fact thathalt_beforetakes precedence when an action is in both halt lists; a minimal graph with a single approval step; a chat loop where the human action is both entrypoint and halt target; multi-handoff applications viaexamples/email-assistant; what changes in a web server; and whyinput()inside an action is CLI-only.How I tested this
halt_beforeprecedence behaviour and the resumed-run input handling... _human-in-the-loop:resolves from all three referring locations, and that the label sits after the page title to matchactions.rstandstreaming-actions.rst.Notes
Docs only, no source changes. The examples referenced (
email-assistant,conversational-rag/graph_db_example) are quoted rather than modified.Happy to shorten the page or move it if you'd rather this live under
docs/concepts/actions.rstas a subsection instead of standing on its own.Checklist
Made with Cursor