Skip to content

Allow agents to request task completion with user approval#646

Open
h0x91b wants to merge 3 commits into
mainfrom
feat/dev3-agent-complete-request
Open

Allow agents to request task completion with user approval#646
h0x91b wants to merge 3 commits into
mainfrom
feat/dev3-agent-complete-request

Conversation

@h0x91b

@h0x91b h0x91b commented Jun 10, 2026

Copy link
Copy Markdown
Owner

Summary

  • dev3 task move --status completed no longer fails client-side: the CLI now sends a task.requestCompletion socket 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 code 6 (CLI_EXIT_CODE_COMPLETION_DECLINED), approval prints a confirmation right before the worktree + tmux session are destroyed. cancelled remains fully forbidden via CLI.
  • The approval dialog reuses the in-app confirm() service with a new agentInitiated treatment: 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.
  • Pending requests live in an in-memory registry (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.
  • Agent skill content documents the new flow for all agent variants; adds a "Did you know?" tip, i18n (en/ru/es), decision record 067, UX feature plan + decisions, and unit tests across the registry, socket handler, CLI, confirm dialog, and App listener.

h0x91b added 3 commits June 10, 2026 22:41
`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.
@h0x91b h0x91b force-pushed the feat/dev3-agent-complete-request branch from 474b973 to 4ad4527 Compare June 10, 2026 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant