Repository navigation
fix(agent-mode): allow configuration without Termux - #98
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configuration
📒 Files selected for processing (1)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (1)
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughAgent Mode readiness and setup now accept either a ready Termux or Alpine runtime. Authorization requirements remain in place. Onboarding, settings access, and localized messages reflect the runtime options. ChangesAgent Mode Runtime Readiness
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Medium Suggested reviewers: Merge Risk: ⚪ Minimal · up to Alpine-only users can reach Agent Mode through the Alpine runtime, and the updated messages are available in each inspected locale. No actionable merge-blocking issue was established. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to Alpine-only users gain access to Agent Mode while existing authorization requirements remain. No new authorization bypass was established, but immediate revocation and concurrent runtime-reset behavior are not fully proven. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 12 functions across 4 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
所有改动均由deepseek-v4.1-flash生成 |
Agent Mode gated its settings entry, composer toggle and onboarding step on Termux readiness, but nothing in the feature uses Termux: the virtual display, input injection and screenshot capture go through the Shizuku user service or a root app_process, and screenshots persist into the Alpine workspace. The TermuxBashTool injected into AgentModeController was never referenced. Relax every Agent Mode gate to accept any local runtime (Termux or Alpine), which matches Alpine being the default runtime, and drop the "uses the Termux bridge" copy that documented the wrong dependency. Fixes Zhou-Shilin#93
b9433bb to
d6f51c0
Compare
|
@Zhou-Shilin |

Fixes #93
Problem
Agent Mode could not be configured at all unless Termux was installed. The settings entry refused to open ("Complete Termux setup before configuring Agent Mode"), the chat composer toggle stayed disabled, and the follow-up onboarding skipped the authorization step — even with Shizuku already authorized and Alpine ready.
Root cause
termuxSetupState.isReadywas used as a proxy for "Agent Mode is configurable" in five places, but the feature does not use Termux:AgentModeControllerinjectsTermuxBashTooland never references it — the constructor property is the only occurrence in the file.agentmode/AetherAgentModeShizukuService.kt) or a rootapp_process; neither involves Termux.RuntimeWorkspaceFileBridge, which resolves the Alpine workspace path first.settings_agent_mode_unavailable_bodydocumented the opposite ("Agent Mode uses the Termux bridge for its workspace and screenshot flow"), which is why the gate looked intentional.Fix
Relax every Agent Mode gate to accept any local runtime (Termux or Alpine), consistent with Alpine being the default runtime:
AetherApp) and the selection guard inAetherViewModel.setComposerAgentModeSelected, which would otherwise silently reject the toggleAlso corrects the misleading copy in all three locales (en / zh-rCN / fa) and renames the two string keys that encoded the Termux assumption.
Root automatic setup is intentionally left Termux-gated:
RootSetupControllergenuinely probes Termux, and that path is unchanged.Verification
:shared:testDebugUnitTest,:app:testDebugUnitTestand:app:assembleDebugall pass.Summary by CodeRabbit