fix(ui): show the plan and Approve/Reject on a task waiting for approval

This commit is contained in:
sam committed 2026-10-24 23:35:31 +11:00
1 parent aabe8f7a80
commit 1f8a9964c1
4 files changed
+53 -41

No files matched your search

+15 -5
View File
@@ -23,6 +23,7 @@ import { MetadataList } from "@/components/ui/metadata-list";
import { Section } from "@/components/ui/section";
import StartNewRun from "./StartNewRun.vue";
import TaskRowActions from "./TaskRowActions.vue";
import ChatMarkdown from "@/chat/ChatMarkdown.vue";
import { shownActionIds } from "./task-actions";
import { useTaskRun } from "./use-task-run";
@@ -77,10 +78,15 @@ async function jumpToLog(): Promise<void> {
}
}
// The head has room for one control: the reap an operator reaches for once a
// task is finished with. Whether this task offers it at all is the server's
// action list, never this page's opinion about the status.
const HEAD_ACTIONS = ["archive", "merge"];
// The head holds the decision a waiting task needs and the reap an operator
// reaches for once a task is finished with. Whether this task offers them is
// the server's action list, never this page's opinion about the status. A
// review gate answers through its findings panel instead.
const HEAD_ACTIONS = computed(() =>
run.task?.review_gate ? ["archive", "merge"] : ["approve", "reject", "archive", "merge"],
);
// The plan a waiting task asks the operator to approve.
const plan = computed(() => (run.task?.status === "waiting_human" ? run.task?.plan?.trim() : "") || "");
// The run's inputs and written outputs, one row per name.
const rows = (values?: Record<string, unknown>) =>
@@ -96,7 +102,7 @@ const sections = computed(() =>
].filter((section) => section.rows.length),
);
const headerActions = computed(() =>
shownActionIds(run.task?.actions, HEAD_ACTIONS),
shownActionIds(run.task?.actions, HEAD_ACTIONS.value),
);
</script>
@@ -145,6 +151,10 @@ const headerActions = computed(() =>
</div>
</div>
<Section v-if="plan" title="Plan to approve" class="mt-4 mb-0">
<ChatMarkdown :text="plan" class="text-sm" />
</Section>
<Section v-if="description" title="Description" class="mt-4 mb-0">
<p class="whitespace-pre-wrap break-words text-sm text-fg-muted">{{ description }}</p>
</Section>
+1
View File
@@ -56,6 +56,7 @@ export interface TaskRecord {
tokens_used?: number;
actions?: string[];
review_gate?: string;
plan?: string;
rereview_rounds?: number;
}
+1
View File
@@ -34,6 +34,7 @@ export interface Task {
/** The operator-approval gate's document, as JSON. The rereview dialog
* reads its round count; a task without one never answers a gate. */
review_gate?: string;
plan?: string;
/** How many re-reviews this gate has granted, against the server's cap. */
rereview_rounds?: number;
}