Skip to content

fix: scheduled-task none-delivery and settings model-delete fix#2256

Closed
tsonglew wants to merge 1 commit into
netease-youdao:mainfrom
tsonglew:fix/scheduled-task-none-delivery
Closed

fix: scheduled-task none-delivery and settings model-delete fix#2256
tsonglew wants to merge 1 commit into
netease-youdao:mainfrom
tsonglew:fix/scheduled-task-none-delivery

Conversation

@tsonglew

@tsonglew tsonglew commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR squashes two fixes:

  1. Scheduled task notification channel「不通知」not taking effect — switching a task's notification channel to 「不通知」in the edit page and saving did not work; the form kept showing the previously selected channel.

  2. White screen when deleting active custom model — deleting the currently active custom model in Settings caused a white screen.

Related Issue

Changes Made

fix(scheduledTask): clear stale delivery target when switching to "不通知"

  • Strip stale channel/to/accountId in mapGatewayJob when delivery.mode === 'none' — covers updateJob/listJobs/getJob/addJob/toggleJob including the onRefresh → loadTasks refresh path
  • Extract mapGatewayDeliveryTarget helper for non-none delivery mapping with sessionKey inference
  • Simplify toGatewayDelivery's none branch to send a clean { mode: 'none' } patch
  • Add 2 tests: stripping stale channel/to when mode is none, and not inferring channel from sessionKey when mode is none

fix(settings): prevent white screen when deleting active custom model

  • Handle the case where the currently active custom model is deleted by falling back to a valid default model instead of rendering a white screen

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Code refactoring
  • Documentation update
  • Performance improvement
  • Other (please describe):

Testing

  • Tested locally

  • Added new tests

  • Updated existing tests

  • Manual testing performed

  • npx vitest run src/scheduledTask/cronJobService.test.ts src/scheduledTask/modelMapper.test.ts → 34 passed (incl. 2 new tests)

  • npx eslint --max-warnings 0 on touched files → clean

  • Pre-existing env failure (unrelated): metaStore.test.ts / integration.test.ts fail at new Database(':memory:') due to better-sqlite3 native-module version mismatch (NODE_MODULE_VERSION 143 vs 137)

Screenshots (if applicable)

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Electron-Specific Changes

  • Changes to main process (src/main/)
  • Changes to preload script (src/main/preload.ts)
  • Changes to IPC communication
  • Changes to window management
  • None

Additional Notes

The scheduled task fix is a client-side data-mapping fix in the scheduledTask model layer (src/scheduledTask/cronJobService.ts). It does not touch IPC channels, the storage schema, OpenClaw configuration, runtime behavior, or restart logic. The root cause is that the OpenClaw gateway cron.update patch-merges delivery and cannot clear a previously-set channel/to — stripping them client-side in mapGatewayJob (the single chokepoint for all gateway→UI job mappings) is the most robust solution.

Manual validation recommended for the scheduled task fix: npm run electron:dev → edit a task's notification channel to 「不通知」 → save → reopen edit page / refresh → confirm it stays 「不通知」.

- fix(scheduledTask): clear stale delivery target when switching to "不通知"
- fix(settings): prevent white screen when deleting active custom model
@fisherdaddy

Copy link
Copy Markdown
Collaborator

感谢提交 PR,此 PR 已经通过 #2282 合并到 release/2026.7.6 分支。本 PR 将关闭,相关改动会在 release 合回 main 时自动带入。

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants