@@ -77,7 +77,7 @@ export interface GoalState {
|
||||
wakeDispatchedAt?: number;
|
||||
wakeObserved?: boolean;
|
||||
};
|
||||
/** Operator opt-in: suspend waits, with one deadline wake per goal/resume. */
|
||||
/** Operator opt-in: add one deadline wake to a suspended wait per goal/resume. */
|
||||
waitTimeoutSeconds?: number;
|
||||
waitWakeUsed?: boolean;
|
||||
setAt: string;
|
||||
@@ -144,7 +144,8 @@ export function blockGoal(state: GoalState, reason: string): GoalState {
|
||||
}
|
||||
|
||||
export function resumeGoal(state: GoalState): GoalState {
|
||||
if (state.status !== "paused" && state.status !== "blocked") return state;
|
||||
if (state.status !== "paused" && state.status !== "blocked" &&
|
||||
!(state.status === "active" && state.activeWait)) return state;
|
||||
return {
|
||||
...state,
|
||||
status: "active",
|
||||
@@ -152,7 +153,7 @@ export function resumeGoal(state: GoalState): GoalState {
|
||||
noProgressReports: 0,
|
||||
workEventSinceReport: false,
|
||||
pausedReason: undefined,
|
||||
activeWait: state.waitTimeoutSeconds ? undefined : state.activeWait,
|
||||
activeWait: undefined,
|
||||
waitWakeUsed: state.waitTimeoutSeconds ? false : state.waitWakeUsed,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user