Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 86 additions & 1 deletion apps/api/src/handlers/tasks/__tests__/getTaskSummary.test.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions apps/api/src/handlers/tasks/getTaskSummary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ export async function getTaskSummary(
columns: { id: true, name: true },
})
: null;
const hasUsedGoalMode =
typeof task.goalObjective === 'string' ||
task.goalStatus != null ||
(Array.isArray(task.goalGenerationIds) &&
task.goalGenerationIds.length > 0);

return c.json({
id: task.id,
Expand All @@ -65,6 +70,20 @@ export async function getTaskSummary(
environmentSetupState: latestRun?.environmentSetupState ?? null,
linkedEnvironmentId: linkedEnvironmentId ?? null,
linkedEnvironmentName: linkedEnvironment?.name ?? null,
hasUsedGoalMode,
goal: hasUsedGoalMode
? {
objective: task.goalObjective ?? null,
status: task.goalStatus ?? null,
maxContinuations: task.goalMaxContinuations ?? null,
continuationsUsed: task.goalContinuationsUsed ?? 0,
blockedReason: task.goalBlockedReason ?? null,
startedAt: task.goalStartedAt ?? null,
endedAt: task.goalEndedAt ?? null,
completedAt: task.goalCompletedAt ?? null,
generation: task.goalLastContinuationId ?? null,
}
: null,
});
} catch (error) {
logHandlerError('getTaskSummary', error);
Expand Down
10 changes: 10 additions & 0 deletions apps/api/src/handlers/tasks/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ export const TASK_SELECT_COLUMNS = {
timestamp: tasks.timestamp,
activityAt: tasks.activityAt,
repositoryName: tasks.repositoryName,
goalObjective: tasks.goalObjective,
goalStatus: tasks.goalStatus,
goalMaxContinuations: tasks.goalMaxContinuations,
goalContinuationsUsed: tasks.goalContinuationsUsed,
goalBlockedReason: tasks.goalBlockedReason,
goalStartedAt: tasks.goalStartedAt,
goalEndedAt: tasks.goalEndedAt,
goalCompletedAt: tasks.goalCompletedAt,
goalLastContinuationId: tasks.goalLastContinuationId,
goalGenerationIds: tasks.goalGenerationIds,
};

interface LatestTaskRunSummary {
Expand Down
161 changes: 161 additions & 0 deletions apps/web/src/app/(sandbox)/task/[taskId]/GoalPanel.client.test.tsx

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading