3.2 KiB
3.2 KiB
id, title, status, wave, depends_on, plan, spec
| id | title | status | wave | depends_on | plan | spec | |
|---|---|---|---|---|---|---|---|
| 02-agent-delivery-and-queue | Agent attachment delivery | completed | 2 |
|
plan.md | ../../specs/tasks/prompt-attachments.md |
Task 02: Agent attachment delivery
Acceptance
- Task creation, direct/new-session prompts, queued messages, queue edits, queue drain, and idempotent replay carry claimed attachment descriptors and never persist or send staged file bytes through the application WebSocket.
- The lifecycle manager streams each claimed file to the authorized active agentctl session, materializes it beneath the session attachment directory, and dispatches the prompt only after every attachment succeeds.
- Traversal, owner/task/session mismatches, oversize inline compatibility payloads, and failed/partial materialization fail safely; the shared WebSocket read limit remains 32 MiB.
Verification
cd apps/backend && go test -tags fts5 ./internal/orchestrator/messagequeue ./internal/orchestrator/handlers ./internal/agent/runtime/lifecycle ./internal/agent/runtime/agentctl ./internal/agentctl/server/api ./internal/agentctl/server/adapter/transport/shared ./internal/gateway/websocket
Files likely touched
apps/backend/pkg/api/v1/task.goapps/backend/internal/orchestrator/message_meta.goapps/backend/internal/orchestrator/messagequeue/types.goapps/backend/internal/orchestrator/messagequeue/service.goapps/backend/internal/orchestrator/messagequeue/repository_sqlite.goapps/backend/internal/orchestrator/handlers/queue_handlers.goapps/backend/internal/task/handlers/message_handlers.goapps/backend/internal/task/handlers/task_http_handlers.goapps/backend/internal/agent/runtime/lifecycle/types.goapps/backend/internal/agent/runtime/lifecycle/manager_interaction.goapps/backend/internal/agent/runtime/lifecycle/session.goapps/backend/internal/agent/runtime/agentctl/client_attachments.go(new)apps/backend/internal/agentctl/server/api/attachment.go(new)apps/backend/internal/agentctl/server/adapter/transport/shared/attachments.goapps/backend/internal/gateway/websocket/client.go- Focused
*_test.gofiles beside the changed packages
Dependencies
- Task 01 supplies the registry, authorized resolver, storage reader, and claim transaction boundary.
Parallelism
Sequential. It changes shared message/queue contracts and the backend-agentctl delivery seam used by the frontend task.
Inputs
- Spec: What, API surface, State machine, Failure modes, Scenarios
- Plan: Backend / Agentctl materialization and prompt delivery
- Task 01 results and final attachment service interfaces
Output contract
Report descriptor flow, queue/idempotency behavior, materialized paths, files changed, exact tests and outcomes, trust/authorization boundaries, blockers, risks, and synchronized task/plan status.
Results
Implemented descriptor propagation through task/message/queue contracts, idempotent queue/message claims, bounded inline compatibility validation, streaming backend-to-agentctl materialization, session-scoped attachment storage, and path reuse in the agent adapter. Full backend verification passed with go test -tags fts5 ./... (9,495 tests in 189 packages).