Skip to content

feat(llc): Work item file attachments — upload, storage, text extraction for KB #8253

Closed

Description

@mrveiss

Parent

Phase 1 (#8205) · Umbrella (#8204)

PRD Reference

FR-WORK-04: "Work items support: threaded comments (human or agent), file attachments, linked work products."
FR-HYBRID-06: "Human transitions item to ready, optionally adds notes and attached files (auto-ingested into work item KB)."

Depends On

#8213 — Work items. #8217 — Secrets (storage config may use company secrets for S3 credentials). #8232 (Phase 4) — Human→agent handoff ingests attachments into KB.

Acceptance Criteria

  • llc_work_item_attachments table:
    • id UUID PK, company_id FK, work_item_id FK, uploaded_by_agent_id FK nullable, uploaded_by_user_id FK nullable, filename TEXT, content_type TEXT, size_bytes INT, storage_path TEXT NOT NULL, text_extracted BOOLEAN DEFAULT FALSE, created_at TIMESTAMPTZ
  • Storage backend: uses existing AutoBot storage config — local_disk path ~/.autobot/llc/attachments/ in dev; s3-compatible in prod. Storage path written to storage_path.
  • POST /api/llc/work-items/{id}/attachments — multipart file upload. Max size: 20MB (configurable via LLC_ATTACHMENT_MAX_BYTES env var, default from company attachment_max_bytes).
  • GET /api/llc/work-items/{id}/attachments — list attachments with metadata
  • GET /api/llc/work-items/{id}/attachments/{attachment_id}/download — signed URL or direct stream
  • DELETE /api/llc/work-items/{id}/attachments/{attachment_id} — removes from storage + DB
  • Text extraction (async, post-upload): for .txt, .md, .py, .ts, .json, .yaml — content read and stored in llc_work_item_attachments.extracted_text TEXT column. Binary files (images, PDFs) skip extraction (text_extracted = false).
  • Extracted text available at GET /api/llc/work-items/{id}/attachments/{id}/text
  • Agent-facing API: POST /api/llc/agent/attachments — agents can upload attachments too
  • python -m pytest autobot-backend/llc/ -k attachment passes

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions