Repository navigation
feat(daemon): say when the same action leaves the screen unchanged again - #145
Merged
Merged
Conversation
An agent stuck on a screen tends to repeat the same tap. Each time the answer is the same "the screen is the same as before the action, don't repeat it", so nothing tells it that this is already the third try. The daemon now remembers the last action as sent (its request JSON) and how many times in a row it left the screen unchanged. When the same request leaves it unchanged again, from the second time on the note adds "this exact action has now left the screen unchanged N times in a row: stop repeating it and try something else, or tell the user where it is stuck". Another action, other parameters or a changed screen start the count again; an action that couldn't be compared (nothing was looked at before it) neither counts nor resets. Regression case Derrors#150. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 17, 2026
Resolve the conflict in docs/dev/regression-cases.md: rows Derrors#146-Derrors#149 from main, then this branch's Derrors#150. The repeat test's Request::Tap gains the count field Derrors#141 added. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Derrors
added a commit
to cosinec/iphone-control
that referenced
this pull request
Nov 17, 2026
Bring in Derrors#145; keep both tests in tools/mod.rs and rows Derrors#150 then Derrors#151. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
An agent that is stuck on a screen tends to repeat the same tap. With
then(or after a screenshot), every answer ends with the same sentence, "but the screen is the same as before the action … don't repeat the same action", so nothing tells it that this is already the third or fourth identical try. Other phone agents add loop detection for this; here the daemon already compares the screen before and after each action, so it only needs to count.PerDevicegets a smallRepeats: the last action as sent (itsRequestJSON) and how many times in a row it left the screen unchanged.startis called wherebefore_actionis taken;settledis called bychange_notewith the comparison result.;这已经是连续第 N 次原样做这个操作、界面都没变:别再重复了,换个做法(…),还不行就告诉用户卡在了哪一步/; this exact action has now left the screen unchanged N times in a row: stop repeating it and try something else (…), or tell the user where it is stuck.before_action, and cleared with it.Nothing else changes: the first unchanged result reads exactly as before, and actions without
thenor without an earlier look get no note at all, as before (D10).Tests
1. Unit tests
cargo test --workspace --all-features --locked,cargo clippy --workspace --all-targets --all-features --locked -- -D warningsandcargo fmt --check(per package) pass (Rust 1.99.1, macOS)ictl-daemontools::tests::the_same_action_leaving_the_screen_unchanged_is_counted(same tap counted 1, 2, an uncomparable run in between counts nothing, 3; another point restarts; a changed screen resets; another action in between restarts; a settle without an action counts nothing; no text below 2)#[ignore]tests of the changed area run by hand: none apply2. Real-device regression
tests/device/run.pydefault steps pass on this branch (exit code 0): 16 calls, 0 failed, 16.2s in allrun.py output
3. Regression cases (docs/dev/regression-cases.md)
thenabove read as before4. Real-device proof of the fix or feature
Steps and results
Home screen, element list read once, then taps on an empty spot with
then=elements(the filter matches nothing, so only the note lines are shown).Checklist
Docs:
docs/tools.md(thethensection),CHANGELOG.md,CHANGELOG.zh-CN.md.🤖 Generated with Claude Code