Adds an --agent flag to job log for the robots#885
Open
mcncl wants to merge 12 commits into
Open
Conversation
mitchbne
reviewed
Jun 21, 2026
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
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.
Description
Fetching a Buildkite job log for an LLM/agent to read is wasteful: the raw log is full of ANSI colour codes, inline
\x1b_bk;t=...timestamps, and carriage-return progress redraws that burn tokens without adding meaning.This PR adds an opt-in
--agentflag tobk job logthat digests the log into a compact, LLM-friendly form via theterminal-to-llmlibrary (strips escapes/timestamps, resolves CR redraws, collapses duplicate/progress lines, and applies failure-focused windowing). On a real job log this cut output by ~87%.To see the reduction on any job:
Changes
--agenttobk job log, routing output through digest.Process--agent):--format plain|markdown- render groups as Markdown headings/code blocks.--max-tokens N— hard ceiling on estimated tokens (0 = unlimited).--no-window— disable failure-focused windowing (keep all lines).bk job log --help:Testing
mise test)mise format)Also verified end-to-end against a real job log across each flag combination.