Repository navigation
chore(api): sync OpenAPI contract - #2535
internal-gt-public-api-sync[bot] wants to merge 2 commits into
Conversation
Review agent ran on
|
size-limit report 📦
|
| */ | ||
| export const createTag = <ThrowOnError extends boolean = false>( | ||
| options: Options<CreateTagData, ThrowOnError> | ||
| export const translateContent = <ThrowOnError extends boolean = false>( |
There was a problem hiding this comment.
⛔ 1. Removed SDK exports are still imported by api wrappers and core
This regeneration replaces translate with translateContent and drops about 20 other exports (getTranslationJobInfo, createTag, getProjectInfo, uploadTranslations, ...), but packages/api/src/wrappers/awaitJobs.ts:2 (re-exported from packages/api/src/index.ts:1), packages/core/src/translate/runtimeTranslate.ts:3, and packages/core/src/adapter/createGtApi.ts:1-47 still import them. As a result, both @generaltranslation/api and generaltranslation fail to build, and their ESM named imports fail at load. Migrate these consumers in this PR or keep compatibility exports. A patch changeset also understates this breaking change.
—
Tag @inspect in this thread to discuss.
| { scheme: 'bearer', type: 'http' }, | ||
| ], | ||
| url: '/v2/project/files/info', | ||
| url: '/v2/projects/{projectId}/files', |
There was a problem hiding this comment.
⛔ 2. Project-scoped routes are called without the projectId path param
uploadSourceFiles and the retained branch, publish, translation-upload, and context helpers now target /v2/projects/{projectId}/..., but packages/core/src/adapter/createGtApi.ts:614 and the sibling calls pass only body/client. URL substitution runs only when options.path is set (packages/api/src/generated/core/utils.gen.ts:103), so these requests go to a literal {projectId} URL. Pass path: { projectId } from the configured client in each caller.
—
Tag @inspect in this thread to discuss.
Comments Outside DiffThese findings could not be posted inline.
|
There was a problem hiding this comment.
Caution
The regenerated SDK breaks the API package build and job polling because handwritten consumers still target the removed contract.
Reviewed changes Reviewed the contract sync, regenerated SDK/types, release changeset, and compatibility with existing consumers.
- Canonical routes: Replaces legacy project operations with project-scoped file, branch, tag, translation, and job endpoints, plus organization-scoped asset uploads.
- Contract schemas: Adds the
2026-10-08.v1version, named error codes, revised batch/job responses, branch metadata, context auto-update settings, and Google Sheets support. - SDK release: Regenerates the SDK and adds an API patch changeset; isolated regeneration reproduces the committed output exactly.
gpt-6-astra | 𝕏
| * | ||
| * Get the status of file translation and context generation jobs by ID. Requires `project:files:read`. | ||
| */ | ||
| export const queryJobs = <ThrowOnError extends boolean = false>( |
There was a problem hiding this comment.
[P1] Migrate handwritten consumers with the generated contract
getTranslationJobInfo is removed, but awaitJobs.ts still imports and calls it: the API build fails with [MISSING_EXPORT], and the polling test throws getTranslationJobInfo is not a function. Core's adapter and runtime translator likewise retain removed operations and legacy request/response shapes, so this sync cannot ship as standalone SDK regeneration.
Technical details
# Consumer migration is missing
## Affected sites
- https://github.com/generaltranslation/gt/blob/f4a756cccfb1a1852ee228b7da11b7c087f12721/packages/api/src/wrappers/awaitJobs.ts#L1-L41 imports the deleted operation and `GetTranslationJobInfoResponse`.
- https://github.com/generaltranslation/gt/blob/f4a756cccfb1a1852ee228b7da11b7c087f12721/packages/core/src/adapter/createGtApi.ts#L1-L47 imports other deleted operations/types, including `downloadFiles`, `enqueueFileTranslations`, `getBranchInfo`, `getProjectInfo`, and `uploadAssets`.
- https://github.com/generaltranslation/gt/blob/f4a756cccfb1a1852ee228b7da11b7c087f12721/packages/core/src/translate/runtimeTranslate.ts#L1-L8 still imports `translate` and `TranslateData`.
## Required outcome
- Update the handwritten wrappers, core consumers, and affected tests together with this contract migration.
- Adapt requests and responses, not only names: `queryJobs` requires `path.projectId`, accepts `{ jobs: [{ id }] }`, and returns `{ results }` with `id`/`not_found` instead of the legacy array with `jobId`/`unknown`.
- Cover retained operations too: branch creation now uses `name`/`isDefault`; uploads return `results` rather than `uploadedFiles`; runtime translation returns a `translations` envelope and string error codes. Preserve or deliberately migrate the existing public core/CLI behavior.
## Reproduction
- `pnpm --filter @generaltranslation/api build` fails: `[MISSING_EXPORT] "getTranslationJobInfo" is not exported by "src/generated/sdk.gen.ts"`.
- `pnpm --filter @generaltranslation/api typecheck` fails on removed exports.
- `pnpm --filter @generaltranslation/api test` reports 47 passed and 2 failed, including the runtime polling failure and pagination type test, plus source type errors.
- SDK regeneration itself is current; regenerating again does not fix the missing consumer migration.f4a756c to
5101ec1
Compare
| @@ -97,7 +179,7 @@ export type RuntimeTranslationResponse = { | |||
| | { | |||
| success: false; | |||
| error: string; | |||
| code: number; | |||
| code: ErrorCode; | |||
There was a problem hiding this comment.
⛔ 3. Runtime error code changes from number to string ErrorCode, breaking core
The failure variant's code is now the string enum ErrorCode (e.g. 'file_too_large'). toTranslationResult at packages/core/src/translate/runtimeTranslate.ts:242 still returns that result directly as TranslationResult, whose error variant requires code: number (packages/core/src/types-dir/api/translate.ts:37). This fails core's type build, and any consumer that compares numeric status codes would get the wrong answer. Either convert at this boundary or migrate core's error contract.
—
Tag @inspect in this thread to discuss.
da309fd to
1a7f4be
Compare
There was a problem hiding this comment.
Stale comment
Risk: high. Not approved: this PR changes the public OpenAPI contract and generated SDK, which is an irreversible public-interface update outside the low-risk, small-blast-radius bar. Human review is needed and no reviewers were assigned.
Sent by Cursor Approval Agent: Pull Request Router
There was a problem hiding this comment.
Caution
No new issues found in this delta. The existing consumer-migration blocker remains unresolved: the API build still fails with [MISSING_EXPORT] "getTranslationJobInfo" is not exported by "src/generated/sdk.gen.ts".
Reviewed changes Reviewed the provider-removal delta against the previously reviewed snapshot; a direct snapshot comparison isolated it from unchanged contract churn in the supplied range-diff.
- Removed
HYPERCLOVAfrom the contract:ModelProvidernow contains four providers; core and CLI validation derive their allowed values from the generated enum. - Updated the generated provider enum: Isolated SDK regeneration exactly matches the committed files. API tests still report 47 passed and 2 failed, reproducing the existing polling and pagination-type failures.
gpt-6-astra | 𝕏
7728697 to
539b9a8
Compare
There was a problem hiding this comment.
Caution
The new media formats introduce downstream type errors and unsafe binary-content handling. The existing consumer-migration blocker also remains unresolved.
Reviewed changes Reviewed the media-format delta against 77286978b, using a direct snapshot comparison to separate it from unchanged range-diff churn; the supplied full diff omits the spec/type hunks, so the missing consumer changes are detailed below.
- Added media formats: Extended the contract's
FileFormatand upload/translation request enums withPNG,JPEG, andMP4. - Regenerated SDK types: Propagated those formats into the generated TypeScript contract; isolated regeneration matches the committed output exactly.
🚨 Binary media still uses text encoding
Core's binary-format classification still contains only LOTTIE, so the newly accepted media formats are double-encoded on upload and decoded as UTF-8 on download. Running the actual content helpers with a PNG signature confirms that upload sends the base64 text rather than the original bytes, while download replaces byte 0x89 with the Unicode replacement character.
Technical details
# Preserve bytes for newly accepted media formats
## Affected sites
- `packages/api/src/generated/types.gen.ts:2987-2989` now accepts PNG/JPEG/MP4 source uploads; equivalent additions appear in translation uploads.
- `packages/core/src/types-dir/api/file.ts:18-20` omits these formats from `BINARY_FILE_FORMATS`.
- `packages/core/src/utils/base64.ts:33-44` selects UTF-8 encode/decode for every format outside that set.
- `packages/core/src/adapter/createGtApi.ts:590,619,666,672-675` applies these helpers to downloads and source/translation uploads.
## Reproduction
- `encodeFileContent('iVBORw0KGgo=', 'PNG')` returns `aVZCT1J3MEtHZ289`, not the original base64 payload.
- `decodeFileContent('iVBORw0KGgo=', 'PNG')` returns a text string beginning with U+FFFD, losing the original byte.
- LOTTIE preserves the same base64 input in both directions.
## Required outcome
- Classify PNG/JPEG/MP4 as binary and preserve their base64 content end-to-end, independently of the existing canonical-route migration.
- Add upload pass-through and download byte-preservation coverage for the new formats. The existing base64 tests cover text and LOTTIE only.⚠️ Exhaustive format maps omit the new members
Core's transformation map and CLI's extension map remain exhaustive Record<FileFormat, ...> values without PNG, JPEG, or MP4. Typechecking these consumers against the current sources produces TS1360 and TS7053 in both files, adding build errors independent of the previously reported removed SDK exports.
Technical details
# Complete downstream mappings for the expanded FileFormat
## Affected sites
- `packages/api/src/generated/types.gen.ts:105-107` expands the shared enum/type.
- `packages/core/src/utils/isSupportedFileFormatTransform.ts:25,37` lacks all three entries in `SUPPORTED_TRANSFORMATIONS`.
- `packages/cli/src/formats/files/transformFormat.ts:87,157` lacks all three entries in `FILE_FORMAT_EXTENSIONS`.
## Required outcome
- Define the supported transformations and output extensions for every added format while retaining exhaustive typing, or explicitly narrow a consumer if those formats are intentionally unsupported there.
- Verify both downstream consumers against the regenerated types; regeneration alone cannot validate these maps.
## Validation
- A targeted TypeScript program using current-source workspace aliases reproduced the missing-property and indexing diagnostics in both files, bypassing the separate API-build blocker.
- The 22 existing core base64/transformation tests pass but do not exercise these formats.
- `pnpm --filter @generaltranslation/api build` still fails with `[MISSING_EXPORT] "getTranslationJobInfo" is not exported by "src/generated/sdk.gen.ts"`.
- API tests still report 47 passed, 2 failed, and 3 unhandled source type errors, reproducing the prior blocker.gpt-6-astra | 𝕏
147a468 to
05acb40
Compare
|
🔎 Inspect session ⚙️ Adjust settings Warning Inspect paused reviews to save money Reviewing this Pull Request has costed $11.59 so far, and further reviews are on hold. Commits made after this notice do not trigger Inspect reviews unless you resume automatic reviews below.
|
0f19b77 to
5e9ff98
Compare
There was a problem hiding this comment.
Caution
No new issues found in this delta. The existing consumer-migration blocker and media-format findings remain unresolved; the API build still fails because getTranslationJobInfo is no longer exported.
Reviewed changes Reviewed the changes since snapshot 3466673e6, including the latest SDK regeneration; a direct snapshot comparison and complete JSON comparison separated the actual changes from range-diff and formatting noise.
- Added structured failures: Workspace plugin translation now includes per-locale failure messages and codes, plus billing and additional validation error responses.
- Refined error contracts: Narrowed endpoint-specific error-code unions and removed selected status responses, with matching generated types.
- Added request examples: Documented representative locale, content, filename, and context inputs without changing request constraints.
Isolated SDK regeneration matches the committed output, and reference/error-example consistency checks pass. API tests reproduce the existing failures: 47 passed, 2 failed, and 3 unhandled source type errors. Backend behavior was not exercised.
gpt-6-astra | 𝕏
bba9ee6 to
57bb68d
Compare
There was a problem hiding this comment.
Important
The CLI’s saved-edit payload no longer satisfies the overwrite contract, and the public SDK still requires fileFormat for uploads that the contract now accepts without it.
Reviewed changes Compared bba9ee60 with the prior review at e1097286 and checked the changed requests against the SDK and its consumers.
- Replaced the overwrite payload:
overwriteTranslationsnow takestranslationscontaining base64 content or an upload reference, instead ofdiffscontaining rawlocalContent. - Extended organization asset uploads: Added
createAssetUploadsfor up to ten fonts and allowedupsertAssetsto register their hashes. Both upserts and overwrites now distinguish an oversized item from a batch rejected withfile_too_large. - Relaxed project upload registration: Made
fileFormatoptional for files up to 150,000,000 bytes according to the contract description.
Isolated regeneration matched all 16 SDK files. Schema validation and TypeScript probes reproduced the findings inline; the API package typecheck also still fails on the previously reported removed exports.
gpt-6.2-astra | 𝕏
| * Replace 1–100 existing translations with full translated file content. Requires `project:files:write`. | ||
| */ | ||
| export const overwriteTranslations = <ThrowOnError extends boolean = false>( | ||
| options: Options<OverwriteTranslationsData, ThrowOnError> |
There was a problem hiding this comment.
Core still sends CLI saved edits as { diffs: [{ diff, localContent, … }] }. That body validated against the previous overwrite schema; it now fails with 'translations' is a required property, so changing the SDK call name and project path alone will not restore saved edits.
Technical details
# Adapt saved edits at the wire boundary
## Affected sites
- `packages/core/src/adapter/createGtApi.ts:550-578` constructs the old body; `packages/core/src/adapter/__tests__/createGtApi.test.ts:415-445` asserts it.
- `packages/cli/src/api/collectUserEditDiffs.ts:403-487` supplies the full edited text in `localContent`, including extracted locale-specific content.
- `packages/api/spec/openapi.json:9651-9718` now requires `translations` with selectors and exactly one of `content` or `upload`.
## Required outcome
- Preserve the public saved-edit input, but send each selector with the full UTF-8 `localContent` encoded as base64, or a project upload reference when the request would exceed the inline limit. Do not send the unified diff as replacement content.
- Exercise a saved edit through the adapter and assert that decoding the outgoing content reproduces the edited text.| export const downloadFiles = <ThrowOnError extends boolean = false>( | ||
| options: Options<DownloadFilesData, ThrowOnError> | ||
| export const createFileUploads = <ThrowOnError extends boolean = false>( | ||
| options: Options<CreateFileUploadsData, ThrowOnError> |
There was a problem hiding this comment.
The generated createFileUploads accepts a one-byte file with just sha256 and size, but importing createFileUploads from @generaltranslation/api selects a handwritten wrapper that still requires fileFormat. Passing the package’s own CreateFileUploadsData['body'] to its public function produces TS2322.
Technical details
# Align the package-root upload helper with the generated request
## Affected sites
- `packages/api/src/index.ts:12-16,29` explicitly exports the wrapper ahead of the generated wildcard export.
- `packages/api/src/wrappers/fileUploads.ts:60-72` duplicates the request type and requires `fileFormat` for every file.
## Required outcome
- Accept the generated request body at the public entry point, for example by typing the wrapper body as `CreateFileUploadsData['body']`. Preserve the version header for existing callers that rely on the wrapper to supply it.
- Typecheck the formatless small-file case through the package root, not just the generated module.| * Create file uploads | ||
| * | ||
| * Download up to 100 source or translated files in one request. | ||
| * Get presigned URLs to PUT 1–100 files (media up to 2GB, others 150MB) that a later request names by `upload`; use one when that request would be over 4MB. Requires `project:files:write`. |
There was a problem hiding this comment.
The schema now allows omitting fileFormat at any size, although the field description requires it above 150,000,000 bytes. A formatless 150,000,001-byte file passes OpenAPI validation, so callers validating locally cannot detect that they need to supply the media format.
Technical details
# Encode the size-dependent request rule
## Affected sites
- `packages/api/spec/openapi.json:15071-15094` sets a 2,000,000,000-byte maximum and requires only `size` and `sha256`; no conditional rule requires `fileFormat`.
## Required outcome
- In the upstream file-item schema, require `fileFormat` above 150,000,000 bytes. Verify that the formatless case validates at the threshold and fails one byte above it, while eligible media with an explicit format still validates.| options: Options<CreateAssetUploadsData, ThrowOnError> | ||
| ) => | ||
| options.client.post< | ||
| CreateAssetUploadsResponses, |
There was a problem hiding this comment.
createAssetUploads documents a PUT target when status is upload_required, but its success schema validates { sha256, status: 'upload_required' } without a target. Even after checking the status, a typed caller gets TS18048 on file.upload.url.
Technical details
# Make the PUT target required when the caller must upload
## Affected sites
- `packages/api/spec/openapi.json:36214-36245` requires only `sha256` and `status` for both outcomes.
- `packages/api/src/generated/types.gen.ts:8860-8883` consequently exposes `upload?` independently of `status`.
## Required outcome
- Model the response item as status-specific variants upstream and regenerate. An `exists` result can omit the target; an `upload_required` result must carry its URL, headers, and expiry.There was a problem hiding this comment.
Important
The three new Webflow operations document account and site recovery fields that their generated error types omit. A panel using the SDK cannot read the account-link URL from a typed 401 response.
Reviewed changes Compared efceede7 with the prior review at bba9ee60 and checked the Webflow contract against the generated SDK.
- Extended
webflowPanelInfo: Added primary and secondary site locales to the success response and502 upstream_errorto the error responses. - Added resource discovery, translation, and status: Verified that page, component, and CMS item identifiers returned by
webflowPanelSiteResourcestypecheck as inputs to bothwebflowPanelTranslateandwebflowPanelStatus. - Regenerated the SDK: Independent generation matched all 16 committed files. The package typecheck still fails on previously reported removed exports, including
getTranslationJobInfo.
gpt-6.2-astra | 𝕏
| UpdateProjectInfoResponses, | ||
| UpdateProjectInfoErrors, | ||
| WebflowPanelTranslateResponses, | ||
| WebflowPanelTranslateErrors, |
There was a problem hiding this comment.
The recovery-field issue in info and link-site now also affects translate, status, and site-resources. On all three, reading linked or linkUrl from a typed 401, or connected from a typed 404, produces TS2339, even though the response descriptions tell the panel to use those fields.
Technical details
# Type the Webflow recovery responses
## Affected sites
- `packages/api/spec/openapi.json:9504,9614,10087,10197,10588,10698` — the six new JSON response schemas constrain only `ErrorResponse.code`.
- `packages/api/src/generated/types.gen.ts:2269,2285,2403,2419,2509,2525` — a focused TypeScript check reproduced the missing properties on each operation.
## Required outcome
- Model the recovery cases in the upstream contract and regenerate: the unlinked-account variant carries `linked: false` and a string `linkUrl`; the unconnected-site variant carries `connected: false`.
- Keep ordinary `401` and `404` responses valid without those fields, and verify a typed caller can narrow to each recovery case.There was a problem hiding this comment.
Important
The Webflow recovery-field issue now affects all three new operations. Each documents a linkUrl for an unlinked account and connected: false for an unconnected site, but none exposes those fields in its generated error types. Please include translate, status, and site-resources in the existing fix so a typed panel can guide users through setup.
Reviewed changes Compared efceede7 with the previously reviewed contract at bba9ee60.
- Added resource discovery and translation:
site-resourcesreturns labeled page, component, and CMS item selectors.translateaccepts those selectors and reports which resource-locale pairs were queued or failed;statusreports progress by locale. - Extended panel info:
infonow returns primary and secondary site locales and declares502 upstream_error. - Verified the SDK: Isolated regeneration matched all 16 generated files, and 16 schema checks passed. A TypeScript check reproduced the missing recovery fields on each new operation. The package typecheck still fails on the previously reported polling and pagination imports.
gpt-6.2-astra | 𝕏
| export const updateProjectInfo = <ThrowOnError extends boolean = false>( | ||
| options: Options<UpdateProjectInfoData, ThrowOnError> | ||
| export const webflowPanelTranslate = <ThrowOnError extends boolean = false>( | ||
| options: Options<WebflowPanelTranslateData, ThrowOnError> |
There was a problem hiding this comment.
webflowPanelTranslate requires propertyKinds, but the contract only describes a map of maps of strings. Please document what the outer key, inner key, and value represent in the upstream schema, with one populated example and when to pass {}; otherwise a caller has to consult the panel implementation to construct this required field.
efceede to
f32cd9f
Compare
There was a problem hiding this comment.
Stale comment
Risk: high. Left a non-blocking comment. This OpenAPI contract sync is an irreversible public API interface change with a large blast radius, so it is above the low-risk approval bar and needs human review; no reviewers were assigned. Cursor Bugbot and Cursor Security Agent were not present on this head.
Sent by Cursor Approval Agent: Pull Request Router
6edd89c to
cc8c24e
Compare
There was a problem hiding this comment.
Stale comment
Risk: high. Left a non-blocking comment; this PR was not approved. It updates the public OpenAPI contract and generated SDK, which is above the low-risk threshold and needs human review of an irreversible public interface. Human review is needed and no reviewers were assigned.
Sent by Cursor Approval Agent: Pull Request Router
4a1ac25 to
22121c4
Compare
There was a problem hiding this comment.
Stale comment
Risk: high. Left a non-blocking comment; this PR was not approved. It updates the public OpenAPI contract, an irreversible public-interface change above the low-risk, small-blast-radius bar. Human review is needed and no reviewers were assigned.
Sent by Cursor Approval Agent: Pull Request Router
There was a problem hiding this comment.
Stale comment
Risk: high. Left a non-blocking comment; this PR was not approved. It updates the public OpenAPI contract, an irreversible public-interface change above the low-risk, small-blast-radius bar. Human review is needed and no reviewers were assigned.
Sent by Cursor Approval Agent: Pull Request Router
There was a problem hiding this comment.
Caution
Core treats WEBP, TIFF, and BMP as text. Its upload helper double-encodes image content, and its download helper can replace image bytes during UTF-8 decoding.
Reviewed changes Compared the contract and generated SDK with the previously reviewed head, 4a1ac258.
- Added three image formats to the shared OpenAPI
FileFormatenum. Every other parsed contract value matched the previous revision. - Regenerated the SDK enum with the same three values. The other 15 generated files matched the previous revision byte for byte.
🚨 Core corrupts binary content for all three new formats
Core’s binary-format set contains only LOTTIE. In a local probe with each new format, decoding the upload payload once produced the ASCII bytes of the base64 string. On download, the same helpers turned non-UTF-8 image bytes into replacement characters. This extends the earlier media-format finding.
Technical details
# Preserve image bytes across transfers
## Affected sites
- `packages/api/spec/openapi.json:205` adds the new formats. The generated values start at `packages/api/src/generated/types.gen.ts:111`.
- `packages/core/src/types-dir/api/file.ts:18` controls the binary branches in `packages/core/src/utils/base64.ts:48` and `:55`. The core adapter uses those branches at `packages/core/src/adapter/createGtApi.ts:769` and `:741`.
- With `BMP` and base64 input `Qk02AAAA/+4=`, the upload payload decoded once starts with hex `51 6b` (the characters `Qk`). The original bytes start with `42 4d` (the BMP signature). The same probe preserved the input bytes with the `LOTTIE` control.
## Required outcome
- Classify all three image formats as binary and verify that uploads and downloads preserve their bytes, including values above 0x7f.⚠️ Core and CLI format maps omit the new enum values
Core rejects identity transforms for all three formats. The CLI’s extension helper returns undefined for each, so its path-rewriting helper produces names such as image.undefined. A focused TypeScript check against the regenerated SDK also reproduced TS1360 at both exhaustive maps.
Technical details
# Complete the format maps
## Affected sites
- `packages/core/src/utils/isSupportedFileFormatTransform.ts:25` declares the exhaustive transform map. For example, `isSupportedFileFormatTransform('TIFF', 'TIFF')` returns false.
- `packages/cli/src/formats/files/transformFormat.ts:87` declares the exhaustive extension map. At line 163, `replaceFileExtensionForFormat('image.src', 'TIFF')` produces `image.undefined`.
## Required outcome
- Include the three new formats in the existing media-format migration. Each should support its identity transform and resolve to its intended file extension.gpt-6.2-astra | 𝕏
b416199 to
a9d3e93
Compare
There was a problem hiding this comment.
Stale comment
Risk: high. Left a non-blocking comment; this PR was not approved. It updates the public OpenAPI contract, an irreversible public-interface change above the low-risk, small-blast-radius bar. Human review is needed and no reviewers were assigned.
Sent by Cursor Approval Agent: Pull Request Router
There was a problem hiding this comment.
Stale comment
Risk: high. Left a non-blocking comment; this PR was not approved. It updates the public OpenAPI contract, an irreversible public-interface change above the low-risk, small-blast-radius bar, so human review is needed and no reviewers were assigned. Cursor Bugbot and Cursor Security Agent were not present.
Sent by Cursor Approval Agent: Pull Request Router
There was a problem hiding this comment.
Caution
Core corrupts image content for all three newly advertised formats. The CLI also produces filenames ending in .undefined for them. This extends the previous media-format finding.
Reviewed changes
I reviewed both commits since b4161997.
- Added
AVIF,HEIC, andGIFto the shared OpenAPIFileFormatenum. - Regenerated the TypeScript enum with the same values. I verified that the complete generated enum matches the contract.
🚨 Core treats the new image formats as UTF-8 text
For each format, the upload helper encoded the base64 input a second time. The download helper replaced non-UTF-8 bytes with U+FFFD. The same bytes round-tripped through the LOTTIE control.
Technical details
# Preserve binary content for AVIF, HEIC, and GIF
## Affected sites
- `packages/core/src/types-dir/api/file.ts:18` classifies only `LOTTIE` as binary. This selects the text branches in `packages/core/src/utils/base64.ts:48` and `:55`.
- `packages/core/src/adapter/createGtApi.ts:741` uses the decode helper on downloads. Lines 769, 849, and 855 use the encode helper for uploads.
- With bytes beginning `47 49 46` (GIF), decoding the outgoing payload once produced `52 30 6c`, the start of the ASCII base64 string.
## Required outcome
- Include all three formats in the binary classification and verify byte preservation in both directions with input that includes non-UTF-8 bytes.⚠️ Core and CLI format maps omit all three additions
The CLI recognizes each new format, but its filename helper rewrote image.input to image.undefined for all three. Core also rejected each format’s identity transform. A focused TypeScript check reported TS1360 at both exhaustive maps.
Technical details
# Complete the format maps for the expanded enum
## Affected sites
- `packages/core/src/utils/isSupportedFileFormatTransform.ts:25` declares the transform map. Its lookup returns false for each new format paired with itself.
- `packages/cli/src/formats/files/transformFormat.ts:87` declares the extension map used by `replaceFileExtensionForFormat`.
## Required outcome
- Add the supported identity transforms and output extensions for all three formats. Verify the filename helper returns the intended suffix for each.gpt-6.2-astra | 𝕏
7e58379 to
ffecae7
Compare
There was a problem hiding this comment.
Stale comment
Risk: high. Not approved: this PR updates the public OpenAPI contract, an irreversible public-interface change outside the low-risk, small-blast-radius bar. Cursor Bugbot and Cursor Security Agent were not present; human review is needed and no reviewers were assigned.
Sent by Cursor Approval Agent: Pull Request Router
There was a problem hiding this comment.
Stale comment
Risk: high. Not approved: this updates the public OpenAPI contract and generated SDK, which is an irreversible public interface change and above the low-risk approval threshold. Human review is needed, and no reviewers were assigned. Bugbot and Security Agent were not running on this PR.
Sent by Cursor Approval Agent: Pull Request Router
There was a problem hiding this comment.
Caution
The SDK now accepts MP3, but core’s upload and download helpers corrupt its audio bytes. This extends the previous media-format finding to MP3.
Reviewed changes
The two commits since 7e583790 add one file format.
- Added
MP3to the OpenAPIFileFormatenum. - Regenerated the SDK enum and verified that its values match the contract.
🚨 Core treats MP3 audio as UTF-8 text
I passed the MPEG frame header ff fb 90 64 through the core helpers as base64. Decoding the upload payload once yielded the eight ASCII characters //uQZA==; the download helper produced three Unicode replacement characters followed by d. The existing LOTTIE binary path preserved the same input in both directions.
Technical details
## Affected sites
- `packages/core/src/types-dir/api/file.ts:18` classifies only `LOTTIE` as binary.
- `packages/core/src/utils/base64.ts:48` and `:55` select the upload and download encoding. The adapter calls them at `packages/core/src/adapter/createGtApi.ts:741`, `:769`, `:849`, and `:855`.
- The CLI uses the same classifier when reading from disk at `packages/cli/src/fs/fileContent.ts:59` and writing downloaded bytes at `packages/cli/src/api/downloadFileBatch.ts:300`.
## Required outcome
- Classify `MP3` as binary and verify that the upload payload decodes to the original bytes and the download path writes those bytes intact.⚠️ The core transform and CLI extension maps omit MP3
The CLI recognizes MP3 as a valid API format, yet the filename helper rewrote track.input to track.undefined. Core also returned false for the MP3 to MP3 identity transform.
Technical details
## Affected sites
- `packages/core/src/utils/isSupportedFileFormatTransform.ts:25` requires a transform entry for every `FileFormat`.
- `packages/cli/src/formats/files/transformFormat.ts:87` requires an extension for every `FileFormat`. Both maps report `TS1360` when checked against the generated union.
## Required outcome
- Include the MP3 identity transform and the `mp3` output extension in the corresponding maps. Verify that `replaceFileExtensionForFormat('track.input', 'MP3')` returns `track.mp3`.gpt-6.2-astra | 𝕏
fcfb36d to
88dbe9e
Compare
There was a problem hiding this comment.
Stale comment
Risk: high. Left a non-blocking comment; this PR was not approved. It updates the public OpenAPI contract, which is an irreversible public-interface change above the low-risk, small-blast-radius bar, so human review is needed and no reviewers were assigned.
Sent by Cursor Approval Agent: Pull Request Router
There was a problem hiding this comment.
Risk: high. Left a non-blocking comment; this PR was not approved. It updates the public OpenAPI contract and generated SDK, which is an irreversible public-interface change above the low-risk approval threshold and needs human review. No reviewers were assigned. Cursor Bugbot and Cursor Security Agent were not present after the first check poll, so those signals were skipped.
Sent by Cursor Approval Agent: Pull Request Router
There was a problem hiding this comment.
Important
queryFiles promises a review array for every found translation, but its response schema accepts one without it. Strict TypeScript consumers encounter the same gap in the SDK.
Reviewed changes
Reviewed the contract sync and SDK regeneration since fcfb36d6.
- Added review tasks to file status. Each translation now requires a
reviewsarray, which can be empty. Tasks include their status, completion time, deadline, dashboard link, and nullable assignee and approver. When present, each participant includes an email address visible to clients withproject:files:read. - Added reviews to batch file queries. The contract documents the array for found translations. I checked the generated types and validated sample responses for both operations.
Non-blocking
- A review task can report contradictory completion data. The schema accepts both a completed task with
completedAt: nulland an open task with a completion timestamp. Model the two documented states together so checkingstatus === 'completed'also gives SDK callers a timestamp they can pass toDate.parse. Translation review schema
gpt-6.2-astra | 𝕏
| GetOrphanedFilesErrors, | ||
| ThrowOnError | ||
| >({ | ||
| options.client.post<QueryFilesResponses, QueryFilesErrors, ThrowOnError>({ |
There was a problem hiding this comment.
A found translation with a
locale passes schema validation even when reviews is missing. The contract promises an array in this case, but after checking row.status === 'found' && row.locale !== undefined, a strict SDK caller still gets TS18048 on row.reviews.map(...).
Technical details
# Require reviews on found translations
## Affected sites
- `packages/api/spec/openapi.json:12822` promises a review array for a found translation, including an empty array when it has no tasks. The result schema at line 12825 only requires `status` and `fileId`.
- `packages/api/src/generated/types.gen.ts:3200` declares `reviews?` for every query result. The corresponding single-file status response at line 2731 already exposes a required array.
## Required outcome
- Model the found translation as a distinct result variant in the upstream contract and regenerate the SDK. A found translation with a locale must carry `reviews`, and an empty array must validate. Preserve source, pending, and missing results that omit the field.


Syncs the generated GT API contract from
dcbb0bf505d7f71cd8806743d4d3af2881132728.The generated SDK is updated in this pull request by public-repository CI.