Repository navigation
Description
Part of #1396
Summary
The Telegram channel still spawns infer headless per message through internal/platform/agentrunner. It renders the child's legacy JSON lines and brokers approvals by scanning the child's stdout. Move it onto the daemon's threads and workers, so a Telegram chat uses the same sessions, events and approval contract as the desktop app and the extension.
The channel becomes a driving adapter of the sessions context. It holds one Client per chat, hands frames to Registry.Handle and receives the worker's AG-UI events through Deliver. No socket is involved.
One thing stands in the way. The binding and the thread registry only start when browser_use is enabled with backend: extension, and they borrow its port and token (bindingEnabled and startBinding in cmd/daemon/daemon.go). A daemon that runs Telegram without browser-use has no registry, and the desktop app cannot reach a daemon whose user never enabled browser-use. That criterion comes first and can land on its own, since inference-gateway/desktop#367 waits for it.
Scheduled jobs and heartbeat wake-ups are out of scope. Each is one process per run either way, and no client follows a job run, so they keep running as one-shot infer headless inside the daemon.
Acceptance Criteria
-
infer daemonstarts the thread registry and the binding whenever it runs, on their own switch, port and token. Thebrowser_use.extensionport and token stay the fallback, and the extension relay attaches only with the extension backend - A Telegram chat follows its sender's thread through
resume_conversation, keeping the deterministic session id per sender, in the daemon's working dir. No process is spawned per message - Replies are rendered from the worker's AG-UI events, and
agentrunner.FormatAgentMessageno longer serves the channel - A message is a
RunAgentInput, with images as content parts of the user message in place of--files - The thread runs with the remote-control system prompt that
--remoteselects today - Approvals and questions arrive as interrupts and are answered with resume entries, the way the other clients answer them. With
channels.require_approvaloff the channel answerscancelled, so gated tools stay blocked as today -
/clearand the other channel commands keep working against the thread -
internal/platform/agentrunneris used by the Agent tool, GitHub setup, the scheduler and the heartbeat only - Channel tests pass against the worker path
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
feat(daemon): host the AG-UI WebSocket binding and supervise session …
[-][FEATURE] Run Telegram, scheduler and heartbeat sessions through daemon workers[/-][+][FEATURE] Run Telegram sessions through daemon workers[/+]edenreich commentedon Sep 30, 2026
@infer can you work on this? use /domain-driven-design /clean-architecture /clean-code /go /go-concurrency
inference-gateway-maintainer commentedon Sep 30, 2026
Model:
ollama_cloud/glm-5.3-flash· View JobTodos
Pull Request
#1421
The agent hit the job's time limit before finishing, so it was stopped to salvage its work. Its committed changes were pushed; the draft pull request is linked above.
The failure data is unambiguous now:
quotedToolResultuses three-double-quote fences ("""), and the cap counts the whole JSON line (so my 1000-a check was wrong). Let me rewrite the render tests to match the actual worker-path output.Model:
ollama_cloud/glm-5.3-flash· Exit Code:0· Duration: 38m 51sTokens: 19,138,344 in · 196,093 out · 19,334,437 total (107 requests)
Tool calls: 179 total · 100% success rate
Traces
Stats
Triggered by edenreich · Infer Action · OSS
fix: resolve #1401
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 📦🚀