Repository navigation
fix(schedule): bound AI task runs and wait for SOP outcomes - #1080
Open
Robert0622 wants to merge 3 commits into
Open
Robert0622 wants to merge 3 commits into
Robert0622 wants to merge 3 commits into
Conversation
Collaborator
Author
定时任务超时与 SOP 终态实测复测通过。 在提交
以上两条当前提交的运行均未调用 本轮执行记录(两条均为定时触发) 已保存的 1 分钟超时和 Flash 模型配置 草稿回退、单次启动,以及超时取消等待的网关记录 定时会话超时后,独立 SOP 的最终结果 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Problem
The v0.4.0 scheduled assistant had no per-execution deadline. SOP dispatch returned immediately, so unattended prompts that needed an outcome could keep querying run details and logs indefinitely.
Changes
runs_waittool. It waits on the exact run ID using a lightweight status query, returns when the run completes or needs human action, and yields after at most 25 seconds per call. Scheduled prompts use it when they need to wait for an SOP outcome.Validation
TestScheduledAssistantHasNoDeadlineatv0.4.0to confirm the missing execution deadline.go vet, public content check, and Gitleaks scan also passed.Live CodeBuddy regression
Real DeepSeek V4.1 Flash was used for the timer prompt and the SOP Agent node on isolated MySQL instances. The Agent wrote a marker artifact, which the following script verified.
runs_getcalls before reporting SOP success at 121.7 seconds.7382983f), slow SOP, one-minute timeoutruns_waitcalls, including the wait that was cancelled at the deadline. The dispatched SOP later succeeded.7382983f), short SOPruns_waitcall and reported the correct success state in 36.8 seconds.The v0.4.0 run eventually reached the correct outcome in this fixture. The comparison reproduced the omitted deadline and repeated reads.
Follow-up live regression
A fresh timer run exposed another path on
7382983f. The model submittedruns_startas a final reply draft. The schedule recorded success after 15.0 seconds, applied the draft after the CLI exited, and never checked the SOP outcome.Commit
0c3e528bkeeps scheduled SOP dispatch in the active turn. The gateway directs the model to call the dispatch tool, and text recovery rejects a leftover dispatch draft before it can run. The added regression tests cover start, issue dispatch, retry, and the recovered-draft path.We repeated both timer cases with CodeBuddy on DeepSeek V4.1 Flash and isolated MySQL. Each dispatched one SOP. A real Agent wrote a unique marker in each run, a script checked it, and both the marker and completion artifact were read back from storage.
runs_waitreturnedsucceeded. The timer reported the correct run ID and finished in 40.398 seconds.runs_waitcalls. The deadline cancelled the second wait (HTTP 408) and the timer recordedEXECUTION_TIMEOUTat 60.101 seconds. The independent SOP later succeeded.Neither timer called
runs_get. A later read found the same persisted generation sequence and update timestamp for both completed timer executions.