Skip to content

feat(cron): support fresh execution sessions#3255

Open
cnyarx wants to merge 7 commits intoagentscope-ai:mainfrom
cnyarx:feat/cron-fresh-execution-sessions
Open

feat(cron): support fresh execution sessions#3255
cnyarx wants to merge 7 commits intoagentscope-ai:mainfrom
cnyarx:feat/cron-fresh-execution-sessions

Conversation

@cnyarx
Copy link
Copy Markdown

@cnyarx cnyarx commented Apr 10, 2026

Summary

  • support fresh execution sessions for cron agent jobs while continuing to deliver output to the configured dispatch session
  • add executor coverage for dispatch vs new_per_run session behavior and fix the test imports after the qwenpaw package rename
  • polish the cron jobs console by tightening the update payload contract, cleaning up remaining i18n gaps, fixing clipboard handling, and
    aligning form typing with actual form values

Test plan

  • Run python tests/unit/app/test_cron_executor.py
  • Create and edit cron jobs from the console page
  • Verify dispatch vs new_per_run behavior for agent jobs
  • Verify text jobs still send to the configured output session
  • Verify weekly/custom cron display, tooltip text, and copy behavior in the jobs table
  • Verify enable/disable and execute-now actions show the expected toasts

Notes

  • agent jobs now distinguish between the execution session and the dispatch/output session
  • console updates now always send the job id expected by PUT /cron/jobs/{job_id}
  • this PR also cleans up follow-up issues found while reviewing the merged cron branch against current main

Allow cron jobs to start a new execution session for each run while keeping output delivery pinned to the configured target session. This lets scheduled agent runs isolate chat state without breaking console delivery.

Co-Authored-By: Claude Opus 4.6 <[email protected]>

*改动描述:

*Bug 或 Feature: Bug
*依赖信息:
    无
*测试相关:
   - 自动测试 - UT: Y
   - UT Case 路径 : odps_src/test/unit_test/xxxx
   - 自动测试 - FT: N
   - FT Case 路径: NA
   - 手动测试描述:
      无
*影响评估:
   - 性能影响:N
   - 性能影响描述: 无
   - 兼容性影响:  N
   - 兼容性影响描述: 无
   - 配置变更影响:  N
   - 是否已提交并完成部署变更review:  N
   - 部署变更步骤描述:
     无

*其他信息:
   来自开发容器

Change-Id: I81924a16e11d2d678b1911266a0149dc54168536
@github-actions
Copy link
Copy Markdown

Welcome to CoPaw! 🐾

Hi @cnyarx, this is your 2nd Pull Request.

🙌 Join Developer Community

Thanks so much for your contribution! We'd love to invite you to join the official CoPaw developer group! You can find the Discord and DingTalk group links under the "Developer Community" section on our docs page:
https://copaw.agentscope.io/docs/community

We truly appreciate your enthusiasm—and look forward to your future contributions! 😊

We'll review your PR soon.

Copy link
Copy Markdown
Contributor

@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

This pull request introduces an execution session strategy for cron jobs, allowing users to choose between reusing the output session context or starting a fresh session for each run. Key changes include the addition of execution session interfaces and models, updated UI components in the Job Drawer and table columns to support the new strategy, and backend logic in the cron executor to generate unique session IDs for the 'new_per_run' mode. A review comment suggests enhancing the frontend data processing by merging the execution object for future-proofing and using destructuring to maintain immutability when cleaning up request parameters.

chenguang.xcg and others added 3 commits April 11, 2026 01:02
Stop sending an empty request object for text cron jobs so the create API no longer fails validation after the execution session changes.

Co-Authored-By: Claude Opus 4.6 <[email protected]>

*改动描述:

*Bug 或 Feature: Bug
*依赖信息:
    无
*测试相关:
   - 自动测试 - UT: Y
   - UT Case 路径 : odps_src/test/unit_test/xxxx
   - 自动测试 - FT: N
   - FT Case 路径: NA
   - 手动测试描述:
      无
*影响评估:
   - 性能影响:N
   - 性能影响描述: 无
   - 兼容性影响:  N
   - 兼容性影响描述: 无
   - 配置变更影响:  N
   - 是否已提交并完成部署变更review:  N
   - 部署变更步骤描述:
     无

*其他信息:
   来自开发容器

Change-Id: I5a88829cf8ab2c0e6f8fe177d920b8bcca6d2519
Split cron create payloads from persisted specs, hide generated ids in the create form, and stop agent submissions when request JSON is invalid.

Co-Authored-By: Claude Opus 4.6 <[email protected]>

*改动描述:

