Repository navigation
Conversation
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
[Medium impact] The PR appears safe to merge; no blocking issues were found. SummaryThe PR gives
Reviews (7) · Last reviewed commit: "test(adb): keep only the long-path diges..." · Reviewed by Greptile |
|
TL;DR: Both new tests fail on main and pass with this fix. A long device path no longer hides the checksum. A checksum answer that is too big now reports a resource limit. ResultsI ran the one test file the pull request changes, on a fresh build of main 62bf098.
Not run
Thanks, HawkForge, for the fix. Commandsexport PATH=~/.local/opt/node24/bin:$PATH
git apply 3458.tests.diff # tests only
npm run test:focused -- src/adb/AdbProvider.test.ts
git apply 3458.src.diff # add the fix
npm run test:focused -- src/adb/AdbProvider.test.tsBefore each run I checked the file for the word doctor. It has none. Test setup🤖 Generated with Claude Code (Sonnet 5.5, verified by Opus 5.5) 🦊 |
sha256sum echoes the device path, so a correct digest line for a path near 1 KiB exceeded the fixed 1 KiB capture budget. The resulting resource failure was then reported as device_digest_source "unavailable", the same outcome as a device without sha256sum. Size the budget to the path, and return a capture-budget failure as a resource constraint instead of an unverified success. Fixes #3369
7a99a4b to
d2dc61d
Compare
…udget # Conflicts: # src/adb/AdbProvider.ts
|
merged main in to fix the conflict. main moved the digest receipt to the object form, so the oversized-answer branch uses that now too, same messages. AdbProvider tests pass (94), and both new ones still fail without the fix. |
…udget # Conflicts: # src/adb/AdbProvider.ts
|
main moved again (the push target now goes through |
|
Update for head b79b8bc. Thanks, HawkForge, for merging main twice. My earlier comment said real CI had not run. It has now. Source tests, Portable tests and CI required are red, but only in two files that this PR does not touch. They are src/adb/AdbProvider.test.ts passes in CI (96 tests). I did not re-run your new tests. 🤖 Written with Claude Code (Sonnet 5.5, verified by Opus 5.5), posted with my OK 🦊 |
…udget # Conflicts: # src/adb/AdbProvider.ts
|
merged main again (picks up 5a5bcb6). main now treats an oversized or timed out sha256sum answer as a failed verification by itself, so I took main's version there and this PR is down to the digest budget sized from |
|
Thank you for covering long device paths. Main now preserves checksum capacity failures as typed errors with the completed-push partial observation, which resolves the classification tracked in #3369. This PR also proposes increasing the checksum capture budget based on the selected path, so a valid long-path response can verify successfully; main at ca3fd7b still uses a fixed 1 KiB budget. I am keeping it open. If you would like to continue, could you focus the diff and tests on that remaining long-path behavior while retaining main’s partial-failure semantics? This is source-derived; I did not run an adb device in this pass. |
Main already covers an oversized checksum answer as a resource constraint with the completed push retained. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
merged main in and trimmed it down. the oversized-answer test is gone since main already covers that with the completed push kept as a partial observation, and the source change is just the sha256sum budget sized from |
Summary
Fixes #3369.
push-adb-filenow verifies a push to a long device path. Previously, a correctsha256sumanswer that exceeded the capture budget was reported asdevice_digest_source: "unavailable". When an answer genuinely cannot be read within its budget, the operation now returns the documentedresource_constraintfailure instead of an unverified success.Problem and expected behavior
sha256sumechoes the device path after the digest, but the capture budget was a fixed 1 KiB. For a 1,142-character path, the correct checksum line exceeded it.runAdbreturnedAnalysisResourceConstraintError, and the push path treated every digest failure as "the device did not answer sha256sum". Callers got the same outcome as a device withoutsha256sum, and the reason was lost. The issue expects a correct digest to verify the transfer (docs/adb-device-analysis.md), and a capture-budget failure to remain aresource_constraint, distinguishable from an absent command.Change and scope
In
src/adb/AdbProvider.ts(pushFile):sha256sumcapture budget is1024 + 2 × byteLength(device_path). The factor of two leaves room for asha256sumthat escapes special characters in the echoed path.AnalysisResourceConstraintErroris returned as that error instead of becoming"unavailable". Other failures (nosha256sum, protocol errors) keep the existing"unavailable"result and limitation.Not included: changing what other digest failures (for example cancellation) report.
Ordinary fix within existing boundaries; scope decision not applicable. The push itself and its mutation authority are unchanged.
Contract and boundary impact
resource_constrainterror code.device_sha256anddevice_digest_source: "device_sha256sum".Expected effects (check known effects; use documentation-only on its own).
Unchecked items do not establish absence; leave uncertainties visible.
(The checked effects belong to the existing
push_adb_fileoperation, which launches adb and writes the caller's file to the device; this PR doesn't add any.)Evidence and regression coverage
src/adb/AdbProvider.test.ts):sha256sumfor a 1,132-character path built from 220-character directories (each component within the usual 255-byte limit, per review); expectsdevice_sha256to equal the local digest with sourcedevice_sha256sum.resource_constraintrefusal.unavailable/null, the second succeeds). A CLI run on base with a stub adb (REA_ADB_PATH) and a 1,142-character path returneddevice_digest_source: "unavailable",device_sha256: null.device_digest_source: "device_sha256sum"with the correct digest for both a 25-character and a 1,142-character path.For evidence-bearing changes:
Validation performed
npx vitest run src/adb tests/boundary/mcp/adbMcp.test.ts— 134 passednpm run check— passednode scripts/rea.mjs push-adb-file probe-device <local> <device-path> --format jsonwith a stub adb, before/after —unavailable→device_sha256sumfor the 1,142-character path (macOS arm64, Node 24.13)Compatibility, safety, and release
resource_constraintafter the push has completed; previously it returned success with an unverified digest.Author readiness
Human owner: @HawkForge
Before merge
type(scope): outcome.