Skip to content

chore(mothership): take the worker's typed stream contract, own telemetry names in Sim, and rename go-era names to worker - #10273

Open
waleedlatif1 wants to merge 7 commits into
stagingfrom
chore/post-go-cleanup
Open

waleedlatif1 wants to merge 7 commits into
stagingfrom
chore/post-go-cleanup

Conversation

@waleedlatif1

@waleedlatif1 waleedlatif1 commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Takes the worker's stream contract, which is now the single wire source (mothership D117). The worker emitter is type-checked against mothership-stream-v1, so drift is a compile error
  • request/session/contract.ts types every reader from the one v1 envelope; its per-type intersections and resource override are gone
  • Deletes reader code for vocabulary the worker never emits: span structured_result/subagent_result, run resumed, checkpoint_pause.frames and the per-subagent resume fan-out it fed, compaction_done.data, session/trace, steering content/messageId/mode, and goTraceId. error.error/error.data and session chat/title stay, because Sim emits them itself
  • Telemetry names (trace spans, attributes, values, events, metrics) become Sim-owned code in lib/mothership/observability/ (mothership D118). Dead names are pruned, and the raw literals Sim emits now use the constants
  • Go-era names become worker: request/go/ → request/worker/, fetchGo → fetchWorker, withIncomingGoSpan → withIncomingWorkerSpan, the testing mocks, and the sim → worker … span names
  • The persisted recovery key stays goRoute, so older Sim builds keep reading new rows during a rolling deploy or rollback. recovery-config.ts is the only place that maps it to workerRoute
  • Removes the write-only TraceCollector, the dead _serviceCost output (hosted-key spend is metered by recordServiceCost), the Go-only replay.live.test.ts, and stale CODEOWNERS paths

Companion: simstudioai/mothership#997

Type of Change

  • Other: cleanup and contract consolidation

Testing

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)

…y contracts, and rename go-era names to worker
…ite-only trace collector and dead _serviceCost output

Recovery rows keep the goRoute key every deployed Sim parses, so a rollback or
mixed-version deploy still takes over in-flight runs; workerRoute is the in-memory
name only. Also removes TraceCollector and its span plumbing (nothing read it),
the _serviceCost tool output no reader consumes, Go-era span data fallbacks
(pending, tool_call_id), the Go-only billing replay live test, and takes the
worker contract's removal of the async tool status by owning it in async-runs.
…ecovery key in one place, and simplify the stream contract types

- Move the trace span, attribute, attribute-value, event and metric name tables out of generated/ into lib/mothership/observability/ as Sim-owned code; the worker no longer syncs them. CODEOWNERS keeps them with the mothership team.
- StreamRecoveryConfigSchema reads the persisted goRoute key as workerRoute, and persistedStreamRecoveryConfig writes it back as goRoute, so no caller names the stored key.
- Derive SyntheticFilePreviewEventEnvelope and EnvelopeToStreamEvent from MothershipStreamV1Envelope, drop a duplicate doc comment, and replace a nested ternary in applyStreamEvent with plain branches.
@vercel

vercel Bot commented Nov 21, 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 Nov 21, 2026 4:08am UTC

Request Review

@github-actions github-actions Bot added the requires-mothership-merge Has a companion PR on the mothership/copilot side — merge in lockstep label Nov 21, 2026
@github-actions

Copy link
Copy Markdown

⚠️ Cross-repo companion check

One or more companion PRs aren't merged into staging yet. Merging this without them will leave copilot and sim out of sync — merge them in lockstep.

  • ❌ simstudioai/mothership#997 — OPEN, not merged (targets staging) — improvement(worker): type the stream against mothership-stream-v1, hand telemetr

@greptile-apps

greptile-apps Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The changes since the previous review appear safe to merge.

Summary

Consolidates stream readers around the worker’s typed contract, moves telemetry names into Sim, and renames Go-era code to worker.

  • Sim reads worker streams from one shared contract.
  • Sim’s telemetry names now come from Sim-owned constants.
  • Sim names its remote service and request paths worker.
  • Hosted-key spend reaches the worker through service-cost receipts.
  • Supporting files drop stale paths and unused test imports.

Reviews (2) · Last reviewed commit: "test(mothership): compare the admitted r..." · Reviewed by Greptile

@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.

All reported issues were addressed across 194 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/tools/index.ts Resolved
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cubic-dev-ai review this PR

@cubic-dev-ai

cubic-dev-ai Bot commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review this PR

@waleedlatif1 I have started the AI code review. It will take a few minutes to complete.

@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 194 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

This branch was previously deployed

1 inactive deployment
Preview — 7d80fa4a Deployed Nov 21, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

requires-mothership-merge Has a companion PR on the mothership/copilot side — merge in lockstep

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant