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] Centralize daemon, worker, channel and connection logs #1402
Every infer process writes its own daily file under ~/.infer/logs, so one request that crosses the daemon, a worker and a client connection leaves its trail in several files. A session worker inherits the daemon's stderr today and still writes a log file of its own (LaunchWorker in internal/sessions/infrastructure/worker.go). With the daemon supervising the processes it starts, it collects their logs and writes one tagged stream.
A thread is a project dir plus a conversation id, so log lines carry project_dir and conversation_id. The conversation id is what AG-UI calls threadId.
Acceptance Criteria
The processes the daemon starts, session workers and one-shot job runs alike, log to stderr as JSON and create no log files of their own
The daemon writes each of their lines into ~/.infer/logs/daemon-<date>.log with project_dir, conversation_id and worker_pid
Client connects and disconnects are logged with client and protocol_version. The binding logs the connect today
The browser relay logs the extension attaching and detaching with extension_version, which the binding no longer names
Routing errors (unknown thread, dead worker, no extension) are logged with project_dir and conversation_id
Channel logs carry project_dir and conversation_id when they act for a thread
The daemon docs say where the log lives. Streaming logs to clients over the binding is out of scope
All work is complete: PR #1424 updated with the docs-ticket reference, board item in QA, tree clean. Let me finalize the todo list:
Done. The work is complete and pushed as draft PR #1424 (Resolves #1402), tracked on the Roadmap 2026 board (In progress, then QA).
What changed
Every process the daemon starts now feeds one log stream instead of scattering per-process files:
Children log JSON to stderr with no log file of their own: the daemon sets INFER_LOG_STDERR_JSON=true on the children it starts; logger.NewLogger then builds the zap production logger over stderr only and skips the log file entirely (internal/platform/logger/child.go). Session workers (internal/sessions/infrastructure/worker.go), scheduled fires (internal/scheduler/cron.go) and heartbeat ticks (internal/scheduler/heartbeat/heartbeat.go) all get the flag.
The daemon collects and tags child lines: a new logger.CollectChildStderr merges each child stderr line into the daemon's own log (lines the child logged as JSON keep their msg, fields and level; anything else logs the raw line), one entry per line tagged project_dir, conversation_id (the AG-UI threadId) and worker_pid. Workers pipe their stderr through it; one-shot runs collect via the new agentrunner.Result.Pid. The collection is streaming (os.Pipe + a drain goroutine), so worker output lands in ~/.infer/logs/daemon-<date>.log as it happens.
Bindings and connections: the binding's Conn now carries every field the hello declared except the token (HelloAttr, generic so agui still names no client), and drop() logs client disconnects with client and protocol_version beside the existing connect log.
Browser relay: logs the extension attaching and detaching with extension_version, read from the hello field the binding never surfaced, and warns when a browser command has no extension to route through.
Routing errors: the sessions registry's route returns the thread, so unknown-thread, launch-failure and dead-worker (failed send) errors log with project_dir and conversation_id; failed worker browser-command routing is logged with the thread's tags too.
Channels: the Telegram manager's message routing and its failures, plus the per-chat render and interrupt-answer failures, carry project_dir and conversation_id.
Docs: docs/commands-reference.md's daemon section now says the daemon log is ~/.infer/logs/daemon-<date>.log and that started children land there; the sessions and agui READMEs match. Streaming logs to clients over the binding stays out of scope per the issue.
Verification
go test -tags purego ./... is green (one pinned test updated for the new worker env), task vet, task fmt and task precommit:run (golangci-lint 0 issues) all pass. Since the change alters user-facing log behavior, a [DOCS] ripple ticket is open in inference-gateway/docs (issue 872) for the mirrored docs.
Activity
edenreich commentedon Sep 30, 2026
@infer Can you work on this? use /domain-driven-design /ponytail:ponytail /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
#1424
✅ Infer Result: Success
All work is complete: PR #1424 updated with the docs-ticket reference, board item in QA, tree clean. Let me finalize the todo list:
Done. The work is complete and pushed as draft PR #1424 (Resolves #1402), tracked on the Roadmap 2026 board (In progress, then QA).
What changed
Every process the daemon starts now feeds one log stream instead of scattering per-process files:
INFER_LOG_STDERR_JSON=trueon the children it starts;logger.NewLoggerthen builds the zap production logger over stderr only and skips the log file entirely (internal/platform/logger/child.go). Session workers (internal/sessions/infrastructure/worker.go), scheduled fires (internal/scheduler/cron.go) and heartbeat ticks (internal/scheduler/heartbeat/heartbeat.go) all get the flag.logger.CollectChildStderrmerges each child stderr line into the daemon's own log (lines the child logged as JSON keep their msg, fields and level; anything else logs the raw line), one entry per line taggedproject_dir,conversation_id(the AG-UIthreadId) andworker_pid. Workers pipe their stderr through it; one-shot runs collect via the newagentrunner.Result.Pid. The collection is streaming (os.Pipe+ a drain goroutine), so worker output lands in~/.infer/logs/daemon-<date>.logas it happens.Connnow carries every field the hello declared except the token (HelloAttr, generic so agui still names no client), anddrop()logs client disconnects withclientandprotocol_versionbeside the existing connect log.extension_version, read from the hello field the binding never surfaced, and warns when a browser command has no extension to route through.routereturns the thread, so unknown-thread, launch-failure and dead-worker (failed send) errors log withproject_dirandconversation_id; failed worker browser-command routing is logged with the thread's tags too.project_dirandconversation_id.docs/commands-reference.md's daemon section now says the daemon log is~/.infer/logs/daemon-<date>.logand that started children land there; the sessions and agui READMEs match. Streaming logs to clients over the binding stays out of scope per the issue.Verification
go test -tags purego ./...is green (one pinned test updated for the new worker env),task vet,task fmtandtask precommit:run(golangci-lint 0 issues) all pass. Since the change alters user-facing log behavior, a[DOCS]ripple ticket is open in inference-gateway/docs (issue 872) for the mirrored docs.Model:
ollama_cloud/glm-5.3-flash· Exit Code:0· Duration: 14m 53sTokens: 11,591,841 in · 80,020 out · 11,671,861 total (66 requests)
Tool calls: 117 total · 100% success rate
Traces
Stats
Triggered by edenreich · Infer Action · OSS
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 📦🚀