(input: {
workspaceId: string;
message: string;
startStreamInBackground?: boolean;
kind?: GoalSyntheticMessageKind;
options: SendMessageOptions;
})
| 8962 | } |
| 8963 | |
| 8964 | async executeGoalContinuation(input: { |
| 8965 | workspaceId: string; |
| 8966 | message: string; |
| 8967 | startStreamInBackground?: boolean; |
| 8968 | kind?: GoalSyntheticMessageKind; |
| 8969 | options: SendMessageOptions; |
| 8970 | }): Promise<boolean> { |
| 8971 | assert(input.workspaceId.trim().length > 0, "executeGoalContinuation requires workspaceId"); |
| 8972 | assert(input.message.trim().length > 0, "executeGoalContinuation requires message"); |
| 8973 | |
| 8974 | const goalKind = input.kind ?? GOAL_CONTINUATION_KIND; |
| 8975 | const startStreamInBackground = |
| 8976 | input.startStreamInBackground === true && goalKind !== GOAL_BUDGET_LIMIT_KIND; |
| 8977 | const sendResult = await this.sendMessage( |
| 8978 | input.workspaceId, |
| 8979 | input.message, |
| 8980 | { |
| 8981 | ...input.options, |
| 8982 | editMessageId: undefined, |
| 8983 | }, |
| 8984 | { |
| 8985 | skipAutoResumeReset: true, |
| 8986 | synthetic: true, |
| 8987 | agentInitiated: true, |
| 8988 | startStreamInBackground, |
| 8989 | onAcceptedPreStreamFailure: startStreamInBackground |
| 8990 | ? () => |
| 8991 | this.workspaceGoalService?.requestPendingGoalContinuationDispatch(input.workspaceId) |
| 8992 | : undefined, |
| 8993 | requireIdle: true, |
| 8994 | goalKind, |
| 8995 | goalContinuation: true, |
| 8996 | } |
| 8997 | ); |
| 8998 | |
| 8999 | if (!sendResult.success) { |
| 9000 | log.info("WorkspaceService: goal continuation send skipped", { |
| 9001 | workspaceId: input.workspaceId, |
| 9002 | error: sendResult.error, |
| 9003 | }); |
| 9004 | return false; |
| 9005 | } |
| 9006 | return true; |
| 9007 | } |
| 9008 | |
| 9009 | /** |
| 9010 | * Register the callback that receives terminal idle-compaction outcomes. |
no test coverage detected