Repository navigation
Conversation
|
Automated triage on #2139 (by wshm) independently confirms this: categorized as bug, priority high, 93% confidence, with the recommended fix being to "bypass summarization when an explicit output format flag is present" — which is exactly what this PR does. This PR narrows that slightly: it only bypasses for parseable formats ( |
|
Note for the PR Testing Checklist: the "token savings ≥60%" item is N/A here. This isn't a new/compressing filter — it's a correctness fix that bypasses compression when the user explicitly requests The remaining checklist items are covered:
On security: the new |
|
I believe I tackled this problem a bit differently a few hours earlier #2135 ;) rtk adds |
|
Thanks @dessite — I looked at #2135 and I don't think they collide; they fix different layers and are actually complementary. #2135 swaps #2140 (this PR) targets the Two notes specific to #2139:
On "rtk adds So I think both can land: #2135 makes the default compressed output value-preserving, #2140 honors an explicit format request losslessly. Happy to defer to maintainers on sequencing though. |
rtk forced its summarizers/schema compression on aws commands even when the user explicitly requested --output json (or yaml), dropping field values and emitting non-parseable output. Route explicitly-requested lossless formats through an unmodified passthrough so jq/json.load keep working (issue rtk-ai#2139). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- explicit_lossless_format: last --output wins (aws CLI semantics), and a dangling --output (no value) no longer falls through to lossy filtering - run_generic: detect the --output=<fmt> form so it doesn't inject a second --output json on top of an explicit human format - run_passthrough: document the intentional tee skip - tests: cover repeated and dangling --output Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
e79670e to
47dad55
Compare
|
Rebased onto latest The two changes sit at different layers and compose cleanly:
Conflict was a one-line doc comment on Validation on the rebased branch: |
|
Still needed on I retested on rtk aws lambda get-function-configuration --function-name watermark-processor --output jsonOutput: Fixed by #2376: scalar values are now preserved — no more Still broken on 0.42.4: the output is not valid JSON — keys are unquoted and there are no commas/separators — so This PR's approach (short-circuit to a byte-faithful passthrough when the user explicitly asks for |
|
Friendly ping — #2139 is still open. To be clear this doesn't overlap with the merged #2135: that one keeps output compact (but not valid JSON), whereas this honors an explicit |
|
Re-verified this against This does not overlap with the merged #2135. That's the most likely reason to skip this PR, so concretely:
The On the security note — I want to raise this rather than wait for it. This isn't a new pattern, it's an existing one aws is missing. Happy to rebase if it's drifted. |
|
Closing this to reduce my own open-PR footprint here, not because the change is wrong. I opened seven PRs across 26–28 May, which was too many at once from someone with no merge history in this repo — and this one has had no review activity in the two months since. I'd rather leave a short, meaningful queue than a wall of stale PRs on your review list, so I'm keeping only #2105 (approved, single file) and #2142 (backed by the user report in #1830). The branch stays on my fork and this is trivially reopenable if it's ever wanted — no work is lost. |
Summary
--output json(returns non-JSON schema skeleton, drops field values) #2139:rtk aws ... --output jsonreturned a lossy schema skeleton (string,int,string[64]) or a one-line table summary instead of valid JSON, dropping field values (ImageUri,CodeSha256, env vars) and breaking downstreamjq/json.load.filter_lambda_get) or generic schema compression (filter_json_string) regardless of the user-requested output format.--output json/--output=json/yaml/yaml-stream),run()short-circuits to a new byte-faithfulrun_passthrough. Lossy/human formats (table,text) and the no-flag default keep the existing compression behavior.This covers all
awssubcommands, not justlambda.Test plan
cargo fmt --allcleancargo clippy --all-targets— zero warningscargo test --all— 1947 passedtest_explicit_lossless_formatcovers json/yaml/=json positives and table/text/absent negatives🤖 Generated with Claude Code