fix(logs): relax fileSchema so execution logs with files render again#4495
fix(logs): relax fileSchema so execution logs with files render again#4495waleedlatif1 merged 3 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview Deduplicates media tool contracts by switching STT/video file inputs from the removed Reviewed by Cursor Bugbot for commit 409ea56. Configure here. |
Greptile SummaryThis PR fixes a contract-validation regression that prevented execution logs with files from rendering in the logs UI. The root cause was a local
Confidence Score: 5/5Safe to merge — the change removes an over-strict validation constraint that was actively breaking a feature, consolidates duplicated schema definitions, and aligns the UI type with its authoritative source. All changed code is narrowly scoped to schema consolidation and type alignment. The No files require special attention. The only minor note is a cosmetic JSDoc ordering issue in Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Execution log API response\ncontains files array] --> B{Contract validation\nuserFileSchema}
B -->|uploadedAt / expiresAt absent\nBEFORE fix: FAIL| C[ApiClientError\nResponse failed contract validation]
B -->|passthrough tolerates\nextra / missing fields\nAFTER fix: PASS| D[WorkflowLogDetail\nwith files array]
D --> E[useLogDetail hook\nreturns data]
E --> F[FileCards rendered\nin log details UI]
C --> G[Query falls back to\nlist row — no files field]
G --> H[FileCards never rendered]
style C fill:#f88,stroke:#c00
style H fill:#f88,stroke:#c00
style D fill:#8f8,stroke:#080
style F fill:#8f8,stroke:#080
Reviews (2): Last reviewed commit: "improvement(contracts): promote userFile..." | Re-trigger Greptile |
- contracts/logs.ts: replace local fileSchema with mediaUserFileSchema (the established UserFile boundary schema with .passthrough()) - file-download.tsx: drop local FileData interface, use UserFile from @/executor/types
Move the canonical UserFile boundary schema out of tools/media/shared.ts (where it didn't belong — logs aren't media tools) into primitives.ts as userFileSchema. Update logs, stt, and video contracts to import from the shared primitive. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 409ea56. Configure here.
Summary
uploadedAtandexpiresAtoptional infileSchemaso contract validation passes for execution log rows whose files (written byextractFilesFromExecutionandexecution-file-manager) don't include those fieldsFileDatatype infile-download.tsx; switch its template literal className tocn()Before this fix,
useLogDetailwas throwingApiClientError("Response failed contract validation")on any workflow log with files, the query fell back to the list row (nofiles), and<FileCards>never rendered.Type of Change
Testing
Tested manually
Checklist