Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(mobile): Send composer images in upload wire format #4035

Mergedjuliusmarmingemerged 2 commits intomain fromrefs/pull/4035/headmerged by juliusmarminge View on GitHub

juliusmarmingecommented

Extracted from #3910.

Converts client-only draft image attachments to the upload wire shape for direct turn starts and queued outbox retries, with focused composer-image tests.

Validation inherited from #3910: vp check and mobile native lint passed before the split. The full typecheck is currently blocked in this workspace by unavailable mobile dependencies (expo-blur, expo-quick-actions, and @tabler/icons-react-native).

Note

Fix composer image attachments to strip client-only fields before upload

Macroscope summarized 519da2d.

Note

Low Risk Narrow serialization fix at send boundaries with a unit test; no auth or persistence changes.

Overview Composer image drafts keep extra client fields (id, previewUri) for UI; startTurn expects UploadChatImageAttachment, which only includes type, name, mimeType, sizeBytes, and dataUrl.

This PR adds toUploadChatImageAttachments in composerImages.ts and uses it when building turn input in buildProjectThreadStartTurnInput (new threads / queued creation) and in use-thread-outbox-drain when retrying queued messages on existing threads. A unit test asserts the stripped wire shape.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 519da2dfc5a4c69b5c66520f9d408a0051ccd918. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      Important

      Review skipped

      Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

      ⚙️ Run configuration

      Configuration used: Repository UI

      Review profile: CHILL

      Plan: Pro

      Run ID: 589e1598-b5de-4f69-88be-792db14b0a60

      You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

      Use the checkbox below for a quick retry:

      • 🔍 Trigger review
      ✨ Finishing Touches
      🧪 Generate unit tests (beta)
      • Create PR with unit tests

      Comment `@coderabbitai help` to get the list of available commands.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted

    3. Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

      Fix All in Cursor Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start. Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 5209b64fac90b55253918f98f7918952cc2ae796. Configure [here](https://www.cursor.com/dashboard/bugbot).
      apps/mobile/src/lib/projectThreadStartTurn.ts line 58Resolvedby juliusmarminge
    4. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Approved

      Straightforward bug fix that strips client-only fields from image attachments before sending over the wire. The change is small, well-tested, and has clear intent with limited scope.

      You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    5. juliusmarminge merged this2a33a18

    6. juliusmarminge closed this

Sign in to join this conversation.