You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE] Long-lived headless session worker that runs one AG-UI run per user_message #1398
The daemon runs each thread in a long-lived worker process instead of one infer headless process per prompt. The worker is headless in a serve mode: it stays alive, runs one agent turn per user_message it reads on stdin, and writes one AG-UI run per turn on stdout. It builds on the stdin control loop headless already has (internal/presentation/headless/control.go: approval_response, user_question_response, user_message, computer_use_control).
Stdout carries AG-UI events (uppercase type) and stdin carries app frames (lowercase type). That is the same vocabulary the daemon WebSocket binding speaks, so the daemon relays lines without translating them.
Browser tools reach the extension through the ExtensionRequest seam from #1395. In the worker it writes a browser_command line on stdout and waits for the matching browser_result line on stdin, so no worker binds a port.
Acceptance Criteria
infer headless --serve --session-id <id> starts without a task and waits for user_message on stdin
Each user_message runs one turn, emitted as RUN_STARTED then exactly one RUN_FINISHED or RUN_ERROR, with threadId set to the conversation id
A user_message that arrives while a turn runs is queued and drained as today
A new stdin frame {"type":"interrupt"} cancels the running turn, which ends with outcome cancelled
approval_response, user_question_response and computer_use_control keep their shapes and behaviour
With browser_use.backend: extension, browser tools write browser_command frames on stdout and read browser_result frames on stdin, and the worker binds no port
stdin EOF shuts the worker down cleanly, including the gateway, MCP servers and containers it started
A test drives a worker through scripted stdin under INFER_GATEWAY_MOCK=true and asserts one run per turn, a cancelled turn and a browser command round trip
Activity
inference-gateway-releaser commentedon Sep 30, 2026
🎉 This issue has been resolved in version 0.219.0 🎉
The release is available on:
Your semantic-release bot 📦🚀