Theme 3: autonomous Run all — fan a big task's children across the AI seats
New POST /api/orgboard/tasks/{id}/run-all dispatches a run for every
outstanding child of a task (not done, no artifact yet), round-robined across
the team's configured AI seats, or all to one seat if specified. Agents still
act per their own autonomy, so gated work lands in review. The board task
drawer gets a Run all with AI button on any task that has children, so one
click puts the whole breakdown to work — then watch progress on the Delivery
dashboard and download the result.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -8,7 +8,7 @@ import {
|
||||
useSensors,
|
||||
type DragEndEvent,
|
||||
} from '@dnd-kit/core'
|
||||
import { Bot, Play, Plus, Trash2 } from 'lucide-react'
|
||||
import { Bot, Play, Plus, Sparkles, Trash2 } from 'lucide-react'
|
||||
import { toast } from 'sonner'
|
||||
import { AppShell, REVIEWS_CHANGED } from '@/components/AppShell'
|
||||
import { LivePreview } from '@/components/LivePreview'
|
||||
@@ -569,7 +569,30 @@ function TaskDrawer({
|
||||
|
||||
{children.length > 0 && (
|
||||
<div className="flex flex-col gap-2">
|
||||
<Label>Child tasks</Label>
|
||||
<div className="flex items-center justify-between">
|
||||
<Label>Child tasks</Label>
|
||||
{aiSeats.length > 0 && (
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
disabled={busy}
|
||||
onClick={() =>
|
||||
act(async () => {
|
||||
const res = await api.post<{ dispatched: number }>(
|
||||
`/api/orgboard/tasks/${task.id}/run-all`,
|
||||
seatId ? { seatId } : {},
|
||||
)
|
||||
if (res.dispatched === 0) throw new Error('Nothing left to run — all children are done or delivered.')
|
||||
}, 'Autopilot started — running every outstanding child on the AI seats.').then(() => {
|
||||
window.dispatchEvent(new Event(REVIEWS_CHANGED))
|
||||
setTimeout(() => window.dispatchEvent(new Event(REVIEWS_CHANGED)), 5000)
|
||||
})
|
||||
}
|
||||
>
|
||||
<Sparkles data-icon="inline-start" /> Run all with AI
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
<div className="flex flex-col gap-1.5">
|
||||
{children.map((child) => (
|
||||
<button
|
||||
|
||||
Reference in New Issue
Block a user