Skip to content

fix: treat only home-action skills as launcher abilities - #6

Open
tonycoder-hub wants to merge 1 commit into
masterfrom
cursor/fix-launcher-ability-check-aadd
Open

fix: treat only home-action skills as launcher abilities#6
tonycoder-hub wants to merge 1 commit into
masterfrom
cursor/fix-launcher-ability-check-aadd

Conversation

@tonycoder-hub

Copy link
Copy Markdown
Owner

Problem

get_app_abilities() decides isLauncherAbility with:

if len(skills) > 0 or "action.system.home" in skills[0]["actions"]:

Two bugs:

  • or marks every ability with a non-empty skills list as a launcher.
  • Empty skills evaluates skills[0]IndexError → the ability is silently skipped.

That list feeds get_app_main_ability() / start_app() when page_name is omitted, so the wrong ability can be chosen.

Fix

if len(skills) > 0 and "action.system.home" in (skills[0].get("actions") or []):

Only the home action is treated as a launcher. Empty or missing actions is safe.

Tests

Device-free unit tests in tests/test_app_abilities.py use a fixture bm dump JSON covering:

  • empty skills — ability is kept, isLauncherAbility is false
  • skills without action.system.home — not a launcher
  • skills with action.system.home — launcher, and get_app_main_ability() prefers it
pytest tests/test_app_abilities.py

No Harmony device required.

Open in Web Open in Cursor 

get_app_abilities used `or`, so any non-empty skills list was marked
launcher. Empty skills hit skills[0] and the ability was dropped.
Use `and` and guard missing or empty actions.

Signed-off-by: Tony Coder <407243179@qq.com>
@tonycoder-hub
tonycoder-hub marked this pull request as ready for review August 21, 2026 00:31
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.

1 participant