Skip to content

feat(okww): 优化专项配置与启动流程 - #341

Merged
1w1w11w1 merged 3 commits into
AUTO-MAS-Project:devfrom
1w1w11w1:codex/okww-launcher-integration
Aug 8, 2026
Merged

feat(okww): 优化专项配置与启动流程#341
1w1w11w1 merged 3 commits into
AUTO-MAS-Project:devfrom
1w1w11w1:codex/okww-launcher-integration

Conversation

@1w1w11w1

@1w1w11w1 1w1w11w1 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor
  • 收敛 MAS 侧 OK-WW 配置,仅接管日常任务与兼容所需固定项,并恢复简洁/详细配置所有权及本体设置入口。
  • 增加 OK-WW、官方启动器与 WeGame 一键导入;导入启动器时解码并隐藏保存游戏进程路径,运行时直接启动游戏本体。
  • 支持 China/Global 资源切换、默认设置初始化和缺失配置拦截,并预留基于 OK-WW 日志判断游戏更新的接口。
  • 修正附加任务控件映射、任务序号兼容及无效路径下的用户编辑拦截。

@sourcery-ai

sourcery-ai Bot commented Aug 7, 2026

Copy link
Copy Markdown

审阅者指南(Reviewer's Guide)

通过此次重构,将 OK-WW 集成中的配置所有权重新交回 OK-WW 本身,同时在 MAS 端增加防护措施和“一键导入”能力,并简化 MAS 端对用户日常任务、资源选择以及基于启动器的游戏启动等选项的管理;同时移除了旧的应用内 JSON 编辑器 API。

新版 OK-WW 脚本配置会话的序列图

sequenceDiagram
    actor User
    participant ScriptTable as ScriptTable.vue
    participant ScriptsView as Scripts.vue
    participant WebSocket as useWebSocket
    participant Service as Service
    participant Manager as OkwwManager.main_task
    participant ScriptConfig as ScriptConfigTask
    participant OkwwApp as ok-ww.exe

    User->>ScriptTable: click handleStartOkwwConfig
    ScriptTable->>ScriptsView: emit startOkwwConfig
    ScriptsView->>ScriptsView: handleStartOkwwConfig
    ScriptsView->>Service: addTaskApiDispatchStartPost
    Service-->>ScriptsView: { code:200, taskId }
    ScriptsView->>WebSocket: subscribe({ id: taskId })
    ScriptsView->>ScriptsView: showOkwwConfigMask = true

    Service->>Manager: dispatch task (mode=SCRIPT_CONFIG)
    Manager->>ScriptConfig: spawn ScriptConfigTask.main_task
    ScriptConfig->>ScriptConfig: _kill_processes
    ScriptConfig->>ScriptConfig: _configure_okww_launcher
    ScriptConfig->>ScriptConfig: copy mas_config_dir -> script_config_path
    ScriptConfig->>OkwwApp: ProcessManager.open_process

    WebSocket-->>ScriptsView: Signal { Accomplish? }
    alt [user clicks 保存设置]
        User->>ScriptsView: handleSaveOkwwConfig
        ScriptsView->>Service: stopTaskApiDispatchStopPost
        Service-->>ScriptsView: { code:200 }
        ScriptsView->>WebSocket: unsubscribe(subscriptionId)
    end

    Service->>ScriptConfig: request stop
    ScriptConfig->>ScriptConfig: final_task
    ScriptConfig->>ScriptConfig: _configure_okww_launcher
    ScriptConfig->>ScriptConfig: _update_json BasicOptions
    ScriptConfig->>ScriptConfig: copy script_config_path -> mas_config_dir
    ScriptConfig->>Manager: finish
    ScriptsView->>ScriptsView: clearOkwwConfigSession
Loading

文件级变更

Change Details Files
重新设计 OK-WW 用户编辑界面,通过脚本控制的会话驱动配置,而不是内嵌 JSON 编辑器,并新增按用户维度的任务/刷资源选项,这些选项映射到后端配置字段。
  • 在 OkwwUserEdit 中新增工具栏按钮和全屏遮罩,用于通过基于 WebSocket 的派发任务启动并监控 OK-WW 配置会话,包含保存/终止流程。
  • 引入 Info.Mode 选择器(简洁/详细)、国服/国际服资源选择器,以及新的 Task farming/AdditionalTasks 控件,这些控件绑定到扩展后的 OkwwUserConfig 字段,并通过 updateUser 持久化。
  • 移除 OkwwConfigEditor 组件,改为远程 OK-WW 配置;新增更严格的 TaskIndex 校验,并自动纠正到受支持的索引。
frontend/src/views/EditView/User/OkwwUserEdit.vue
frontend/src/api/models/OkwwUserConfig_Task.ts
frontend/src/api/models/OkwwUserConfig_Info.ts
frontend/src/composables/useUserApi.ts
frontend/src/api/models/OkwwUserConfig_Task.ts
在后端集中管理 OK-WW 配置初始化以及不同模式(简洁/详细)下的配置所有权,确保在创建用户或执行任务前,从脚本安装目录复制默认配置并完成校验。
  • 新增 Config.ensure_okww_user_config,用于根据所有者(默认或用户 ID)推导 MAS 配置目录,从 ok-ww working/configs 中校验/初始化配置,并在 add_user 和 AutoProxyTask.check 中使用。
  • 修改 add_user API,当缺失 OK-WW 默认配置时,以可操作的信息形式返回 409 错误,并更新前端 addUser 流程,通过 Modal 指引进行处理。
  • 统一 OkwwUserConfig 校验器和模式类型,限制 Resource 仅为 官服/国际服,将 Mode 默认设为 简洁,并将 TaskIndex 限制在支持的日常任务索引范围内,同时提供向后兼容的自动修正。
app/core/config.py
app/api/scripts.py
app/models/config.py
app/models/schema.py
frontend/src/composables/useUserApi.ts
frontend/src/api/models/OkwwUserConfig_Task.ts
frontend/src/api/models/OkwwUserConfig_Info.ts
tests/test_okww_user_config_init.py
加强 AutoProxy OK-WW 任务运行器的能力:管理启动器配置、应用 MAS 端对日常任务的覆盖,并基于解码后的客户端路径,而非用户指定的可执行文件,来启动和跟踪游戏。
  • 新增辅助函数,用于更新 OK-WW app.json(auto_start、profile、update_method),向 DailyTask/Basic Options JSON 注入 MAS 覆盖项,并按用户/模式计算 MAS 配置目录。
  • 调整游戏 Path 语义为启动器 Path,并通过 wuthering_waves 服务解码得到 Game.ProcessPath,同时更新 _mas_launch_game_before_task/_kill_game_process,以基于进程信息启动/跟踪/结束客户端。
  • 新增钩子,以从 OK-WW 日志中检测待更新的游戏版本,在每次运行前重置 script_info.log,并移除 OK-WW 配置向 MAS 回写的逻辑,因为现在由 OK-WW 拥有配置文件。
  • 新增测试,覆盖启动器配置、MAS 覆盖应用、游戏进程启动/终止以及基于日志的更新检测。
app/task/Okww/AutoProxy.py
app/services/wuthering_waves.py
app/models/config.py
app/models/schema.py
tests/test_okww_launcher_config.py
tests/test_okww_game_launch.py
新增专用的 ScriptConfig 任务模式以及脚本列表/UX 工作流,用于从 MAS 启动 OK-WW 进行配置(全局或按用户),并通过 WebSocket 管理其生命周期。
  • 扩展 Okww manager 以支持 ScriptConfig 模式,包括路径/用户校验、临时配置的保留,以及在此模式下改为启动新的 ScriptConfigTask 而非 AutoProxy。
  • 实现 ScriptConfigTask,用于终止现有 OK-WW 进程,在 MAS 与 OK-WW 之间同步配置,并在会话结束时将更新后的配置持久化回对应的 MAS ConfigFile 所有者。
  • 更新 Scripts 视图和 ScriptTable,增加“配置 ok-ww”操作及遮罩和保存流程;复用 WebSocket 订阅跟踪(activeConnections)以及 TaskCreateIn.mode.SCRIPT_CONFIG 以管理生命周期。
  • 确保在配置会话或 AutoProxy 运行结束后,清理 Temp 目录并恢复原始脚本配置。
app/task/Okww/manager.py
app/task/Okww/ScriptConfig.py
frontend/src/views/Scripts.vue
frontend/src/components/ScriptTable.vue
app/models/schema.py
在 Windows 平台上实现 OK-WW 安装路径和《鸣潮》启动器(官服 & WeGame)的自动发现,并将其接入 OkwwScriptEdit UI,作为“一键导入”操作。
  • 新增 okwwPathDiscoveryService,使用基于 PowerShell 的注册表快照、健壮的 JSON 解析以及启发式逻辑,根据卸载信息和 Kuro 启动器键定位 ok-ww、官方启动器和 WeGame 启动器。
  • 注册 IPC 处理器和 preload 绑定,以 okww-path-discovery 的形式向渲染进程的 ElectronAPI 暴露 discoverOkwwPath/discoverWutheringWavesPath。
  • 更新 OkwwScriptEdit,新增用于 OK-WW 根目录和游戏启动器路径的“一键导入”按钮,并通过 applyRootPathDefaults/saveGamePath 保存,提供乐观 UI 与出错回滚。
  • 简化手动游戏路径选择逻辑,仅在所选目录中查找 launcher.exe/wegame.exe,而不再进行深层路径启发式搜索;更新 schema 文案以描述启动器语义。
  • 新增针对注册表解析和路径提取辅助函数的单元测试。
  • files
frontend/electron/services/okwwPathDiscoveryService.ts
frontend/electron/ipc/okwwPathDiscoveryHandlers.ts
frontend/electron/preload.ts
frontend/electron/main.ts
frontend/src/types/electron.d.ts
frontend/src/views/EditView/Script/OkwwScriptEdit.vue
frontend/src/api/models/OkwwConfig_Game.ts
frontend/tests/okwwPathDiscoveryService.test.ts
移除已废弃的 OK-WW JSON 编辑器 API 和前端组件,这些功能现已由基于启动器的配置会话取代。
  • 删除服务端用于列出/更新 OK-WW 配置的端点及其对应生成的 TS 客户端/服务类型。
  • 移除 OkwwConfigEditor Vue 组件及其在 OkwwUserEdit 中的使用,减少 MAS 对 OK-WW JSON 文件的直接操作。
  • 精简 OpenAPI 导出,移除 OkwwService 及相关模型。
  • 确保剩余代码路径统一依赖 Config.ensure_okww_user_config 和 ScriptConfig 会话进行配置管理。
app/api/scripts.py
frontend/src/api/services/Service.ts
frontend/src/api/index.ts
frontend/src/api/services/OkwwService.ts
frontend/src/api/models/Body_batch_update_okww_configs_api_scripts_okww_configs_batch_update_post.ts
frontend/src/views/OkwwUserEdit/OkwwConfigEditor.vue
app/task/Okww/config_schema.py

提示与命令

与 Sourcery 交互

  • 触发新审查: 在拉取请求中评论 @sourcery-ai review
  • 继续讨论: 直接回复 Sourcery 的审查评论。
  • 从审查评论生成 GitHub issue: 在某条审查评论下回复,要求 Sourcery 基于该评论创建 issue。你也可以直接在该评论下回复 @sourcery-ai issue 来创建对应的 issue。
  • 生成拉取请求标题: 在拉取请求标题中任意位置写上 @sourcery-ai,即可随时生成标题。你也可以在拉取请求中评论 @sourcery-ai title 来(重新)生成标题。
  • 生成拉取请求摘要: 在拉取请求正文任意位置写上 @sourcery-ai summary,即可在指定位置生成 PR 摘要。你也可以在拉取请求中评论 @sourcery-ai summary 来(重新)生成摘要。
  • 生成审阅者指南: 在拉取请求中评论 @sourcery-ai guide,即可随时(重新)生成审阅者指南。
  • 一次性解决所有 Sourcery 评论: 在拉取请求中评论 @sourcery-ai resolve,即可将所有 Sourcery 评论标记为已解决。适用于你已经处理完所有评论且不想再看到它们的情况。
  • 撤销所有 Sourcery 审查: 在拉取请求中评论 @sourcery-ai dismiss,即可撤销所有现有的 Sourcery 审查。特别适合在你想从头开始一次新审查时使用——别忘了再评论 @sourcery-ai review 以触发新审查!

自定义你的使用体验

访问你的 控制台 以:

  • 启用或禁用审查功能,例如 Sourcery 生成的拉取请求摘要、审阅者指南等。
  • 更改审查语言。
  • 添加、移除或编辑自定义审查指令。
  • 调整其他审查设置。

获取帮助

Original review guide in English

Reviewer's Guide

Refactors OK-WW integration by moving configuration ownership back into OK-WW itself, adding MAS-side guardrails and one-click imports, and simplifying MAS-managed per-user options for daily tasks, resource selection, and launcher-based game startup while removing the old in-app JSON editor APIs.

Sequence diagram for the new OK-WW script configuration session

sequenceDiagram
    actor User
    participant ScriptTable as ScriptTable.vue
    participant ScriptsView as Scripts.vue
    participant WebSocket as useWebSocket
    participant Service as Service
    participant Manager as OkwwManager.main_task
    participant ScriptConfig as ScriptConfigTask
    participant OkwwApp as ok-ww.exe

    User->>ScriptTable: click handleStartOkwwConfig
    ScriptTable->>ScriptsView: emit startOkwwConfig
    ScriptsView->>ScriptsView: handleStartOkwwConfig
    ScriptsView->>Service: addTaskApiDispatchStartPost
    Service-->>ScriptsView: { code:200, taskId }
    ScriptsView->>WebSocket: subscribe({ id: taskId })
    ScriptsView->>ScriptsView: showOkwwConfigMask = true

    Service->>Manager: dispatch task (mode=SCRIPT_CONFIG)
    Manager->>ScriptConfig: spawn ScriptConfigTask.main_task
    ScriptConfig->>ScriptConfig: _kill_processes
    ScriptConfig->>ScriptConfig: _configure_okww_launcher
    ScriptConfig->>ScriptConfig: copy mas_config_dir -> script_config_path
    ScriptConfig->>OkwwApp: ProcessManager.open_process

    WebSocket-->>ScriptsView: Signal { Accomplish? }
    alt [user clicks 保存设置]
        User->>ScriptsView: handleSaveOkwwConfig
        ScriptsView->>Service: stopTaskApiDispatchStopPost
        Service-->>ScriptsView: { code:200 }
        ScriptsView->>WebSocket: unsubscribe(subscriptionId)
    end

    Service->>ScriptConfig: request stop
    ScriptConfig->>ScriptConfig: final_task
    ScriptConfig->>ScriptConfig: _configure_okww_launcher
    ScriptConfig->>ScriptConfig: _update_json BasicOptions
    ScriptConfig->>ScriptConfig: copy script_config_path -> mas_config_dir
    ScriptConfig->>Manager: finish
    ScriptsView->>ScriptsView: clearOkwwConfigSession
Loading

File-Level Changes

Change Details Files
Reworked OK-WW user edit UI to drive configuration via script-controlled sessions instead of an embedded JSON editor, and added per-user task/farming options mapped to backend config fields.
  • Added toolbar button and full-screen mask in OkwwUserEdit to start and monitor OK-WW configuration sessions via WebSocket-driven dispatch tasks, with save/terminate flow.
  • Introduced Info.Mode selector (简洁/详细), China/Global resource selector, and new Task farming/AdditionalTasks controls bound to expanded OkwwUserConfig fields and persisted via updateUser.
  • Removed OkwwConfigEditor component in favor of remote OK-WW configuration; added stricter TaskIndex validation and automatic correction to supported indices.
frontend/src/views/EditView/User/OkwwUserEdit.vue
frontend/src/api/models/OkwwUserConfig_Task.ts
frontend/src/api/models/OkwwUserConfig_Info.ts
frontend/src/composables/useUserApi.ts
frontend/src/api/models/OkwwUserConfig_Task.ts
Centralized OK-WW config initialization and per-mode (简洁/详细) ownership in backend, ensuring defaults are copied from the script installation and validated before user creation or task execution.
  • Added Config.ensure_okww_user_config to derive MAS config directories by owner (Default or user ID), validate/initialize from ok-ww working/configs, and used it in add_user and AutoProxyTask.check.
  • Changed add_user API to surface 409 errors with actionable messages when OK-WW defaults are missing, and updated frontend addUser flow to handle this with Modal guidance.
  • Aligned OkwwUserConfig validators and schema types to restrict Resource to 官服/国际服, default Mode to 简洁, and limit TaskIndex to supported daily-task indices with backward-compatible correction.
app/core/config.py
app/api/scripts.py
app/models/config.py
app/models/schema.py
frontend/src/composables/useUserApi.ts
frontend/src/api/models/OkwwUserConfig_Task.ts
frontend/src/api/models/OkwwUserConfig_Info.ts
tests/test_okww_user_config_init.py
Enhanced AutoProxy OK-WW task runner to manage launcher configuration, apply MAS-side overrides for daily tasks, and launch/track the game using decoded client paths instead of user-specified executables.
  • Added helpers to update OK-WW app.json (auto_start, profile, update_method), inject MAS overrides into DailyTask/Basic Options JSON, and compute MAS config directories per user/mode.
  • Switched game Path semantics to launcher Path plus derived Game.ProcessPath (decoded via wuthering_waves service), and updated _mas_launch_game_before_task/_kill_game_process to start/track/kill the client by process info.
  • Introduced hooks to detect pending game updates from OK-WW logs, reset script_info.log before runs, and removed back-propagation of OK-WW configs to MAS now that OK-WW owns config files.
  • Added tests covering launcher configuration, MAS override application, game process launch/kill, and log-based update detection.
app/task/Okww/AutoProxy.py
app/services/wuthering_waves.py
app/models/config.py
app/models/schema.py
tests/test_okww_launcher_config.py
tests/test_okww_game_launch.py
Added a dedicated ScriptConfig task mode and scripts table/UX workflow to launch OK-WW for configuration (global or per-user) from MAS, with WebSocket-backed lifecycle management.
  • Extended Okww manager to support ScriptConfig mode, including path/user validation, temp-config preservation, and spawning the new ScriptConfigTask in place of AutoProxy.
  • Implemented ScriptConfigTask to kill existing OK-WW processes, sync configs between MAS and OK-WW, and persist updated configs back to the appropriate MAS ConfigFile owner when the session ends.
  • Updated Scripts view and ScriptTable to expose "配置 ok-ww" actions with an overlay mask and save flow; reused WebSocket subscription tracking (activeConnections) and TaskCreateIn.mode.SCRIPT_CONFIG for lifecycle.
  • Ensured Temp directories are cleaned and original script configs restored after configuration sessions or AutoProxy runs.
app/task/Okww/manager.py
app/task/Okww/ScriptConfig.py
frontend/src/views/Scripts.vue
frontend/src/components/ScriptTable.vue
app/models/schema.py
Implemented Windows-only discovery of OK-WW install paths and Wuthering Waves launchers (official & WeGame), wiring them into the OkwwScriptEdit UI as one-click import actions.
  • Added okwwPathDiscoveryService with PowerShell-based registry snapshotting, robust JSON parsing, and heuristics to locate ok-ww, official launchers, and WeGame launchers based on uninstall and kuro launcher keys.
  • Registered IPC handlers and preload bindings for okww-path-discovery, exposing discoverOkwwPath/discoverWutheringWavesPath to the renderer ElectronAPI.
  • Updated OkwwScriptEdit to add "一键导入" buttons for OK-WW root and game launcher paths, saving them via applyRootPathDefaults/saveGamePath with optimistic UI and error rollback.
  • Simplified manual game path selection to look for launcher.exe/wegame.exe in the chosen directory instead of deep path heuristics; updated schema texts to describe launcher semantics.
  • Added unit tests for registry parsing and path extraction helpers.
  • files
frontend/electron/services/okwwPathDiscoveryService.ts
frontend/electron/ipc/okwwPathDiscoveryHandlers.ts
frontend/electron/preload.ts
frontend/electron/main.ts
frontend/src/types/electron.d.ts
frontend/src/views/EditView/Script/OkwwScriptEdit.vue
frontend/src/api/models/OkwwConfig_Game.ts
frontend/tests/okwwPathDiscoveryService.test.ts
Removed deprecated OK-WW JSON editor APIs and frontend components now superseded by launcher-driven configuration sessions.
  • Deleted server-side endpoints for listing/updating OK-WW configs and their corresponding generated TS client/service types.
  • Removed OkwwConfigEditor Vue component and its usage from OkwwUserEdit, reducing MAS's direct manipulation of OK-WW JSON files.
  • Trimmed OpenAPI export to drop OkwwService and related models.
  • Ensured remaining code paths now rely on Config.ensure_okww_user_config and ScriptConfig sessions for config management.
app/api/scripts.py
frontend/src/api/services/Service.ts
frontend/src/api/index.ts
frontend/src/api/services/OkwwService.ts
frontend/src/api/models/Body_batch_update_okww_configs_api_scripts_okww_configs_batch_update_post.ts
frontend/src/views/OkwwUserEdit/OkwwConfigEditor.vue
app/task/Okww/config_schema.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - 我在这里给出了一些整体性的反馈:

已修复的安全问题

  • Python 自带的 xml 标准库容易受到 XML 外部实体(XXE)攻击。这类攻击可能泄露机密数据,而“XML 炸弹”则可能导致拒绝服务。不要使用这个库来解析不受信任的输入。Python 官方文档推荐改用 defusedxml。(link)

  • OK-WW 的配置掩码 UI 现在在两个地方都有实现(OkwwUserEdit.vueScripts.vue),结构和样式都非常相似;建议抽取出一个共享组件(例如 OkwwConfigMask),以避免重复实现,并保持行为和文案的一致。

  • 多个 OK-WW 路径/布局常量在不同层被重复定义(例如 AutoProxy._OKWW_REL_APP_JSON / _OKWW_REL_CONFIG_DIRdata/apps/ok-ww/working/configs 等字符串字面量,以及 okwwPathDiscoveryService.ts 中的标记名称);将这些常量按运行环境(后端/前端)集中到单一模块中并复用,可以减少在 OK-WW 更新目录结构时出现静默破坏的风险。

面向 AI 代理的提示词
Please address the comments from this code review:

## Overall Comments
- The OK-WW config mask UI is now implemented twice (in `OkwwUserEdit.vue` and `Scripts.vue`) with very similar structure and styles; consider extracting a shared component (e.g. `OkwwConfigMask`) to avoid duplication and keep behavior and copy in sync.
- Several OK-WW path/layout constants are duplicated across layers (`AutoProxy._OKWW_REL_APP_JSON` / `_OKWW_REL_CONFIG_DIR` vs string literals like `data/apps/ok-ww/working/configs` and sentinel names in `okwwPathDiscoveryService.ts`); centralizing these in a single module per runtime (backend/frontend) and reusing them would reduce the risk of silent breakage when OK-WW updates its directory structure.

Sourcery 对开源项目免费使用——如果你觉得我们的评审有帮助,请考虑分享给更多人 ✨
请帮我变得更有用!请在每条评论上点击 👍 或 👎,我会利用这些反馈来改进之后给你的评审。
Original comment in English

Hey - I've left some high level feedback:

Fixed security issues:

  • The native Python xml library is vulnerable to XML External Entity (XXE) attacks. These attacks can leak confidential data and "XML bombs" can cause denial of service. Do not use this library to parse untrusted input. Instead the Python documentation recommends using defusedxml. (link)

  • The OK-WW config mask UI is now implemented twice (in OkwwUserEdit.vue and Scripts.vue) with very similar structure and styles; consider extracting a shared component (e.g. OkwwConfigMask) to avoid duplication and keep behavior and copy in sync.

  • Several OK-WW path/layout constants are duplicated across layers (AutoProxy._OKWW_REL_APP_JSON / _OKWW_REL_CONFIG_DIR vs string literals like data/apps/ok-ww/working/configs and sentinel names in okwwPathDiscoveryService.ts); centralizing these in a single module per runtime (backend/frontend) and reusing them would reduce the risk of silent breakage when OK-WW updates its directory structure.

Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The OK-WW config mask UI is now implemented twice (in `OkwwUserEdit.vue` and `Scripts.vue`) with very similar structure and styles; consider extracting a shared component (e.g. `OkwwConfigMask`) to avoid duplication and keep behavior and copy in sync.
- Several OK-WW path/layout constants are duplicated across layers (`AutoProxy._OKWW_REL_APP_JSON` / `_OKWW_REL_CONFIG_DIR` vs string literals like `data/apps/ok-ww/working/configs` and sentinel names in `okwwPathDiscoveryService.ts`); centralizing these in a single module per runtime (backend/frontend) and reusing them would reduce the risk of silent breakage when OK-WW updates its directory structure.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@1w1w11w1
1w1w11w1 merged commit 95bd2b2 into AUTO-MAS-Project:dev Aug 8, 2026
2 checks passed
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