GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(mothership): fix workflow vfs reads by Sg312 · Pull Request #4156 · simstudioai/sim

Conversation

@Sg312

@Sg312 Sg312 commented Apr 14, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Summary

Fix nested workflow reads in vfs

Type of Change

  • Bug fix

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)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

greptile-apps[bot] reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
waleedlatif1 and others added 30 commits April 3, 2026 23:30
@waleedlatif1
v0.6.23: MCP fixes, remove local state in favor of server state, moth…
0b9019d
…ership workflow edits via sockets, ui improvements
@waleedlatif1
v0.6.24: copilot feedback wiring, captcha fixes
a54dcbe
@waleedlatif1
v0.6.25: cloudwatch, cloudformation, live kb sync, linear fixes, post…
28af223
…hog upgrade
@waleedlatif1
v0.6.26: ui improvements, multiple response blocks, docx previews, ol…
d889f32
…lama fix
@waleedlatif1
v0.6.27: new triggers, mothership improvements, files archive, queuei…
316bc8c
…ng improvements, posthog, secrets mutations
@waleedlatif1
v0.6.28: new docs, delete confirmation standardization, dagster integ…
3f508e4
…ration, signup method feature flags, SSO improvements
@TheodoreSpeaks
v0.6.29: login improvements, posthog telemetry (#4026)
d6ec115
* feat(posthog): Add tracking on mothership abort (#4023)

Co-authored-by: Theodore Li <[email protected]>

* fix(login): fix captcha headers for manual login  (#4025)

* fix(signup): fix turnstile key loading

* fix(login): fix captcha header passing

* Catch user already exists, remove login form captcha
@waleedlatif1
v0.6.30: slack trigger enhancements, connectors performance improveme…
d7da35b
…nts, secrets performance, polling refactors, drag resources in mothership
Vikhyath Mondreti @Sg312
fix build error
2d2448f
@Sg312
improvement(mothership): new agent loop (#3920)
1fc84b8
* feat(transport): replace shared chat transport with mothership-stream module

* improvement(contracts): regenerate contracts from go

* feat(tools): add tool catalog codegen from go tool contracts

* feat(tools): add tool-executor dispatch framework for sim side tool routing

* feat(orchestrator): rewrite tool dispatch with catalog-driven executor and simplified resume loop

* feat(orchestrator): checkpoint resume flow

* refactor(copilot): consolidate orchestrator into request/ layer

* refactor(mothership): reorganize lib/copilot into structured subdirectories

* refactor(mothership): canonical transcript layer, dead code cleanup, type consolidation

* refactor(mothership): rebase onto latest staging

* refactor(mothership): rename request continue to lifecycle

* feat(trace): add initial version of request traces

* improvement(stream): batch stream from redis

* fix(resume): fix the resume checkpoint

* fix(resume): fix resume client tool

* fix(subagents): subagent resume should join on existing subagent text block

* improvement(reconnect): harden reconnect logic

* fix(superagent): fix superagent integration tools

* improvement(stream): improve stream perf

* Rebase with origin dev

* fix(tests): fix failing test

* fix(build): fix type errors

* fix(build): fix build errors

* fix(build): fix type errors

* feat(mothership): add cli execution

* fix(mothership): fix function execute tests
@Sg312
Force redeploy
e2de4d2
@Sg312
feat(motheship): add docx support
b6e1df4
@Sg312
feat(mothership): append
acc00df
@Sg312
Add deps
cac100a
@Sg312
improvement(mothership): docs
0d09d11
@Sg312
File types
0b3f3ed
@Sg312
Add client retry logic
0a41b8b
@Sg312
Fix stream reconnect
d85775e
@Sg312
Eager tool streaming
b74cf28
@Sg312
Fix client side tools
87ff68c
@Sg312
Security
4ee6fa8
@Sg312
Fix shell var injection
33433b1
@Sg312
Remove auto injected tasks
ca2afaa
@Sg312
Fix 10mb tool response limit
8dfbe8a
@Sg312
Fix trailing leak
c29941e
@Sg312
Remove dead tools
2da0cbe
@Sg312
file/folder tools
c52d633
@Sg312
Folder tools
0dd1ee0
@Sg312
Hide function code inline
d25632c
@Sg312
Dont show internal tool result reads
5c47c1f
Vikhyath Mondreti and others added 22 commits April 11, 2026 17:35
Vikhyath Mondreti
Merge branch 'staging' into dev
a3ac741
Vikhyath Mondreti
reactive text editor tweaks
b2b10e2
@waleedlatif1
v0.6.37: audit logs page, isolated-vm worker rotation, permission gro…
4309d06
…ups ui
@waleedlatif1
v0.6.38: models page
8b57476
@waleedlatif1
v0.6.39: billing fixes, tools audit, landing fix
e3d0e74
@Sg312
Fix file read and tool call name persistence bug
df15ebd
@Sg312
Fix code stream + create file opening resource
054c415
Vikhyath Mondreti
fix use chat race + headless trace issues
3e21899
Vikhyath Mondreti
Merge branch 'dev' of github.com:simstudioai/sim into dev
1dc9e89
Vikhyath Mondreti
Fix type issue
b087aba
@Sg312
Fix mothership block req lifecycle
d273a41
@Sg312
Fix build
7635586
@Sg312
Move copy reqid
7e8e77b
@Sg312
Fix
ebf3ece
@TheodoreSpeaks
fix(ui): fix resource tag transition from home to task (#4132)
4345c6c
Co-authored-by: Theodore Li <[email protected]>
@Sg312
Fix persistence
f6309c6
@Sg312
Merge staging into dev
82a8aa5
@Sg312
Clean code, fix bugs
72eed27
@Sg312
Fix
fee6ac5
@waleedlatif1
v0.6.40: mothership tool loop, new skills, agiloft, STS, IAM integrat…
0ac0539
…ions, jira forms endpoints
@waleedlatif1
v0.6.41: webhooks fix, workers removal
3838b6e
@Sg312
Fixes
6751745
@vercel

vercel Bot commented Apr 14, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

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, Comment Apr 14, 2026 7:08pm

Request Review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Sg312
Merge branch 'staging', remote-tracking branch 'origin' into dev
a9a6542
@gitguardian

gitguardian Bot commented Apr 14, 2026

Copy link
Copy Markdown

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
29606901 Triggered Generic High Entropy Secret a54dcbe apps/sim/providers/utils.test.ts View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider

  • following these best practices for managing and storing secrets including API keys and other credentials
  • install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.

🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@greptile-apps

greptile-apps Bot commented Apr 14, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR refactors the Mothership/copilot chat stack: it introduces a canonical message-persistence layer (persisted-message.ts, display-message.ts), extends the VFS serializer library with connectors, deployments, skills, jobs, and task-session entries, adds MCP server CRUD and deployment-version revert tools, and wires credential-aware env-var filtering into environment/utils.ts. All remaining findings are P2 style issues.

Confidence Score: 5/5

  • Safe to merge; all findings are P2 style/convention issues with no functional impact.
  • Auth flows, rate limiting, and data-access patterns are correct. The only issues found are crypto.randomUUID() used in place of the project-mandated generateId() (five occurrences across two files) and one any cast in a serializer — none of these affect runtime correctness.
  • apps/sim/lib/copilot/chat/post.ts and apps/sim/lib/copilot/chat/persisted-message.ts (crypto.randomUUID usages)

Important Files Changed

Filename Overview
apps/sim/lib/copilot/chat/post.ts Unified chat POST handler refactored to support both workflow and workspace branches; uses crypto.randomUUID() on lines 542, 695, 696 instead of the required generateId().
apps/sim/lib/copilot/chat/persisted-message.ts New message persistence layer with canonical/legacy block normalization; crypto.randomUUID() used on lines 174 and 460 instead of the project-mandated generateId().
apps/sim/lib/copilot/vfs/serializers.ts Extensive VFS serializer additions (connectors, deployments, skills, jobs, task sessions); serializeTaskChat uses (block as any) type casts where Record<string, unknown> would be correct.
apps/sim/lib/copilot/tools/handlers/deployment/manage.ts Adds MCP server CRUD operations and deployment version inspection/revert tools; correctly uses generateId() and has proper access-control guards on each operation.
apps/sim/lib/environment/utils.ts Adds credential-aware environment variable filtering and a short-lived in-process cache for decrypted env vars; implementation looks correct and follows project conventions.
apps/sim/app/api/mcp/copilot/route.ts MCP copilot server with OAuth and API-key auth, rate limiting, and subagent/direct-tool routing; auth flows, rate limiting, and error surfaces all look correct.

Sequence Diagram

sequenceDiagram
    participant Client
    participant PostHandler as lib/copilot/chat/post.ts
    participant PersistedMsg as persisted-message.ts
    participant DisplayMsg as display-message.ts
    participant DB as copilotChats (DB)
    participant Orchestrator as Copilot Orchestrator
    participant VFS as workspace-vfs.ts

    Client->>PostHandler: POST /api/copilot/chat
    PostHandler->>PostHandler: "resolveBranch (workflow | workspace)"
    PostHandler->>DB: persistUserMessage
    PostHandler->>Orchestrator: createSSEStream
    Orchestrator-->>PostHandler: OrchestratorResult (onComplete)
    PostHandler->>PersistedMsg: buildPersistedAssistantMessage(result)
    PostHandler->>DB: finalizeAssistantTurn (upsert messages)
    Client->>DisplayMsg: load chat history
    DisplayMsg->>PersistedMsg: normalizeMessage(rawRecord)
    DisplayMsg-->>Client: ChatMessage[]

    Client->>VFS: read("workflows/…/state.json")
    VFS->>DB: loadWorkflowFromNormalizedTables
    VFS-->>Client: serialized VFS content
Loading

Comments Outside Diff (3)

  1. apps/sim/lib/copilot/chat/persisted-message.ts, line 174 (link)

    P2 crypto.randomUUID() violates project ID generation rule

    The project requires using generateId() from @/lib/core/utils/uuid instead of crypto.randomUUID() directly. The same violation appears at line 460 of this file. generateId() already exists and works identically, including in non-secure (HTTP) browser contexts.

    Also fix line 460:

    id: (raw.id as string) ?? generateId(),

    Add the import at the top of the file:

    import { generateId } from '@/lib/core/utils/uuid'

    Context Used: CLAUDE.md (source)

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

  2. apps/sim/lib/copilot/chat/post.ts, line 542 (link)

    P2 crypto.randomUUID() violates project ID generation rule

    crypto.randomUUID() is used on this line, and again on lines 695–696. The project mandates generateId() from @/lib/core/utils/uuid for all ID generation. generateId is already imported at the top of this file and should be used consistently.

    Also update lines 695–696:

    const executionId = generateId()
    const runId = generateId()

    Context Used: CLAUDE.md (source)

    Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

  3. apps/sim/lib/copilot/vfs/serializers.ts, line 934-937 (link)

    P2 any cast violates TypeScript conventions

    block is already narrowed to object by the preceding guard, so it can be safely cast to Record<string, unknown> instead of using any.

    Context Used: TypeScript conventions and type safety (source)

Reviews (1): Last reviewed commit: "Merge branch 'staging', remote-tracking ..." | Re-trigger Greptile

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Sg312 Sg312 changed the title Dev fix(mothership): fix workflow vfs reads Apr 14, 2026
@vercel
vercel Bot deployed to Preview April 14, 2026 19:08
View deployment
@Sg312
Sg312 merged commit ff2e369 into staging Apr 14, 2026
23 of 24 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@waleedlatif1 waleedlatif1 mentioned this pull request Apr 14, 2026
v0.6.42: mothership nested file reads, search modal improvements #4159
Merged

This branch was successfully deployed

1 active deployment
Preview — a9a65422 Deployed Apr 14, 2026 by vercel[bot]
View deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@Sg312 @waleedlatif1 @TheodoreSpeaks
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.