mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-05-02 21:50:52 +00:00
feat(cron): add distinct Cron message type and exit summary
- Introduce SendMessageType.Cron to differentiate cron-triggered prompts from user queries - Skip UserPromptSubmit hook for cron messages - Add getExitSummary() to display active loops when session ends - Add tests for exit summary functionality This improves cron loop handling by treating scheduled prompts differently from user-initiated queries and provides better UX when sessions end with active loops running. Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
parent
314a9ded78
commit
aa454a5a72
5 changed files with 94 additions and 7 deletions
|
|
@ -405,7 +405,7 @@ export async function runNonInteractive(
|
|||
prompt_id,
|
||||
{
|
||||
type: cronIsFirstTurn
|
||||
? SendMessageType.UserQuery
|
||||
? SendMessageType.Cron
|
||||
: SendMessageType.ToolResult,
|
||||
},
|
||||
);
|
||||
|
|
@ -415,7 +415,11 @@ export async function runNonInteractive(
|
|||
|
||||
for await (const event of cronStream) {
|
||||
if (abortController.signal.aborted) {
|
||||
const summary = scheduler.getExitSummary();
|
||||
scheduler.stop();
|
||||
if (summary) {
|
||||
process.stderr.write(summary + '\n');
|
||||
}
|
||||
resolve();
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue