-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
Repo: coder/coder
Scope: Allow /send to accept messages for paused tasks, queue them, and deliver asynchronously.
Note: Consider ACP (Agent Communication Protocol) impact before implementation. ACP standardization may influence message queue design and delivery mechanism.
Changes:
- Create
task_pending_inputstable:idUUID PRIMARY KEYtask_idUUID REFERENCES tasks(id)contentTEXT NOT NULLstatusTEXT NOT NULL DEFAULT 'pending'created_atTIMESTAMPTZ NOT NULLdelivered_atTIMESTAMPTZerrorTEXT
- Modify
/sendto accept messages for paused tasks - Return 202 Accepted with message ID for queued messages
- Background worker: trigger workspace start, poll for ready, deliver message, update status
- Handle failures (build fails, delivery fails) with appropriate status updates
Benefits beyond auto-resume (per RFC):
- Solves Terraform env var length limits for long prompts
- Unifies initial prompt + follow-up delivery path
- Enables prompt modification until task starts
- Enables prebuilds for tasks
Files:
- New migration for
task_pending_inputstable coderd/aitasks.go(modified send handler)- New background worker or integration with existing job system
Acceptance criteria:
-
/sendto paused task returns 202 and queues message - Workspace automatically starts
- Message delivered when workspace ready
- Failure states handled gracefully with status tracking
- Direct API consumers no longer need orchestration logic
Dependencies:
- GA phase complete
- ACP (Agent Communication Protocol) evaluation (does not block, but may influence design)
References:
- PRD: Start/Pause/Resume the Task Workspace
- RFC: Tasks: Start/Pause/Resume Lifecycle: Auto-Resume Option B