fix: optimize remote install artifact uploads#413
Conversation
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e02d908fde
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (preflight?.kind === 'direct-upload') { | ||
| await uploadDirectArtifact(prepared.payloadPath, preflight); | ||
| return await finalizeDirectUpload({ | ||
| normalizedBase, | ||
| token: options.token, | ||
| uploadId: preflight.uploadId, | ||
| }); |
There was a problem hiding this comment.
Fall back to legacy upload when direct ticket upload fails
When preflight returns a direct-upload ticket, any transient failure in uploadDirectArtifact or finalizeDirectUpload now aborts the install instead of using the existing /upload path. This makes an optional optimization a hard dependency: a bad/expired signed URL, storage-side 5xx, or finalize timeout will fail the command even though legacy upload could still succeed. The direct-upload branch should catch these failures and continue with uploadLegacyArtifact for reliability parity.
Useful? React with 👍 / 👎.
Summary
Optimize remote local install uploads by preparing the actual payload up front, gzipping app-bundle directory uploads, hashing the compressed payload, and supporting bridge preflight cache/direct-upload/finalize flows with legacy
/uploadfallback.Document the local-path vs existing-URL install decision for agents and add install-from-source coverage for Android URLs plus trusted GitHub artifact archives. Touched 9 files; scope stayed within remote install/upload handling, tests, skills, and docs.
Validation
pnpm formatpnpm check:quickpnpm test src/__tests__/upload-client.test.ts src/platforms/__tests__/install-source.test.tsAGENT_DEVICE_STATE_DIR=/tmp/agent-device-test-state-KQOVPi pnpm test:unit -- --maxWorkers=1AGENT_DEVICE_STATE_DIR=/tmp/agent-device-test-state-KQOVPi pnpm test:smoke