Repository navigation
Closed
Copy link
Labels
Description
Summary
inference-gateway/cli PR #1410 (issue inference-gateway/cli#1398, part of inference-gateway/cli#1396) adds infer headless --serve, a long-lived worker that keeps one process per thread instead of one infer headless process per prompt:
infer headless --serve --session-id <id>takes no task and implies--format ag-ui. It runs one agent turn peruser_messageframe read on stdin and writes each turn to stdout as one AG-UI run:RUN_STARTEDwiththreadIdset to the conversation id, then exactly oneRUN_FINISHEDorRUN_ERROR.- Stdin carries app frames (lowercase
type) and stdout carries AG-UI events (uppercasetype), the same vocabulary the daemon WebSocket binding speaks, so a host relays lines without translating them. - A
user_messagesent mid-turn is queued and drained into the running turn. Anything still queued when a turn ends starts the next turn. - A new
{"type":"interrupt"}stdin frame cancels the running turn, which ends withRUN_FINISHEDoutcomecancelled. approval_response,user_question_responseandcomputer_use_controlkeep their shapes and behaviour.- With
browser_use.backend: extensionthe worker binds no port. A browser tool writes abrowser_commandline on stdout and waits for thebrowser_resultline with the sameidon stdin, so the host relays both to the extension. - Only the first run of a resumed session opens with
MESSAGES_SNAPSHOT. - Stdin EOF lets the running turn and any queued messages finish, then shuts the worker down together with the gateway, MCP servers and containers it started. A host sends
interruptfirst for a faster stop.
The CLI's own reference pages docs/ag-ui-output.md (new "Serve worker" section) and docs/commands-reference.md (--serve flag) were updated inside the PR. Affected org documentation: wherever infer headless, its flags, the AG-UI headless output or the desktop sidecar wiring are described, and any page on the browser extension bridge that says browser tools always reach the extension over the local WebSocket port.
Acceptance Criteria
- The headless command reference documents
--serve: no task argument, implied--format ag-ui, one AG-UI run peruser_message, and an example with--session-id - The AG-UI headless output reference documents the serve worker stdin frames (
user_message,interrupt,browser_result, and the unchangedapproval_response,user_question_responseandcomputer_use_control) and the one-run-per-turn contract withthreadIdset to the conversation id - The docs describe the
interruptframe ending the running turn withRUN_FINISHEDoutcomecancelled - The browser extension docs explain that a serve worker binds no port and relays
browser_command/browser_resultframes over stdout and stdin - The docs describe the stdin EOF shutdown behaviour (queued turns finish, then the gateway, MCP servers and containers stop) and recommend sending
interruptfirst for a fast stop - The new sections link back to feat(headless): add a --serve worker that runs one AG-UI run per user_message cli#1410
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
edenreich commentedon Sep 29, 2026
@claude can you work on this?
inference-gateway-maintainer commentedon Sep 29, 2026
Claude finished @edenreich's task in 2m 41s —— View job •
docs/issue-862-20260929-1049• [Create PR ➔](https://github.com/inference-gateway/docs/compare/main...docs/issue-862-20260929-1049?quick_pull=1&title=Issue%20%23862%3A%20Changes%20from%20Claude&body=This%20PR%20addresses%20issue%20%23862%0A%0AGenerated%20with%20%5BClaude%20Code%5D(https%3A%2F%2Fclaude.ai%2Fcode)Done - PR #863 opened
--servein the headless command referenceinterrupt->RUN_FINISHEDoutcomecancelledinference-gateway/cli#1410- not done, see belowWhat changed
cli.mdgets a new Serve worker (--serve) section at the end of Headless Agent Stream Output: no task argument, implied--format ag-ui, a--session-idexample, a sample stdin/stdout exchange, and the one-run-per-turn contract withthreadIdset to the conversation id. It carries a stdin frame table (user_messagequeued mid-turn and drained into the running turn,interruptending the turncancelled,browser_result, plus the unchangedapproval_response/user_question_response/computer_use_control), a Browser tools without a port subsection, and a Shutdown subsection for the stdin-EOF behaviour with theinterrupt-first fast stop. Also: the first-run-onlyMESSAGES_SNAPSHOTnote, a core-commands row, the daemon's Session workers row now pointing at the serve worker, and theag-uiformat bullet noting--serveimplies it.opentask.mdbridge protocol now states a standalone serve worker binds no port and relaysbrowser_command/browser_resultover stdio.The one item left out
The repo's
AGENTS.mdforbids referencing GitHub issues or pull requests in doc content ("provenance belongs in the generatedCHANGELOG.md"), so I did not add thecli#1410link. The PR body records it instead. Say the word if you want the convention overridden here.Validated:
bun run lint:md,bun run format:check,bun run buildall pass.| Branch | PR #863
inference-gateway-releaser commentedon Sep 30, 2026
🎉 This issue has been resolved in version 0.9.19 🎉
The release is available on GitHub release
Your semantic-release bot 📦🚀