Allow agents to request task completion with user approval#646
Open
h0x91b wants to merge 3 commits into
Open
Conversation
`dev3 task move --status completed` no longer fails: the CLI sends task.requestCompletion over the socket and blocks (up to 10 minutes) while the app shows a visually distinct AI-initiated confirm dialog (accent border + robot badge, danger confirm, autofocused cancel). Approval runs the normal completed move and destroys the session; decline returns the new documented exit code 6 so the agent knows the user said no. Pending requests are in-memory, deduped per task, and a late approval still completes the task after a CLI timeout. `cancelled` remains forbidden via CLI.
…etion dialog
The completion-request push now carries the task overview (userOverview
takes precedence over the agent-written one). The confirm() service gains
a generic info subject card — an accent-tinted panel rendered between the
title and the message — so the user instantly recognizes which task the
AI agent wants to complete. The plain "Task: {title}" line is removed
from the dialog message in all locales.
The project defines a 'base' color token, so Tailwind emits text-base as a color utility that overrides text-accent. Use an arbitrary font-size instead and add a task icon to the info card.
474b973 to
4ad4527
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
dev3 task move --status completedno longer fails client-side: the CLI now sends atask.requestCompletionsocket request and blocks up to 10 minutes while the app asks the user for approval. The agent learns the verdict from the same invocation — decline returns the new documented exit code6(CLI_EXIT_CODE_COMPLETION_DECLINED), approval prints a confirmation right before the worktree + tmux session are destroyed.cancelledremains fully forbidden via CLI.confirm()service with a newagentInitiatedtreatment: accent border + "AI agent request" badge (robot glyph),danger-styled "Complete task" confirm, autofocused "Keep session" cancel — so the user can't mistake it for a routine confirm and accidentally kill the session.src/bun/completion-requests.ts): deduped per task (an agent retry joins the open dialog instead of spawning a duplicate), and a late approval after a CLI timeout still completes the task.