*Bug 或 Feature: Bug
*依赖信息:
    无
*测试相关:
   - 自动测试 - UT: Y
   - UT Case 路径 : odps_src/test/unit_test/xxxx
   - 自动测试 - FT: N
   - FT Case 路径: NA
   - 手动测试描述:
      无
*影响评估:
   - 性能影响:N
   - 性能影响描述: 无
   - 兼容性影响:  N
   - 兼容性影响描述: 无
   - 配置变更影响:  N
   - 是否已提交并完成部署变更review:  N
   - 部署变更步骤描述:
     无

*其他信息:
   来自开发容器

Change-Id: Ia9961a500f62a0c6f6c7ef91512378fa62bedfee
Thanks. This is a reasonable cleanup suggestion, but I’m keeping the current implementation in this PR since it doesn’t change behavior and there are no other `execution` fields to
   preserve today.

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
chenguang.xcg added 2 commits April 12, 2026 23:32
…tion-sessions

*改动描述:

*Bug 或 Feature: Bug
*依赖信息:
    无
*测试相关:
   - 自动测试 - UT: Y
   - UT Case 路径 : odps_src/test/unit_test/xxxx
   - 自动测试 - FT: N
   - FT Case 路径: NA
   - 手动测试描述:
      无
*影响评估:
   - 性能影响:N
   - 性能影响描述: 无
   - 兼容性影响:  N
   - 兼容性影响描述: 无
   - 配置变更影响:  N
   - 是否已提交并完成部署变更review:  N
   - 部署变更步骤描述:
     无

*其他信息:
   来自开发容器

Change-Id: I8f78412539797fca3ed49eb5a4bf41c8a23125f1
Tighten the cron jobs console against the backend contract, localize remaining UI copy, and fix the cron executor test imports after the qwenpaw rename.

Co-Authored-By: Claude Opus 4.6 <[email protected]>

*改动描述:

*Bug 或 Feature: Bug
*依赖信息:
    无
*测试相关:
   - 自动测试 - UT: Y
   - UT Case 路径 : odps_src/test/unit_test/xxxx
   - 自动测试 - FT: N
   - FT Case 路径: NA
   - 手动测试描述:
      无
*影响评估:
   - 性能影响:N
   - 性能影响描述: 无
   - 兼容性影响:  N
   - 兼容性影响描述: 无
   - 配置变更影响:  N
   - 是否已提交并完成部署变更review:  N
   - 部署变更步骤描述:
     无

*其他信息:
   来自开发容器

Change-Id: Ie9af67af31ea44ea5da4c967aaac74dbf5dba383
@cnyarx
Copy link
Copy Markdown
Author

cnyarx commented Apr 12, 2026

已补齐这次 cron 分支的收尾修改,当前 PR 主要包含三部分:

  1. 支持 cron agent 任务在 new_per_run 模式下为每次执行创建独立 execution session,同时仍将结果投递到配置的 dispatch/output session
  2. 增加对应的 executor 测试覆盖,并修复 copaw -> qwenpaw 重命名后遗留的测试导入问题
  3. 顺手修复了 cron 控制台页面的一些集成细节,包括:
    • 更新请求显式带上 id,与后端 PUT /cron/jobs/{job_id} 契约保持一致
    • 清理剩余硬编码文案,补齐中英文 i18n
    • 修复复制按钮里的 hook 使用方式
    • 收紧表单类型定义,使之和实际表单值结构一致

已本地验证:

  • python tests/unit/app/test_cron_executor.py
  • 前端UI:
image

有需要我再跟进补修。

…tion-sessions

Co-Authored-By: Claude Opus 4.6 <[email protected]>

*改动描述:

*Bug 或 Feature: Bug
*依赖信息:
    无
*测试相关:
   - 自动测试 - UT: Y
   - UT Case 路径 : odps_src/test/unit_test/xxxx
   - 自动测试 - FT: N
   - FT Case 路径: NA
   - 手动测试描述:
      无
*影响评估:
   - 性能影响:N
   - 性能影响描述: 无
   - 兼容性影响:  N
   - 兼容性影响描述: 无
   - 配置变更影响:  N
   - 是否已提交并完成部署变更review:  N
   - 部署变更步骤描述:
     无

*其他信息:
   来自开发容器

Change-Id: Ifab8dd709fd1b1335e4677172ec353f33a5868bf
@cnyarx
Copy link
Copy Markdown
Author

cnyarx commented Apr 15, 2026

处理了版本更新造成的冲突

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

Labels

None yet

Projects

Status: Todo

Development

Successfully merging this pull request may close these issues.

1 participant