agentexec: publish agent logs to SubjectForSystem #958

Closed
opened 2026-10-27 13:38:27 +00:00 by sam · 0 comments
Owner

Part of #450. Depends on #451 (task log sink).

agentexec.SubjectForSystem is documented as the return channel for "log
dumps, health, and PII warnings" but has no publisher anywhere in the
codebase.

In cmd/archie-agent/main.go, replace the stderr-only slog.Handler with
one that tees to stderr (kept for operator debugging when a shell is
attached to a live container) and publishes each record to
agentexec.SubjectForSystem(taskID). The agent already has its NATS client
and task ID (bootTaskID, read from <worktree>/.git/task.json).

Publishing must be fire-and-forget with a bounded local buffer — log
shipping must never block or fail the run it's reporting on. A full buffer
drops the oldest entry, not the newest, and should log (locally, stderr
only) that it dropped something, once, not per-entry.


Imported from beads archie-core-1786637501190-430-8c471d9f · GitHub #453 · type task · priority P2 · created 2026-08-09 · closed 2026-08-09

Part of #450. Depends on #451 (task log sink). `agentexec.SubjectForSystem` is documented as the return channel for "log dumps, health, and PII warnings" but has no publisher anywhere in the codebase. In `cmd/archie-agent/main.go`, replace the stderr-only `slog.Handler` with one that tees to stderr (kept for operator debugging when a shell is attached to a live container) and publishes each record to `agentexec.SubjectForSystem(taskID)`. The agent already has its NATS client and task ID (`bootTaskID`, read from `<worktree>/.git/task.json`). Publishing must be fire-and-forget with a bounded local buffer — log shipping must never block or fail the run it's reporting on. A full buffer drops the oldest entry, not the newest, and should log (locally, stderr only) that it dropped something, once, not per-entry. --- _Imported from beads `archie-core-1786637501190-430-8c471d9f` · GitHub #453 · type task · priority P2 · created 2026-08-09 · closed 2026-08-09_
sam added the mediumtask labels 2026-10-27 13:38:27 +00:00
sam self-assigned this 2026-10-27 13:38:27 +00:00
sam closed this issue 2026-10-27 13:38:27 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#958