Skill library default ./library + direct execution without explicit opt-in
还没有人认领这个 Issue。
评估
调研方向
Start with argument parsing in src/webwright/skill_factory/route.py and direct execution in src/webwright/skill_factory/execute.py; compare the default-library behavior with the warning in src/webwright/tools/skill_use.py. Trace how a resolved skill.py is launched, then define the confirmation and library-location behavior against the suggested fix. Done means cwd is no longer the implicit default and first use of an unconfirmed library requires an explicit opt-in.
由索引模型根据 Issue 内容生成。
描述
The skill-library commands resolve their library to ./library relative to the current working directory when SKILL_LIBRARY_ROOT is unset, and route executes what it finds there directly — no model in the loop, no confirmation step. Library entries are executable programs by design (skill.py files the project's own docs describe as shareable, committable artifacts), so the cwd default means "run the programs sitting next to wherever I happen to be standing".
Current code (main)
-
src/webwright/skill_factory/route.py:166-167:p.add_argument("--library", default=os.environ.get("SKILL_LIBRARY_ROOT", "library"), help="Path to the skill library (default: $SKILL_LIBRARY_ROOT or ./library).")libraryhere is a bare relative path, so it resolves against the process cwd. -
src/webwright/skill_factory/execute.py:1,23-56— the module's own docstring: "Direct execution: run an executable skill on filled params, no agent, no model."run_skillruns the resolvedskill.pyviasubprocess.run([sys.executable, str(skill.resolve()), "taskspec.json"], ...)with no approval or trust prompt anywhere. -
src/webwright/tools/skill_use.py:60-67warns when a relative library path resolves to nothing — the missing-library case is handled loudly, but a./librarythat does exist in the cwd loads silently.
The footgun
Running python -m webwright.skill_factory.route "<task>" from a directory that merely contains a library/ folder — a cloned repo, an unpacked archive, a shared drive mount — loads and executes whatever skill.py files are in it, at the user's privilege, with no signal beyond the decision line the command prints. The intent is surely "my library, learned in earlier runs" (the examples ship --library "$WORKSPACE_DIR/../library" for exactly that). But an absolute or user-level default plus an explicit --library for "run a library from this directory" would keep the convenience while making "execute third-party programs" an affirmative act rather than a side effect of cwd.
This is a hardening request, not a bug report: sharing libraries is a designed feature, and a user who passes --library <someone else's dir> has asked for it. The gap is only the default — discovery by cwd plus zero-confirmation execution of whatever is discovered.
Suggested fix
- Default the library root to a user-level location (
$SKILL_LIBRARY_ROOT, else something like~/.webwright/library), never cwd; the shipped example invocations that pass--libraryexplicitly are unaffected. - On first execution against a library not seen before, print the resolved absolute path and require an explicit flag (
--yesor an interactive confirm) — a one-time opt-in per library. - Optionally record known libraries (path + a hash of their contents) so re-running a previously confirmed library stays frictionless while a changed or new one re-prompts.
- 主要语言
- Python
- 星标
- 6k
- 派生
- 385
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/Webwright 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 88/100
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 1/5 1 小时以内 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 72/100
-
难度 4/5 3-5 天 新手友好度 35/100
查看 microsoft/Webwright 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
stephrobert/dsoxlab#238 ·
-
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 75/100
sublimehq/package_control#1780 ·
-
难度 2/5 1-3 小时 新手友好度 65/100
-
难度 2/5 1-3 小时 新手友好度 70/100
nwg-piotr/nwg-displays#145 ·