multica/server/cmd/server
devv-eve 8eb1caa72b
fix(agent): instruct agents to use download_url for attachments (#356)
* fix(agent): instruct agents to use download_url for attachments

Agents were not aware of the signed vs unsigned URL distinction in
attachments, causing failures when trying to read images. Added an
Attachments section to the generated CLAUDE.md/AGENTS.md template that
tells agents to always use `download_url`. Also increased signed URL
expiry from 5 to 30 minutes to better accommodate agent processing time.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* feat(cli): add `multica attachment download` command

Adds a dedicated CLI command for downloading attachments by ID. The
command fetches attachment metadata from the API (which returns a fresh
signed URL), downloads the file, and saves it locally. This eliminates
the need for agents to understand signed vs unsigned URLs.

Changes:
- New `multica attachment download <id>` CLI command
- New `GET /api/attachments/{id}` backend endpoint
- `DownloadFile` helper on APIClient
- Updated CLAUDE.md template to document the command

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix(cli): sanitize filename and add download size limit

- Use filepath.Base on attachment filename to prevent path traversal
- Add 100MB size limit to DownloadFile (matches upload limit)
- Include response body in download error messages for debugging

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Devv <devv@Devvs-Mac-mini.local>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-02 07:45:42 -07:00
..
activity_listeners.go feat(realtime): WS invalidation + refetch pattern, inbox bugfixes, UI polish 2026-03-29 13:49:40 +08:00
activity_listeners_test.go feat(realtime): WS invalidation + refetch pattern, inbox bugfixes, UI polish 2026-03-29 13:49:40 +08:00
comment_trigger_integration_test.go fix(server): @all mentions should not trigger agent execution 2026-04-02 00:33:21 +08:00
integration_test.go fix(test): use auth.JWTSecret() in integration tests instead of hardcoded secret (#349) 2026-04-02 18:21:21 +08:00
listeners.go feat(realtime): skip WS refetch for self-triggered events 2026-03-31 13:09:17 +08:00
main.go fix(runtime): add server-side sweeper to detect stale runtimes 2026-03-29 14:22:12 +08:00
notification_listeners.go Merge pull request #327 from multica-ai/agent/j/53c0348f 2026-04-02 14:28:26 +08:00
notification_listeners_test.go fix(inbox): remove hardcoded 50-item limit from inbox list query 2026-03-31 18:36:41 +08:00
router.go fix(agent): instruct agents to use download_url for attachments (#356) 2026-04-02 07:45:42 -07:00
runtime_sweeper.go fix(server): broadcast sweeper task:failed events to correct workspace 2026-04-02 03:20:59 +08:00
runtime_sweeper_test.go test(server): add integration tests for sweeper event broadcasting fix 2026-04-02 03:30:32 +08:00
subscriber_listeners.go fix(server): subscribe @mentioned users in issue descriptions 2026-03-31 18:36:15 +08:00
subscriber_listeners_test.go feat(notifications): replace hardcoded inbox notifications with subscriber-driven model 2026-03-28 19:33:20 +08:00