Fix: Pop/Abort/Complete action handling to avoid invalid ADB execution
#33
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.
摘要
此 PR 修复了
copilot_front_end/mobile_action_helper.py,使前端动作类型Pop、Abort和Complete不再发生贯穿(fall through)并尝试执行不完整的adb命令。问题
此前,
act_on_device()对这些动作类型仅使用pass处理,随后仍会继续进入公共执行逻辑并运行subprocess.run(adb_command, ...)。此时adb_command可能仅为adb/adb -s <device>(没有子命令),从而导致静默失败并引发令人困惑的行为。变更
Pop:提前返回(可选记录日志),不执行设备命令。Abort:提前返回,并在可用时记录abort_reason。Complete:提前返回(可选记录日志),不执行设备命令。.gitignore中忽略__pycache__/,避免本地运行时产生意外的未跟踪噪音文件。测试
python -c "import copilot_front_end.mobile_action_helper as m; print('ok')"