Skip to content

CAS-2664 — Astrid Upgrade: Project Awareness + Screenshot Vision + Custom Image Upload

CAS-2664 — Astrid Upgrade: Project Awareness + Screenshot Vision + Custom Image Upload

Delivered: 2026-05-13
PRs: #697, #698, #699
Engineers: Weaver (Finn), Artificer (Runa), Assayer (Sindri)

What shipped

Three independent sub-features that together make Astrid a more capable bug-report assistant:

1. Project awareness (PR #697 — CAS-2674)

Astrid now knows the Casaconomy codebase vocabulary.

  • Added docs/astrid-project-context.md — human-editable reference covering pages, components, Zustand stores, IPC command prefixes, and iOS-specific quirks
  • Inlined a compact PROJECT CONTEXT block into ASTRID_SYSTEM_PREFIX in ai_chat.rs (daemon-side; applies to all clients including older iOS builds)

Before: “the UI doesn’t look right at the bottom of the screen”
After: “This looks like a layout regression in MobileNavbar — the safe-area inset offset is missing”

2. Screenshot vision / multimodal plumbing (PR #699 — CAS-2675)

Astrid can now see attached images.

  • chat_stream accepts optional imageBase64 at the Tauri command layer
  • CloudBridge encrypted ai_chat envelope extended with imageBase64
  • Daemon ai_chat payload parser appends attached image data into the Astrid prompt context
  • LocalCli fallback is backward-safe: warns and ignores image payload (Claude CLI has no dedicated image flag)

3. Custom image upload (PR #698 — CAS-2676)

Users can attach a photo to the Astrid conversation.

  • Attach image button (photo icon) added to the bug-report chat composer in ReportSheet.tsx
  • Hidden <input type="file" accept="image/*"> — triggers native Photos picker on iOS WKWebView; standard macOS file dialog on desktop. No additional Tauri plugin required.
  • Inline thumbnail preview with dismiss button above the composer
  • useReportIssueStore gains attachedImageBytes, attachedImageDataUrl, attachImage(file), removeAttachedImage()
  • startStream wired to pass imageBase64 through to chat_stream

Architecture

User attaches image
ReportSheet.tsx (useReportIssueStore.attachImage)
↓ imageBase64
ai_commands::chat_stream (Tauri command)
↓ imageBase64
AIManager::chat_stream_bug_report
↓ CloudBridge (imageBase64 in envelope)
daemon ai_chat handler
↓ appended to Astrid prompt context
Claude (sees the image inline)

LocalCli path skips the image payload silently (no CLI flag available).

Files changed

FileChange
docs/astrid-project-context.mdNew — project vocabulary source of truth
src-tauri/src/bin/handlers/ai_chat.rsProject context injected into system prefix; imageBase64 in payload
src-tauri/src/commands/ai_commands.rsimage_base64: Option<String> param added to chat_stream
src-tauri/src/services/ai/claude_subprocess.rsimageBase64 payload forwarding
src-tauri/src/services/ai/cloudbridge.rsimageBase64 in encrypted envelope
src-tauri/src/services/ai/local_cli.rsGraceful ignore of imageBase64 with warn log
src-tauri/src/services/ai/manager.rsThread imageBase64 through chat_stream_bug_report
src-tauri/src/services/ai/prompts.rsProject context prompt block
src/components/ReportSheet.tsxAttach image button + preview
src/store/useReportIssueStore.tsattachedImage* state + actions

Merge order

CAS-2674 and CAS-2675 shipped in parallel (no dependency).
CAS-2676 shipped after CAS-2675 (depends on imageBase64 plumbing being in place).