Skip to content

feat(skills-manager): confirm destructive actions before applying#75

Merged
Fu-Jie merged 3 commits into
Fu-Jie:mainfrom
lionelvoser:feat/confirm-destructive-skill-actions
May 19, 2026
Merged

feat(skills-manager): confirm destructive actions before applying#75
Fu-Jie merged 3 commits into
Fu-Jie:mainfrom
lionelvoser:feat/confirm-destructive-skill-actions

Conversation

@lionelvoser
Copy link
Copy Markdown
Contributor

Hi! I had to add this confirmation dialog on our end to avoid mistakes — opening this PR in case it would be valuable to the tool as well.

Summary

  • Adds a REQUIRE_CONFIRMATION valve (default true) to openwebui-skills-manager that prompts the user via __event_call__ before update_skill, delete_skill, and the overwrite paths in create_skill / install_skill.
  • On cancellation, tools return a structured {cancelled: true, ...} result and emit a localized status; when no interactive event channel is available, callers get a clear error pointing them to the new valve.
  • Translates all new prompt / status / error strings across the 12 supported locales and bumps the plugin version to 0.3.3.

@lionelvoser
Copy link
Copy Markdown
Contributor Author

This is what would be displayed to the user before updating a Skill (similar for deleting and overwriting):

grafik

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

此拉取请求为技能管理工具引入了破坏性操作(如更新、删除及覆盖技能)的确认机制。主要改动包括新增 REQUIRE_CONFIRMATION 阀门配置、扩展多语言翻译支持,以及在核心逻辑中集成 __event_call__ 交互提示。审阅反馈指出,应在 _request_confirmation 函数中采用 _call_openwebui_compat 包装器来执行事件调用,以增强对同步回调的兼容性并维持项目的异步 I/O 标准。

Comment on lines +797 to +802
result = await event_call(
{
"type": "confirmation",
"data": {"title": title, "message": message},
}
)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

To ensure robust compatibility and adherence to the project's async I/O pattern, _request_confirmation should use _call_openwebui_compat instead of calling event_call directly. This prevents potential TypeError exceptions if event_call is a synchronous function.

result = await _call_openwebui_compat(
    event_call,
    {
        "type": "confirmation",
        "data": {"title": title, "message": message},
    }
)

@Fu-Jie
Copy link
Copy Markdown
Owner

Fu-Jie commented May 19, 2026

@lionelvoser

Thanks for the contribution. After addressing the review note about wrapping the confirmation event call with _call_openwebui_compat, you can also use an agent skill to finish the repo-specific release surfaces for this PR.

In this repository, the recommended helper is .github/skills/release-prep/SKILL.md.

If you are using a Copilot-style agent, you can ask it to use or reference release-prep for openwebui-skills-manager v0.3.3 before updating the PR. That skill is intended to help with the remaining release-prep work for versioned plugin changes, including:

  • syncing the versioned documentation surfaces
  • updating bilingual README/docs files where needed
  • preparing bilingual release notes files
  • running python3 scripts/check_version_consistency.py
  • drafting the final Conventional Commit message

That should make it easier to bring the PR in line with this repo's release requirements before the next push.

@lionelvoser
Copy link
Copy Markdown
Contributor Author

@Fu-Jie thanks for the review! Pushed 4daf568 with the requested follow-ups:

  • Wrapped the confirmation event_call through _call_openwebui_compat in _request_confirmation per the review note.
  • Ran the release-prep flow for v0.3.3:
    • Synced version across openwebui_skills_manager.py, README.md / README_CN.md, docs/plugins/tools/openwebui-skills-manager{,-tool}.{md,zh.md}, docs/plugins/tools/index{,.zh}.md, and both root README plugin-list badges (date bumped to 2026-05-19).
    • Added bilingual release notes v0.3.3.md / v0.3.3_CN.md.
    • Updated the What's New / 最新更新 blocks in plugin + docs README pairs.
    • Documented the new REQUIRE_CONFIRMATION valve in README_CN.md (it was only in the EN README before).
  • python3 scripts/check_version_consistency.py reports All versions are consistent! ✨ (the script currently scans actions/filters/pipes only, so the tools-tree updates were verified manually).

One CI note: the check-versions workflow failed on the previous run while trying to POST a comment to this PR (HTTP 403 — Resource not accessible by integration). The version-extraction step itself passed and detected v0.3.2 → v0.3.3 correctly; the failure is the actions/github-script step needing pull-requests: write on cross-fork PRs. Flagging in case it's useful for tuning the workflow permission for forked-PR runs.

Copy link
Copy Markdown
Owner

@Fu-Jie Fu-Jie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review complete. All 13 files verified. i18n completeness check passed (12 locales). Fixed one security regression in _request_confirmation: replaced bool(result) with a strict isinstance(result, bool) guard so error objects returned on channel disconnect can no longer bypass REQUIRE_CONFIRMATION and allow destructive operations to proceed silently.

@Fu-Jie Fu-Jie closed this in 802afc1 May 19, 2026
@Fu-Jie Fu-Jie reopened this May 19, 2026
nenebale and others added 3 commits May 20, 2026 06:35
Adds a REQUIRE_CONFIRMATION valve (default true) that prompts users via
__event_call__ before update_skill, delete_skill, and overwrite paths in
create_skill/install_skill. Cancellations return structured results and
emit localized status messages; bumps version to 0.3.3 and adds the new
strings across all supported locales.
- Route _request_confirmation through _call_openwebui_compat for consistency with other OpenWebUI integration calls.
- Sync v0.3.3 across plugin/docs READMEs, docs mirror pages, and root plugin-list badges; bump root updated date to 2026-05-19.
- Update What's New blocks in plugin and docs READMEs (EN/CN) and add bilingual v0.3.3 release notes.
- Document REQUIRE_CONFIRMATION valve in README_CN.md.
…event bypass on channel error

When __event_call__ returns a non-bool truthy value (e.g. an error dict on
session disconnect), bool(result) was True, which bypassed REQUIRE_CONFIRMATION
and continued executing destructive operations (update, delete, overwrite).

Replace bool(result) with an isinstance(result, bool) check so that only an
explicit True/False from the confirmation dialog is trusted; any other return
is treated as unavailable (returns None) and the caller blocks the action.
@Fu-Jie Fu-Jie force-pushed the feat/confirm-destructive-skill-actions branch from 3942545 to 140b865 Compare May 19, 2026 22:36
@Fu-Jie Fu-Jie merged commit d0b1e8c into Fu-Jie:main May 19, 2026
Fu-Jie added a commit that referenced this pull request May 19, 2026
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.

3 participants