Skip to content

jobs API: serve the latest log lines - #13

Merged
monkeydioude merged 1 commit into
masterfrom
feat/jobs-api-logs
Oct 10, 2026
Merged

monkeydioude merged 1 commit into
masterfrom
feat/jobs-api-logs

Conversation

@monkeydioude

Copy link
Copy Markdown
Owner

Lets the SB dashboard follow josuke live, without access to journald.

What

  • GET /jobs/logs (jobs API, same token) returns the last 1000 log lines, as written to stderr. Journald still gets everything.
  • Lines are numbered from 1 at each boot, and boot_id changes at each boot. Pass the previous last and boot_id to get the new lines only. If josuke restarted in between, every line kept is returned, so no line is lost.
  • main tees the log package output into the buffer before josuke.New: the job loggers (job#N prefix) copy the log output when they are created.

Deploy

Breaking for library callers only: HandleJobs now takes the *LogBuffer.

Tests

  • go test -race ./...
  • Ran the binary, triggered a job, and read its job#1 lines and command output from /jobs/logs.

🤖 Generated with Claude Code

GET /jobs/logs returns the last 1000 log lines, numbered per boot, so a
dashboard can follow josuke live without access to journald. Callers
pass the previous last line number and boot id to get new lines only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@monkeydioude
monkeydioude merged commit 6c5c907 into master Oct 10, 2026
2 checks passed
@monkeydioude
monkeydioude deleted the feat/jobs-api-logs branch October 10, 2026 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant