Skip to content

fix(scheduler): 非自动代理模式不再显示用户下拉也不带 userId 启动 - #784

Open
ColinHouse wants to merge 2 commits into
AUTO-MAS-Project:devfrom
ColinHouse:fix/scheduler-user-select-auto-proxy-only
Open

ColinHouse wants to merge 2 commits into
AUTO-MAS-Project:devfrom
ColinHouse:fix/scheduler-user-select-auto-proxy-only

Conversation

@ColinHouse

@ColinHouse ColinHouse commented Sep 15, 2026

Copy link
Copy Markdown

摘要

  • 调度中心选了脚本任务的某个用户后,把模式切成「脚本设置」或「更新」再启动,每次都被后端拒绝(指定单个用户仅支持脚本的自动代理任务),而用户下拉仍然显示、所选用户仍然被带上
  • 用户下拉只在「自动代理」模式下显示;启动请求也只在自动代理模式下附带 userId(切回自动代理时之前的选择仍保留)
  • 这是 fix(scheduler): 调度中心选了用户后切到「脚本设置/更新」模式仍带 userId 启动,被后端拒绝 #750 里两种修法中的方案 1(前端收口,语义「非自动代理不能指定用户」);方案 2(在脚本设置 / 更新模式下把所选用户改传 taskId,让下拉变成「打开哪个用户的配置」)是功能层面的改动,如果更倾向那种,我可以改
  • 本地验证:yarn lint(oxlint,0 error / 0 warning)、yarn typecheck(vue-tsc,0 错误)、yarn test(Test Files 63 passed (63),Tests 578 passed (578))在改动前的 dev 与改动后均通过。本机没有可运行的 Electron 环境,未做真机点选,请合并前顺手点一下

Closes #750

🤖 Generated with Claude Code

Sourcery 摘要

错误修复:

  • 限制调度任务的用户选择和 userId 传递仅适用于自动代理模式,避免脚本设置或更新模式因携带用户信息被后端拒绝。
Original summary in English

Summary by Sourcery

Bug Fixes:

  • 限制调度任务的用户选择和 userId 传递仅适用于自动代理模式,避免脚本设置或更新模式因携带用户信息被后端拒绝。
Original summary in English

调度中心选了脚本任务的某个用户后切到「脚本设置」或「更新」,下拉仍显示、
请求仍带 userId,后端必然拒绝(指定单个用户仅支持自动代理)。用户下拉只在
自动代理模式显示;startTask 也只在自动代理模式附带 userId。这是 AUTO-MAS-Project#750 的
方案 1;方案 2(其他模式下改传 taskId=用户 UID)留作后续。

Closes AUTO-MAS-Project#750

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@sourcery-ai

sourcery-ai Bot commented Sep 15, 2026

Copy link
Copy Markdown
审查者指南(小型 PR 中折叠显示)

审查者指南

调度器现在会在前端强制执行后端的单用户约束:在脚本设置和更新模式下隐藏用户下拉菜单并省略 userId,而切换回自动代理时会保留之前的选择。

调度器启动模式筛选的时序图

sequenceDiagram
    participant User
    participant SchedulerTaskControl
    participant useSchedulerLogic
    participant Backend

    User->>SchedulerTaskControl: Select user and choose mode
    alt AUTO_PROXY mode
        SchedulerTaskControl-->>User: Show user dropdown
        User->>useSchedulerLogic: Start task
        useSchedulerLogic->>Backend: Start request with userId
    else SCRIPT_SETTINGS or UPDATE mode
        SchedulerTaskControl-->>User: Hide user dropdown
        User->>useSchedulerLogic: Start task
        useSchedulerLogic->>Backend: Start request without userId
    end
Loading

文件级变更

变更 详情 文件
将用户选择和特定用户的启动参数限制为自动代理模式。
  • 仅当所选模式为 AUTO_PROXY 时显示用户下拉菜单,同时在切换模式时保留所选用户。
  • 仅当所选模式为 AUTO_PROXY 时,才在启动请求中包含 userId。
  • 添加记录调度器修复的变更日志条目。
frontend/src/views/scheduler/SchedulerTaskControl.vue
frontend/src/views/scheduler/useSchedulerLogic.ts
changelog.d/fix-scheduler-user-select-auto-proxy-only.fix.md

可能相关的问题


提示和命令

与 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 (collapsed on small PRs)

Reviewer's Guide

The scheduler now enforces the backend’s single-user constraint in the frontend: the user dropdown is hidden and userId is omitted for script-settings and update modes, while switching back to automatic proxy retains the prior selection.

Sequence diagram for scheduler launch mode filtering

sequenceDiagram
    participant User
    participant SchedulerTaskControl
    participant useSchedulerLogic
    participant Backend

    User->>SchedulerTaskControl: Select user and choose mode
    alt AUTO_PROXY mode
        SchedulerTaskControl-->>User: Show user dropdown
        User->>useSchedulerLogic: Start task
        useSchedulerLogic->>Backend: Start request with userId
    else SCRIPT_SETTINGS or UPDATE mode
        SchedulerTaskControl-->>User: Hide user dropdown
        User->>useSchedulerLogic: Start task
        useSchedulerLogic->>Backend: Start request without userId
    end
Loading

File-Level Changes

Change Details Files
Restrict user selection and user-specific launch parameters to automatic proxy mode.
  • Gate the user dropdown on the selected mode being AUTO_PROXY, while preserving the selected user when switching modes.
  • Include userId in launch requests only when the selected mode is AUTO_PROXY.
  • Add a changelog entry documenting the scheduler fix.
frontend/src/views/scheduler/SchedulerTaskControl.vue
frontend/src/views/scheduler/useSchedulerLogic.ts
changelog.d/fix-scheduler-user-select-auto-proxy-only.fix.md

Possibly linked issues


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.

嘿——我已经查看了你的更改,看起来很棒!

Sourcery 评估

需要人工审查。 如果模式检查有误,之前被拒绝的启动可能会在没有用户限制的情况下继续执行,并为超出预期数量的用户运行调度器任务。回滚可以防止后续启动,但无法撤销已经发生的作业或副作用。


Sourcery 对开源项目免费——如果你喜欢我们的评审,请考虑分享 ✨
Original comment in English

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Needs a human reviewer. If the mode check is wrong, a previously rejected launch could proceed without a user restriction and run the scheduler task for more users than intended. Reverting prevents future launches but cannot undo jobs or side effects that already occurred.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@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.

Sourcery assessment

Approved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Sentry daily Sentry daily issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants