Skip to content

feat(mship): mship sysprompt override - #6469

Merged
waleedlatif1 merged 5 commits into
stagingfrom
mship-sysprompt-override
Aug 9, 2026
Merged

feat(mship): mship sysprompt override#6469
waleedlatif1 merged 5 commits into
stagingfrom
mship-sysprompt-override

Conversation

@Sg312

@Sg312 Sg312 commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Mship sysprompt override
Companion: https://github.com/simstudioai/mothership/pull/421

Type of Change

  • New feature

Testing

Manual

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)

@Sg312
Sg312 requested a review from a team as a code owner August 9, 2026 01:34
@vercel

vercel Bot commented Aug 9, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview Aug 9, 2026 2:20am

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 Aug 9, 2026
@github-actions

github-actions Bot commented Aug 9, 2026

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.

@greptile-apps

greptile-apps Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR adds an enterprise Mothership system-prompt override and completes its propagation through Sim, API-key validation, local deployment configurations, and Helm secret modes.

  • Forwards a nonblank configured override in Mothership lifecycle payloads.
  • Returns the validated API-key owner’s enterprise entitlement.
  • Supports inline, existing-secret, and External Secrets Helm deployments.
  • Adds contract, lifecycle, route, and chart coverage.

Confidence Score: 5/5

The PR appears safe to merge because the previously reported Helm propagation failure is fixed and no blocking failure remains.

No blocking failure remains.

Important Files Changed

Filename Overview
helm/sim/values.yaml Adds the prompt override to inline application values and External Secrets mappings; the generic secret templates propagate it into the pod.
helm/sim/tests/secret-modes_test.yaml Covers inclusion and omission in inline mode and mapping in External Secrets mode.
apps/sim/lib/copilot/request/lifecycle/run.ts Adds nonblank prompt overrides to outbound Mothership lifecycle payloads.
apps/sim/app/api/copilot/api-keys/validate/route.ts Returns a server-derived enterprise entitlement for the validated API-key owner.
apps/sim/lib/api/contracts/copilot.ts Updates the validation endpoint contract from an empty response to typed entitlement JSON.

Sequence Diagram

sequenceDiagram
  participant Operator
  participant Helm as Helm / Deployment
  participant Sim
  participant Mship as Mothership
  Operator->>Helm: Configure MSHIP_SYSPROMPT_OVERRIDE
  Helm->>Sim: Inject value through app Secret
  Sim->>Mship: Send lifecycle payload with systemPromptOverride
  Mship->>Sim: Validate API-key owner
  Sim-->>Mship: Return isEnterprise entitlement
Loading

Reviews (2): Last reviewed commit: "Validation improvements" | Re-trigger Greptile

Comment thread apps/sim/lib/core/config/env.ts Outdated
@Sg312

Sg312 commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator Author

@greptile

@Sg312

Sg312 commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor

cursor Bot commented Aug 9, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
The validate endpoint response shape changes from empty to JSON, so older Go callers must accept the new body; the system-prompt override is a powerful control though enterprise gating is enforced on Mothership.

Overview
Adds enterprise-oriented Mothership controls: a deploy-time system-prompt override and an explicit enterprise flag on Copilot API key validation.

MSHIP_SYSPROMPT_OVERRIDE is introduced across env config, Docker Compose, Helm, and .env.example. When set to a non-blank value, Sim forwards it on the initial Mothership request as systemPromptOverride (companion Mothership PR applies it only for entitled enterprise callers).

POST /api/copilot/api-keys/validate no longer returns an empty 200 on success; it returns { isEnterprise: boolean } derived via isEnterprisePlan(userId), with billing headers unchanged. The route contract and tests are updated accordingly.

Reviewed by Cursor Bugbot for commit b53b6a6. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ 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 b53b6a6. Configure here.

@waleedlatif1
waleedlatif1 merged commit 29cfb85 into staging Aug 9, 2026
24 of 25 checks passed
@waleedlatif1
waleedlatif1 deleted the mship-sysprompt-override branch August 9, 2026 02:18
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.

2 participants