Repository navigation
fix: review hardening for re-signing, buffers and small leaks - #187
Merged
Merged
Conversation
- WDA upkeep (automatic re-signing, the Apple ID session check) only for devices that use WDA: skipped while the device in use is driven natively, and the round doesn't count, so switching to a WDA device checks at once - after re-signing, forget the background WDA and wake the supervisor - size limits: WDA responses 64 MB (Content-Length checked before reserving), DTX messages 64 MB over all fragments and read as they come, HEVC frames 8 MB (dropped whole, a keyframe asked for) - media: frames nobody subscribes to only update the parameter sets, no copy or allocation; they are still acknowledged - held_drag records the contact so closing the session lifts the finger - install_app clears the app cache once; LogFilter lowercases grep once - native screenshots say "via CoreDevice"; native_terminate drops the killed pids from the frontmost-app cache - serve_mjpeg keeps the Arc it sends instead of copying each frame - viewer auth: failed() checks and counts under one lock; tokens are written through a temporary file of their own Not changed from the review: TerminateApp stays outside the task scope (it is how an agent gets back after the user says no), and ring's verify_slices_are_equal is deprecated in 0.17, so `same` stays. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
8 tasks done
This was referenced Nov 25, 2026
Derrors
added a commit
that referenced
this pull request
Nov 25, 2026
- /mcp chunked bodies: the raw body is bounded too (the decoded 1 MB plus 64 KB of framing; endless trailer lines or long chunk extensions got 413 instead of growing for a minute), read in 64 KB pieces (about 16 decoding passes for 1 MB instead of 256), and a broken chunk gets 400 instead of a closed connection - /mcp answers: 1xx, 204 and 304 are never sent chunked (they have no body, RFC 9112 6.3) - MjpegStream errors are in the page's language (the stream ran outside the request's language scope) - the scoped-task foreground check matches `Route` like the other dispatch sites - a page's native video connection that closes while it waits for the next media stream (an unlock holds the device for seconds) no longer opens the stream again for nobody - the viewer lets its port go before stopping the agents - media.rs's comment and the changelog no longer say unwatched frames aren't assembled: they are depacketized and scanned, only not copied or queued - CONTRIBUTING's per-package fmt list includes ictl-ax, as CI does - the Unreleased changelog: PR numbers on every line, the iOS 17-18 disk image fix (#186), sections and wording per CONTRIBUTING Not changed: a TTL in front of the token file's stat (microseconds per request; a revoked token would keep working for the TTL). Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 25, 2026
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 and why
Phase 0 code fixes from the architecture review of 0.2.14 (high and medium findings):
device.is_some() && wda_bundle.is_some(), and the daily Apple ID session check nothing at all.wda_bundleis global, so a phone driven natively (iOS 27+) went on checking its provisioning profile, re-signing, and checking the Apple ID session (with a "session expired" warning) once another device had used WDA. Now both are skipped while the device in use is driven natively, and the round doesn't count, so after switching to a WDA device the check runs at the next tick (wda_upkeep). With no phone connected the session check still runs if WDA was ever installed.Content-Lengthis checked before reserving; the read loop is nowread_response), DTX messages 64 MB over all fragments, read as they come instead of allocating what the header claims, HEVC frames 8 MB (dropped whole, a keyframe asked for).HidSession::held_dragrecords the contact, so closing the session lifts the finger if the drag fails or times out.install_appclears the app cache once;LogFilterlowercasesgreponce instead of per entry; native screenshots say "via CoreDevice" (WDA-down fallback still "via HID");native_terminatedrops the killed pids from the frontmost-app cache;serve_mjpegkeeps theArcit sends; viewer auth:failed()checks and counts under one lock, tokens are written through a temporary file of their own.Not changed from the review, on purpose:
TerminateAppstays outside a task's app scope (quitting an app is how an agent gets back after the user says no,tasks.rs), andring::constant_time::verify_slices_are_equalis deprecated in ring 0.17.14 ("no promises regarding side channels"), so the hand-written comparison stays.Tests
1. Unit tests
cargo clippy --workspace --all-targets --all-features --locked -- -D warnings,cargo test --workspace --all-features --locked: 539 passedwda_upkeep_is_only_for_devices_that_use_wda,oversized_responses_are_refused,the_whole_message_is_limited_not_each_fragment,unwatched_frames_keep_only_the_parameter_sets,oversized_frames_are_dropped#[ignore]tests of the changed area: none apply2. Real-device regression
lockscenario was also run on this branch alone (see below)tests/device/run.py: iPhone 3 rounds, 48 calls, 0 failed; iPad 15 rounds, 240 calls, 0 failedtests/device/scenarios.py: iPhonetools typing delivery collect editing fresh batch menu idle url64/64 andlock13/13; iPadtools typing delivery collect editing fresh batch menu url60/60main(run.py --repeat,compare.py): iPad 23.71 s → 24.01 s total, no step clearly slower; iPhone 17.09 s → 18.21 s,iphone_statusandiphone_wait_forflagged slower on medians of 3, butmain's own rounds range over the same values (status 0.02–0.29 s, wait_for 0.23–0.57 s)scenarios.py --lock lock: 3 runs, 39/39On the iPad,
scenarios.py --lock locknow and then fails one lock: the IOHID power press takes 5.4 s instead of 0.4 s (XCTest waiting for the app to go idle) and the screen stays on. It happens in stretches and onmaintoo: in the same hourmainpassed 7 runs and failed 1 the same way. Not caused by this change; noted in the regression notes for later.run.py output
3. Regression cases (docs/dev/regression-cases.md)
scenarios.pyas above4. Real-device proof of the fix or feature
run.py); WDA screenshots unchangedheld_dragfailing halfway, the native-phone upkeep (would take a day of waiting for the session check); covered by unit tests and code reviewChecklist
🤖 Generated with Claude Code