Repository navigation
feat: add spinloop work logs - #237
Merged
Merged
Conversation
added 4 commits
September 19, 2026 11:23
Reads an item's kept agent output through the existing GET
/v1/items/{id}/log, the same --url/token shape as add/list/abort/remove.
-f/--follow polls for new output and prints it as it arrives, waiting
through backlog and running, ending once the item is done, failed,
removed, or the operator interrupts — reusing followUntilInterrupted, the
same wiring fleet logs -f and remote logs -f already share.
Every function in work_logs.go now hits 100% statement coverage: the malformed-answer and unreachable-API branches in workLogFetch/ workItemState, a real API failure propagating out of the follow loop (distinct from a clean "item removed" end), the -f flag actually driven through the real command rather than only the polling loop directly, and printWorkLogSuffix's fallback when the kept output does not still start with what was already printed.
work logs/abort/remove all take a positional item id with no ValidArgsFunction set, so tab completion fell through to Cobra's default and offered filenames from the working directory — never valid ids. None of the three has a local registry to draw real ids from (an id only means anything against a specific run's work list, reached over the network), so itemIDSlot only suppresses file completion.
outofcoffee
marked this pull request as ready for review
September 19, 2026 14:09
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
spinloop work logsas a client of the work list API's existing log endpoint, following on from #228.Summary
spinloop work logs <id>prints an item's kept agent output throughGET /v1/items/{id}/log-f/--followpolls for new output and streams it as it arrives, waiting throughbacklogandrunning, ending once the item isdone,failed, removed, or the operator interruptsImplementation details
Follow reuses
followUntilInterrupted, the same wiringfleet logs -fandremote logs -falready share. Each poll re-fetches the whole log (the endpoint has no offset/range parameter) and prints only the new suffix; it also checks the item's own state via the existing list endpoint rather than adding a new one.Closes #231