Release/v0.15.0#67
Merged
Merged
Conversation
- Cost reports: every result-producing command prints a per-call cost report (pipe, model, tokens in->out, USD, total) to stderr via a new shared piper/usage.py. Unpriced calls (cost is None) are excluded from the total; token categories are never summed. Detached prints from wait/result (collection time), not the start-only demos. - summarize-pdf file upload (breaking): the document is uploaded to hosted storage up front with client.upload_file (inputs.upload_document_input) and the run carries only the returned pipelex-storage:// URI, replacing the inline base64 data: URL. build_document_input becomes the pure envelope builder; errors.py gains file-upload error hints. - Lifecycle helpers return (main_stuff, RunUsage) (breaking): execute_pipe, start_and_wait, and detached's attend_run now return usage alongside the main output so commands can print the cost report. - Docs: drop the stale-prone "shared modules" count (no-hardcoded-counts rule), keeping the structural "three execution modes" constant. Claude-Session: https://claude.ai/code/session_016xWB4B8DjEYbiffrjg3dsS Co-authored-by: Louis Choquel <8851983+lchoquel@users.noreply.github.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016xWB4B8DjEYbiffrjg3dsS
Greptile SummaryThis PR adds cost reporting and hosted document uploads to the CLI. The main changes are:
Confidence Score: 5/5This looks safe to merge. No blocking issues found in the changed code.
What T-Rex did
Important Files Changed
Reviews (1): Last reviewed commit: "Release v0.15.0: cost reports + hosted u..." | Re-trigger Greptile |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
[v0.15.0] - 2026-07-22
Added
piper/usage.pyreads the run's per-call usage off the SDK result into aRunUsage(usage_from_resultsfor the durable modes' typedRunResults.tokens_usages;usage_from_executefor blocking, which lifts the same records off its execute result) and renders it withprint_cost_report. It respects the SDK's usage semantics: an unpriced call (cost is None— mock / own-GPU / dry-run) is excluded from the total rather than counted as zero, and token categories are never summed. Detached prints the report fromwait/result(collection time), not from the start-only demo commands.Changed
summarize-pdf(breaking): the document is now uploaded to hosted storage up front withclient.upload_file(newinputs.upload_document_input), and the run request carries only the returnedpipelex-storage://URI — replacing the previous inline base64data:URL.inputs.build_document_inputbecomes the pure envelope builderbuild_document_input(path, uri); the upload is a separate step, so a file or capability error surfaces before any run is created.piper/errors.pygains hints for the file-upload error family (unsupported capability, rejected asset, authentication, invalid local source).(main_stuff, RunUsage)(breaking):execute_pipe,start_and_wait, and detached'sattend_runnow return the resolved main output and the run's usage, instead ofmain_stuffalone, so the commands can print the cost report. The demo commands unpack the pair; the SDK output accessor itself is unchanged.pipelex-sdkfloor from>=0.4.0to>=0.5.0(forupload_fileand typed run usage).🤖 Generated with Claude Code