AutoGPT/docs/platform
Nicholas Tindle 8892bcd230
docs: Add workspace and media file architecture documentation (#11989)
### Changes 🏗️

- Added comprehensive architecture documentation at
`docs/platform/workspace-media-architecture.md` covering:
  - Database models (`UserWorkspace`, `UserWorkspaceFile`)
  - `WorkspaceManager` API with session scoping
- `store_media_file()` media normalization pipeline (input types, return
formats)
  - Virus scanning responsibility boundaries
- Decision tree for choosing `WorkspaceManager` vs `store_media_file()`
- Configuration reference including `clamav_max_concurrency` and
`clamav_mark_failed_scans_as_clean`
  - Common patterns with error handling examples
- Updated `autogpt_platform/backend/CLAUDE.md` with a "Workspace & Media
Files" section referencing the new docs
- Removed duplicate `scan_content_safe()` call from
`WriteWorkspaceFileTool` — `WorkspaceManager.write_file()` already scans
internally, so the tool was double-scanning every file
- Replaced removed comment in `workspace.py` with explicit ownership
comment clarifying that `WorkspaceManager` is the single scanning
boundary

### Checklist 📋

#### For code changes:
- [x] I have clearly listed my changes in the PR description
- [x] I have made a test plan
- [x] I have tested my changes according to the test plan:
- [x] Verified `scan_content_safe()` is called inside
`WorkspaceManager.write_file()` (workspace.py:186)
- [x] Verified `store_media_file()` scans all input branches including
local paths (file.py:351)
- [x] Verified documentation accuracy against current source code after
merge with dev
  - [x] CI checks all passing

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Mostly adds documentation and internal developer guidance; the only
code change is a comment clarifying `WorkspaceManager.write_file()` as
the single virus-scanning boundary, with no behavior change.
> 
> **Overview**
> Adds a new `docs/platform/workspace-media-architecture.md` describing
the Workspace storage layer vs the `store_media_file()` media pipeline,
including session scoping and virus-scanning/persistence responsibility
boundaries.
> 
> Updates backend `CLAUDE.md` to point contributors to the new doc when
working on CoPilot uploads/downloads or
`WorkspaceManager`/`store_media_file()`, and clarifies in
`WorkspaceManager.write_file()` (comment-only) that callers should not
duplicate virus scanning.
> 
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
18fcfa03f8. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-17 06:12:26 +00:00
..
contributing refactor(claude): Split `autogpt_platform/CLAUDE.md` into project-specific files (#11788) 2026-01-29 17:33:02 +00:00
integrating
SUMMARY.md Add documentation for Google Gemini integration (#12283) 2026-03-09 15:13:28 +00:00
advanced_setup.md
agent-blocks.md
aimlapi.md
block-sdk-guide.md feat(platform): add User Workspace for persistent CoPilot file storage (#11867) 2026-01-29 05:49:47 +00:00
create-basic-agent.md docs: add credentials prerequisites to create-basic-agent guide (#11913) 2026-01-31 03:05:31 +00:00
d_id.md
delete-agent.md
download-agent-from-marketplace-local.md
edit-agent.md
gemini.md Add documentation for Google Gemini integration (#12283) 2026-03-09 15:13:28 +00:00
getting-started.md docs: add Podman compatibility warning (#12120) 2026-02-23 15:19:24 +00:00
installer.md
new_blocks.md refactor(backend): Reduce circular imports (#12068) 2026-02-12 12:07:49 +00:00
ollama.md refactor(claude): Split `autogpt_platform/CLAUDE.md` into project-specific files (#11788) 2026-01-29 17:33:02 +00:00
submit-agent-to-marketplace.md
what-is-autogpt-platform.md
workspace-media-architecture.md docs: Add workspace and media file architecture documentation (#11989) 2026-03-17 06:12:26 +00:00