发布

  • feat(skills): pre_execute hook opens the onboarding menu before any model step (#6127)

    frostbyte_neo 发布于 2026-09-09 00:19:45 +00:00

    • feat(skills): pre_execute hook opens the onboarding menu before any model step

    Interactive startup used to autosubmit a prose prompt ("Load the
    onboarding-cicd-fix skill with skill_view and follow it"), which painted a
    /goal work-turn marker, a synthetic [1] user row, two model narration lines
    and a "Skill activated" tree, and cost two LLM round-trips before the static
    Ask User menu appeared.

    Skills can now declare pre_execute: static tool calls ({tool, args})
    run when the skill is entered, before the model. A new entry point,
    tools/interactive_shell/actions/skill_entry.enter_skill, activates the
    skill on the session and runs the hooks through the real tool executors
    (allowlisted to ask_user_choice). skill_view delegates to it, so a
    mid-session load also opens the menu in one step; with_menu_turn_end
    terminates a skill_view that queued a menu. Startup and /demo call
    enter_skill host-side, so the menu is the first thing painted and the
    first model turn is the user's answer. The master skill body keeps
    "Follow the selected child" for the model.

    Tests pin the boot output contract (zero LLM calls, no /goal or skill
    chrome, picker receives the skill-declared menu), the mid-session
    skill_view path, allowlist refusal, and loader parsing. Drops a stale
    assertion for the deleted github-ci-fix-onboarding skill.

    Co-authored-by: Cursor cursoragent@cursor.com

    • fix(skills): validate pre_execute hook args with the tool's public schema

    Hooks now go through RegisteredTool.validate_public_input before the
    executor runs, the same gate core.tool.execution applies to a model call,
    so skill frontmatter cannot get a looser argument contract than the model.
    Adds a regression test for a rejected payload.

    Co-authored-by: Cursor cursoragent@cursor.com

    • test(skills): keep skill_entry unit tests with tools/, move the shell journey next to the others

    tests/tools/interactive_shell/ is the existing home for tools/interactive_shell
    modules (test_session_goal_action.py, test_action_names.py). The one test
    that drives the surface's run_action_tool_turn now sits with the other
    onboarding journeys in tests/interactive_shell/runtime/test_demo_picker.py.

    Co-authored-by: Cursor cursoragent@cursor.com


    Co-authored-by: Cursor cursoragent@cursor.com

    下载附件