Repository navigation
Internal cleanup - #33670
Internal cleanup#33670
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
Walkthrough
Priority: Merge Risk:
|
There was a problem hiding this comment.
Actionable comments posted: 2

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
04edd59e-746d-44e8-b36c-df89ba53f19a
Files ignored due to path filters: 1-
cloud/pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
Files selected for processing: 18-
cloud/packages/connector-contract/package.jsoncloud/packages/connector-contract/src/connector-endpoints.tscloud/packages/connector-contract/src/connector-host-proof-vector.jsoncloud/packages/connector-contract/src/connector-host-proof-vector.test.tscloud/packages/connector-contract/src/connector-limits.tscloud/packages/connector-contract/src/connector-wire-scalars.tscloud/packages/connector-contract/src/contract.test.tscloud/packages/connector-contract/src/delivery-messages.tscloud/packages/connector-contract/src/event-messages.tscloud/packages/connector-contract/src/hello-messages.tscloud/packages/connector-contract/src/host-auth-messages.tscloud/packages/connector-contract/src/index.tscloud/packages/connector-contract/src/sign-in-messages.tscloud/packages/connector-contract/tsconfig.build.jsoncloud/packages/connector-contract/tsconfig.jsonconfig/scripts/check-test-file-runners.mjssrc/main/runtime/connector-host-proof-vector.test.tssrc/shared/connector-cloud-contract.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
-
| unsettled: z | ||
| .array(z.object({ deliveryId: OpaqueIdSchema, conversation: ConnectorConversationSchema })) | ||
| .optional(), | ||
| deliveries: z.array(ConnectorDeliverySchema).max(CONNECTOR_LIMITS.maxDeliveriesPerPoll), |
There was a problem hiding this comment.
🔎 Supported by static analysis
-
Script executed:
cat cloud/packages/connector-contract/src/delivery-messages.ts rg -n 'unsupported|unknown|kind' cloud/packages/connector-contract/src/contract.test.tsRepository: stablyai/orca
Length of output: 4365
Stop unknown delivery kinds from rejecting the whole poll.
ConnectorPollResponseSchema validates deliveries as z.array(ConnectorDeliverySchema). A delivery whose kind is not start, send, answer, or cancel fails the discriminated union. That failure rejects the whole poll response. The comment above ConnectorDeliverySchema says the machine settles such a delivery as {outcome:'unsupported'}. The schema does not do this, so the machine cannot acknowledge the unknown entry or process the other deliveries in the same poll.
Parse the poll envelope first. Then validate each delivery separately. Settle an unreadable delivery as unsupported when its deliveryId is readable, and keep the other deliveries. This keeps mixed-version clients compatible when the cloud adds a new kind.
The package is inert today, so this defect has no runtime effect yet. It becomes active when a consumer wires the contract.
| .array(z.object({ deliveryId: OpaqueIdSchema, conversation: ConnectorConversationSchema })) | ||
| .optional(), | ||
| deliveries: z.array(ConnectorDeliverySchema).max(CONNECTOR_LIMITS.maxDeliveriesPerPoll), | ||
| control: PollControlSchema.optional() |
There was a problem hiding this comment.
🔎 Supported by static analysis
-
Script executed:
sed -n '1,90p' cloud/packages/connector-contract/src/delivery-messages.ts rg -n 'control|Control' cloud/packages/connector-contract/src/contract.test.ts
Repository: stablyai/orca
Length of output: 3672
Script executed:
set -o pipefail printf '%s\n' '--- contract.test.ts ---' nl -ba cloud/packages/connector-contract/src/contract.test.ts | sed -n '1,110p' printf '%s\n' '--- schema references ---' rg -n -F --glob '*.ts' -e 'ConnectorPollResponseSchema' -e 'PollControlSchema' -e 'connector-contract' cloud src || test "$?" -eq 1 printf '%s\n' '--- package files ---' rg --files cloud/packages/connector-contract | sort
Repository: stablyai/orca
Length of output: 6699
Ignore controls without a recognized shape.
PollControlSchema accepts only three control shapes. .optional() permits an absent control, but a present control with no recognized shape still causes ConnectorPollResponseSchema to fail. This can hide valid deliveries from mixed-version clients. The contract is not currently consumed, so the impact is limited to future interoperability.
Suggested fix
-
--- "a/cloud/packages/connector-contract/src/delivery-messages.ts" +++ "b/cloud/packages/connector-contract/src/delivery-messages.ts" @@ -47,7 +47,7 @@ .array(z.object({ deliveryId: OpaqueIdSchema, conversation: ConnectorConversationSchema })) .optional(), deliveries: z.array(ConnectorDeliverySchema).max(CONNECTOR_LIMITS.maxDeliveriesPerPoll), - control: PollControlSchema.optional() + control: PollControlSchema.optional().catch(undefined) }) export const ConnectorDeliveryResultSchema = z.discriminatedUnion('outcome', [
Add a regression test that supplies an unrecognized control and asserts that parsing succeeds with
data.controlundefined.
Committable suggestion
-
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.Suggested changecontrol: PollControlSchema.optional() control: PollControlSchema.optional().catch(undefined)
…blank question text and labels
…ginal never undoes newer state
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to GitHub limitations.

Minor · Build @orca-cloud/push-contract before connector-contract typecheck and… · package.json:14-17
cloud/packages/connector-contract/package.json:14-17
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winBuild
@orca-cloud/push-contractbefore connector-contract typecheck and build.A direct
pnpm typecheckorpnpm buildincloud/packages/connector-contractcan fail in a fresh checkout.@orca-cloud/push-contractexposesdist/index.d.ts, but itsdistdirectory is not tracked. Onlypretestbuilds that dependency. The workspace-level build supplies the prerequisite, but the package scripts do not.Suggested fix
"build": "tsc -p tsconfig.build.json", + "prebuild": "pnpm --filter @orca-cloud/push-contract build", "typecheck": "tsc -p tsconfig.json --noEmit", + "pretypecheck": "pnpm --filter @orca-cloud/push-contract build",

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
d9aa9c9b-3570-4727-9acb-255929f845dd
Files selected for processing: 2-
cloud/packages/connector-contract/src/contract.test.tscloud/packages/connector-contract/src/event-messages.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.
-
No description provided.