fix: 修复部分情况下goal无法启动的问题

This commit is contained in:
moyu 2026-06-11 11:44:03 +08:00
parent 241bd48129
commit bffb80e110

View File

@ -23,6 +23,7 @@ import {
formatGoalElapsed,
formatGoalStatusLabel,
getGoal,
incrementGoalTurns,
pauseGoal,
resumeGoal,
setGoal,
@ -49,6 +50,7 @@ function formatGoalStatus(): string {
function applySetGoal(objective: string): string {
setGoal(objective);
incrementGoalTurns();
persistCurrentGoal();
return `Goal set: ${objective}\n\n${formatGoalStatus()}`;
}
@ -118,6 +120,7 @@ export async function call(
const summary = applySetGoal(trimmed);
onDone(summary, {
display: 'system',
shouldQuery: true,
metaMessages: [`<goal-objective-updated>\n${trimmed}\n</goal-objective-updated>`],
});
return null;
@ -131,6 +134,7 @@ export async function call(
const summary = applySetGoal(trimmed);
onDone(summary, {
display: 'system',
shouldQuery: true,
metaMessages: [`<goal-objective-updated>\n${trimmed}\n</goal-objective-updated>`],
});
}}