M1: IPC Contract Extensions + Swift Codegen#6907
Conversation
…Create Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Devin Review found 1 potential issue.
⚠️ 1 issue in files not directly in the diff
⚠️ Codegen INT_PATTERNS missing Ms suffix causes durationMs to be generated as Double instead of Int (assistant/scripts/ipc/generate-swift.ts:153-183)
The durationMs field in the new CuSessionFinalizedRecording struct is generated as Double in Swift, but it represents an integer millisecond value.
Root Cause
The Swift codegen at assistant/scripts/ipc/generate-swift.ts:153-183 uses heuristic INT_PATTERNS to decide whether a TypeScript number property should map to Swift Int or Double. Similar fields like sizeBytes match /[Ss]ize\w*$/ → Int, and expiresAt matches /At$/ → Int, but durationMs does not match any pattern, so it falls through to Double at line 265:
case 'number':
return shouldBeInt(propName) ? 'Int' : 'Double';
This produces public let durationMs: Double at clients/shared/IPC/Generated/IPCContractGenerated.swift:498 when it should be Int. Swift consuming code would need awkward Int(recording.durationMs) conversions, and the type is inconsistent with the semantic meaning (whole milliseconds).
Impact: Swift code consuming IPCCuSessionFinalizedRecording.durationMs gets a Double instead of Int, creating a type mismatch with the rest of the codebase where durations in ms are integers. Not a data-loss issue since Double can represent typical ms values exactly, but it causes friction and inconsistency.
View 4 additional findings in Devin Review.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fac0bcfabb
ℹ️ 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".
|
Addressed in #6910 |
…Create (#6907) Co-authored-by: Vellum Assistant <assistant@vellum.ai> Co-authored-by: Claude <noreply@anthropic.com>
…Create (#6907) Co-authored-by: Vellum Assistant <assistant@vellum.ai> Co-authored-by: Claude <noreply@anthropic.com>
…Create (#6907) Co-authored-by: Vellum Assistant <assistant@vellum.ai> Co-authored-by: Claude <noreply@anthropic.com>
…Create (#6907) Co-authored-by: Vellum Assistant <assistant@vellum.ai> Co-authored-by: Claude <noreply@anthropic.com>
…Create (#6907) Co-authored-by: Vellum Assistant <assistant@vellum.ai> Co-authored-by: Claude <noreply@anthropic.com>
…Create (#6907) Co-authored-by: Vellum Assistant <assistant@vellum.ai> Co-authored-by: Claude <noreply@anthropic.com>
Extends CuSessionCreate with reportToSessionId and qaMode fields. Adds CuSessionFinalized client→server message for QA recording finalization. Regenerates Swift IPC models and updates contract inventory. Part of #6899.