Repository navigation
Upload CLI-local file attachments before thread requests - #3750
Merged
ymichael merged 1 commit intoSep 15, 2026
Merged
Conversation
ymichael
deleted the
bb/fix-file-cli-flag-attachment-asymmetry-thr_9p5dep7325
branch
September 15, 2026 22:18
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.
Human comments
What was wrong
bb thread ... --file /absolute/report.pdfsent the path verbatim, so the execution host tried to read a path belonging to the CLI machine. The previous image-upload change (#2579) explicitly preserved this behavior for files, creating an inconsistent attachment boundary:--imageuploaded local bytes while--filedepended on the execution host's filesystem.What changed
Generalize the CLI image-upload helper to handle both file and image inputs before spawn, tell, fork, and queued-message update requests. Absolute paths and
file:URLs are read on the CLI machine and uploaded through the existing SDK project attachment API; the thread receives the returned relative attachment token. Existing relative attachment tokens pass through unchanged, and repeated references to the same local path share one upload.For example,
bb thread tell THREAD "Review this" --file "$PWD/report.pdf"now attaches the invoking machine's file even when the thread executes elsewhere. This intentionally changes absolute--filepaths from execution-host paths to CLI-local paths. CLI help, guide templates, and skill references describe the new behavior. There are no server/daemon wire changes.How you verified
pnpm exec turbo run test typecheck build --filter=@bb/cli: 620 tests passed; typecheck and build passed.pnpm start:worktreewith a fresh data directory and verified server/daemon health and the connected test host. Used the built BB CLI against that server with explicit endpoint settings and cleared inherited thread context.file:URL and PNG; both uploaded attachments downloaded byte-for-byte. Updated the queued message with binary data, confirmed path/URL deduplication and existing file/image token preservation, then removed the scheduled test message.