Skip to content

B-02: poll the screen generation instead of fixed loading sleeps - #60

Merged
austinintelligence merged 8 commits into
claude/friendly-dirac-embe85from
claude/b-02-generation-polling
Oct 15, 2026
Merged

austinintelligence merged 8 commits into
claude/friendly-dirac-embe85from
claude/b-02-generation-polling

Conversation

@austinintelligence

@austinintelligence austinintelligence commented Oct 15, 2026 •

Copy link
Copy Markdown
Owner

What changed

After an action, present.rs after_action polls the helper's screen generation (the cheap status query) every 40 ms and reads rows only when the generation moves. It replaces the 3 × 500 ms sleeps while a screen is empty or "Loading", keeping the same 1.5 s overall cap. A tap that left the generation unchanged now waits up to 600 ms for a late change before reporting.

Why

Fixed sleeps made every late-loading screen cost a full 500 ms step. Polling reports the screen as soon as it is ready, which aims at the 1.3.0 tap p50/p95 gate (600/1,500 ms) and at no misses on the three late-loading Settings tasks.

Tests in computer/src/agent_tests.rs:

  • a_loading_screen_is_reported_when_it_finishes_not_after_a_fixed_sleep: a screen that finishes loading 120 ms after it is first read is reported in 120–450 ms. With a 500 ms poll it fails.
  • a_tap_whose_change_lands_late_is_reported_as_changed: a tap whose change lands at 400 ms is reported as changed.

Known limits

  • An action that changes nothing now costs up to 600 ms more (the specified late-change wait). The helper's own settle has already waited before that.
  • The helper counts TYPE_VIEW_CLICKED as a change, so on a device a real tap usually moves the generation at once and the 600 ms wait rarely runs. The late-change test models a tap that does not move the generation. Whether it pays off needs an emulator run.

Safety and compatibility

  • No device-specific serials, tokens, private paths, media, or signing material are included.
  • No new way for an agent to run a shell, adb, or page JavaScript; command forms are unchanged.
  • Destructive/privacy-sensitive behavior has explicit confirmation coverage. (Not touched.)
  • Temporary files, processes, emulators, and device state have cleanup coverage. (Not touched.)

Verification

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo test --workspace --all-targets
  • cargo xtask check and cargo xtask docs
  • npm test and npm run lint (not run)

Gradle and device/emulator checks were not run: this container has no Android SDK and no device. The p50/p95 effect still needs an emulator run.

Release impact

  • No breaking change.
  • Breaking change documented in the changelog and migration guidance.

Base is claude/friendly-dirac-embe85 (A-01, PR #55); retarget to main once it merges.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VBuuDWN89yt1W59QT8aHLo

After an action, poll the helper's status generation every 40 ms and read rows
only when it moves, up to the old 1.5 s cap, and give a tap that changed
nothing 600 ms for a late change.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VBuuDWN89yt1W59QT8aHLo
Copilot AI balanced review requested due to automatic review settings October 15, 2026 09:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7451af96-2a25-4366-9c4e-688818164823

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

This reverts commit a5f0438.
…ext and starts its timer at the first read

The fake helper reported every row as a button, so a Loading screen was never
recognised and the test passed only because the screen had settled before the
first read (and failed on a faster runner). The window is now 120-450 ms.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VBuuDWN89yt1W59QT8aHLo
…ot by wall time

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VBuuDWN89yt1W59QT8aHLo
… train

agent_tests.rs: B-10 turned fake_helper into a FakeLink closure; B-02's delayed-screen state (later, unread) now lives in that closure and is checked at the start of each request. Gates and helper javac pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZLaa2TojSgBwyk35cJjco
@austinintelligence
austinintelligence merged commit 3382bdf into claude/friendly-dirac-embe85 Oct 15, 2026
7 checks passed
austinintelligence added a commit that referenced this pull request Oct 15, 2026
A-01 budgets and fail-closed gates, with these merged into it in dependency order: B-10 #65, B-01 #62, A-20 #76, A-21 #61, A-09 #56, A-07 #68, A-04 #63, A-10 #59, A-11 #72, A-12 #57, A-13 #73, A-17 #58, A-18 #67, A-19 #70, B-11 #69, A-15 #64, B-02 #60, B-03 #71, B-05 #74, B-04 #75, B-06 #77, B-07 #78, B-13 #82, A-14 #86, A-16 #84, B-08 #87, B-09 #88, A-02 #79, A-03 #80, A-05 #83, A-06 #81, A-08 #85, B-12 #66.

All checks green on Linux, macOS and Windows (Rust, helper build and format, installer, package smoke, CodeQL, dependency audit).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NZLaa2TojSgBwyk35cJjco
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants