Skip to content

fix(mothership): parse each checkpoint control request on its own and declare accepted kinds - #9086

Merged
waleedlatif1 merged 1 commit into
stagingfrom
fix/sim-transport-accepts
Oct 15, 2026
Merged

waleedlatif1 merged 1 commit into
stagingfrom
fix/sim-transport-accepts

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • The outbound Mothership receiver parsed each poll batch strictly, so one control kind this build didn't know threw for the whole batch: nothing in it was answered and the worker waited out every request's timeout
  • Each request now parses on its own: an unknown kind is answered 501 sim_control_unsupported, a malformed one 400, a request without a readable id is dropped and logged, and its batch-mates always run
  • Every poll declares accepts: the kinds this build's generated contract parses, so the worker can stop sending kinds a receiver can't handle
  • Disconnect log now says which phase failed (poll / parse / reply)
  • generated/sim-transport.ts synced from simstudioai/mothership#699

Release order

  • Lands with simstudioai/mothership#699 (contracts only). Safe alone: current workers ignore the extra accepts field
  • The worker-side gate ships after this Sim release

Type of Change

  • Bug fix

Testing

  • receiver.test.ts: a batch with an unknown kind, a malformed input, and a request with no kind alongside a valid one: valid one executes, the others get 501/400, no reconnect; polls declare exactly the contract's kinds; unreadable requests are dropped without a reply (all fail before the change)
  • control.test.ts unchanged and passing

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

… declare accepted kinds

The outbound receiver parsed a poll batch strictly, so one control kind
this build did not know threw for the whole batch: nothing in it was
answered and the worker waited out each request's timeout. Parse each
request alone, answer an unknown kind 501 sim_control_unsupported and a
malformed one 400, and keep running its batch-mates. Every poll now
declares the kinds this build's generated contract parses, so the worker
can stop sending kinds a receiver cannot handle.
@vercel

vercel Bot commented Oct 15, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docs Skipped Skipped Oct 15, 2026 7:56pm UTC

Request Review

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Turn on auto-fix | Re-trigger cubic

@greptile-apps

greptile-apps Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

The checkpoint receiver now parses each request separately instead of rejecting a whole batch.

  • Each control request gets its own answer, and polls list accepted kinds.

No actionable issues were found. Tests were inspected, not run.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Poll with accepted kinds] --> B[Read batch envelope]
  B --> C[Parse each request]
  C --> D{Request valid?}
  D -->|Yes| E[Execute control]
  D -->|No| F{ID readable?}
  F -->|No| G[Log and drop]
  F -->|Yes| H{Kind unknown?}
  H -->|Yes| I[Prepare 501 answer]
  H -->|No| J[Prepare 400 answer]
  E --> K[Send replies in parallel]
  I --> K
  J --> K
  K --> A
  G --> A
Loading

Reviews (1) · Last reviewed commit: "fix(mothership): parse each checkpoint c..." · Reviewed by Greptile

@waleedlatif1
waleedlatif1 merged commit ae6d45b into staging Oct 15, 2026
53 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/sim-transport-accepts branch October 15, 2026 22:19

This branch was previously deployed

1 inactive deployment
Preview — 19adf846 Deployed Oct 15, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant