Skip to content

fix(desktop): 信任已保存的工作流#23

Merged
earayu merged 1 commit into
mainfrom
codex/trust-local-workflows
May 28, 2026
Merged

fix(desktop): 信任已保存的工作流#23
earayu merged 1 commit into
mainfrom
codex/trust-local-workflows

Conversation

@earayu
Copy link
Copy Markdown
Collaborator

@earayu earayu commented May 28, 2026

背景

用户反馈自己的工作流仍会弹出“新工作流警告”。PR #22 处理的是内置工作流预置信任 hash 不匹配,这个 PR 补用户自己保存的工作流路径。

问题

saveRecipe() 保存成功后只写入 YAML 文件,不会把当前工作流内容写入 recipe_hashes。用户新建、编辑或导入后保存的工作流,第一次运行时仍会被当成未信任工作流。

根因

工作流信任记录只在用户确认警告弹窗时写入;保存动作本身没有记录当前工作流 hash。

方案

保存成功后调用 window.electron.recordRecipeHash(recipeToSave),把刚保存的工作流标记为已信任。记录失败只打印警告,不影响保存成功。

验收

  • pnpm -C ui/desktop exec eslint src/recipe/recipe_management.ts --max-warnings 0 --no-warn-ignored 通过
  • git diff --check 通过
  • pnpm -C ui/desktop run lint:check 未完整通过,原因是当前本地缺少公告生成文件:../../announcements/content../../announcements/index.json,与本 PR 改动无关

@earayu earayu merged commit 62d4e77 into main May 28, 2026
20 checks passed
@earayu earayu deleted the codex/trust-local-workflows branch May 28, 2026 07:15
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