fix(bash): let the output preview use the whole line budget - #858
Open
ANIRUDDHA ADAK (aniruddhaadak80) wants to merge 1 commit into
Open
ANIRUDDHA ADAK (aniruddhaadak80) wants to merge 1 commit into
ANIRUDDHA ADAK (aniruddhaadak80) wants to merge 1 commit into
Conversation
ANIRUDDHA ADAK (aniruddhaadak80)
requested review from
Aayam Bansal (aayambansal) and
Ishaan Gangwani (ishaan1124)
as code owners
September 30, 2026 04:46
|
ANIRUDDHA ADAK (@aniruddhaadak80) is attempting to deploy a commit to the InkVell Team on Vercel. A member of the Team first needs to authorize it. |
ANIRUDDHA ADAK (aniruddhaadak80)
force-pushed
the
fix/bash-output-line-budget
branch
from
September 30, 2026 09:37
5b5fb01 to
4afaa38
Compare
The line test was a strict < while the byte test beside it was <=, so the effective limit was one line shorter than the advertised one. Output of exactly maxLines lines was treated as an overflow: the last line was dropped, truncated came back true, and the entire stream was copied to a second file. head() moved with it so the two agree. truncation.ts already uses <= for the same comparison.
ANIRUDDHA ADAK (aniruddhaadak80)
force-pushed
the
fix/bash-output-line-budget
branch
from
September 30, 2026 11:28
4afaa38 to
d852512
Compare
This branch has not been deployed
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.
What does this PR do, and why?
The
bashoutput preview was allowed one line less than its budget, so output of exactly the maximum dropped its last line and came back reported as truncated.The two bounds in
BashOutput.Capture.accept()disagreed with each other:head()used the matching strict comparison, so the preview consistently stopped atmaxLines - 1. WithmaxLines: 5:bash.tspassesTruncate.MAX_LINES(2000) and the tool description advertises that number, so a command printing exactly 2000 lines — a build log, a test run — loses its last line, is reported as truncated with "1 lines truncated", and has its whole output written to a second file the user then has to open for nothing. Every count is off by one as well: 2001 lines reports two removed rather than one.A budget is the most that fits, which is what the byte bound beside it already did and what
truncation.ts:107already does for the same comparison. The line bound becomes<=andhead()'s break becomes> lineBudgetto match.One existing expectation changes, deliberately
bash-output.test.tshad recorded the off-by-one instead of catching it:That test is about streaming the full output to the owned file, and both of its numbers were boundary artifacts of the bug. Everything else it asserts —
truncated,lines, the redaction, the single sink open, the saved file's length and its first and last lines — is unchanged and still passes.Linked issue
Fixes #857
How did you verify it?
Both tests fail against unmodified
mainand pass with the change:The new case pins both sides of the boundary in one test — exactly the limit keeps every line and reports
removed: { count: 0 }, and one line over keeps 5 and reportsremoved: { count: 1 }— so a fix that simply raised the limit could not pass it.The suite is self-contained (no
Instanceharness), so all 12 results are deterministic here.Formatting checked with the repository's own Prettier config (
semi: false,printWidth: 120) on LF-normalized copies, since this Windows checkout'score.autocrlf=trueotherwise makes Prettier flag every file repo-wide.Checklist
bun run checkis green (format, typecheck, backend + frontend/ui + SDK tests)bun run --cwd frontend/workspace buildsucceeds if I touchedfrontend/workspaceorfrontend/ui./tooling/repo/generate.tswas run and thetooling/sdkoutput committed if I changedbackend/cli/src/serverfrontend/docs/src/content/openscience/is updated if behavior changedpackage.jsonversions and tags are written by the release workflow)installandfrontend/landing/public/installare still byte-identical if I touched either