This repository was archived by the owner on Jul 29, 2026. It is now read-only.
Repository navigation
Shizuku hybrid power mode + Computer Use retry + sharper agent prompt - #2
Closed
jackspiece wants to merge 4 commits into
Closed
jackspiece wants to merge 4 commits into
jackspiece wants to merge 4 commits into
Conversation
added 4 commits
June 25, 2026 20:28
Device control (the "hand" layer): - New ShizukuControlState (baselib): persists a "prefer Shizuku control" toggle (mirrored with Flutter shared_preferences) and tracks, at runtime, which technique last drove the phone for a live UI indicator. - ShizukuCapabilityManager: add tap/swipe/longPress via shell-level `input`. - AndroidDeviceOperator: hybrid routing. When power mode is ON and Shizuku is granted, taps/long-press/text/keys go through Shizuku (reaches tougher surfaces); scrolling stays on Accessibility for smooth flings. Every action falls back to Accessibility on failure and reports the technique used. - ExecutionUIImpl: floating operation window now prefixes each step with a live badge (🛡 Shizuku / 👆 Accessibility) and clears it when the task ends. Reliability: - HttpController: retry Gemini Computer Use interactions on transient upstream failures (504/503/502/500/429/408 + network IO) with 0.8s/2s/4s backoff, rebuilding the request body each attempt. Covers both phone and browser CU. UI (Flutter, English-first): - scene_model_setting: existing Phone Computer Use card converted to bilingual (English for English users). New "Shizuku Control (Power Mode)" card with an On/Off master toggle (OFF = Accessibility only, ON = hybrid), live Shizuku grant status, grant button when needed, and a note about reboot re-activation and the in-task live indicator. Agent brain: - AgentSystemPrompt: sharper guidance for summoning/handing off to the on-device computer-use agent — one clear outcome-focused goal, context_apps_query + packageName first, one task per call, handle FINISHED/takeover, retry once on transient failure, don't micromanage taps. (EN + ZH.)
The on-screen status phrases shown while the agent controls the phone
("getting ready", "accepted the task", "Running", "you've taken over",
"Opening app...", "action complete") were hardcoded Chinese. Route them
through LocalizedText/AppLocaleManager so English users see English. The
live \u0001f6e1/\u0001f446 control-method badge was already English.
…er mode Shizuku 'input text' can't type non-ASCII, fires char-by-char keyevents that drop on stubborn fields, and reports success even when nothing lands in the box. Route typing through accessibility first (atomic, any unicode), Shizuku only as exception fallback. Power mode still uses Shizuku for taps/long-press/keys/scroll. Removed now-unused shizukuType helper.
Symptom: in power mode the CU agent kept re-tapping a text box instead of typing. Cause: raw Shizuku 'input tap' doesn't reliably focus EditTexts / raise the IME the way an accessibility gesture-tap does, so the model never sees focus in the next screenshot and loops. Make taps + long-press accessibility-first (proper down/up gesture = reliable focus), Shizuku only as a reach fallback when the accessibility gesture throws. Keys (HOME/BACK/ ENTER) stay Shizuku-preferred. Updated power-mode card description to match.
Owner
Author
|
Closing this inactive experiment because I am narrowing my public contribution work to maintained upstream areas. The branch remains available. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Shizuku hybrid power mode + Computer Use retry + sharper agent prompt
Stacked on top of #1 (base =
viktor/cu-hardening). Retarget tomainonce #1 merges.1. Shizuku "power mode" (hybrid control)
input, reaches tougher surfaces); scrolling stays on Accessibility for smoother flings.🛡 Shizuku/👆 Accessibilityso you can see, per action, which one is driving the phone.2. Computer Use retry
HttpController.postGeminiComputerUseInteractionnow retries transient upstream failures (504/503/502/500/429/408 + network IO) with 0.8s / 2s / 4s backoff. One 504 "deadline expired" no longer aborts the whole task. Covers both phone and browser CU.3. English UI
4. Sharper main-agent (Brain 1) prompt
context_apps_query+ packageName first, one task per call, handle FINISHED/takeover, retry once on transient failure, don't micromanage taps. (EN + ZH.)Notes
baselib/.../shizuku/ShizukuControlState.kt.