Skip to content

fix(mothership): file materialization tools#3586

Merged
Sg312 merged 34 commits intostagingfrom
fix/mothership-1
Mar 14, 2026
Merged

fix(mothership): file materialization tools#3586
Sg312 merged 34 commits intostagingfrom
fix/mothership-1

Conversation

@Sg312
Copy link
Collaborator

@Sg312 Sg312 commented Mar 14, 2026

Summary

Adds file materialization to mothership

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)

waleedlatif1 and others added 24 commits February 16, 2026 00:36
…stash, algolia tools; isolated-vm robustness improvements, tables backend (#3271)

* feat(tools): advanced fields for youtube, vercel; added cloudflare and dataverse tools (#3257)

* refactor(vercel): mark optional fields as advanced mode

Move optional/power-user fields behind the advanced toggle:
- List Deployments: project filter, target, state
- Create Deployment: project ID override, redeploy from, target
- List Projects: search
- Create/Update Project: framework, build/output/install commands
- Env Vars: variable type
- Webhooks: project IDs filter
- Checks: path, details URL
- Team Members: role filter
- All operations: team ID scope

Co-Authored-By: Claude Opus 4.6 <[email protected]>

* style(youtube): mark optional params as advanced mode

Hide pagination, sort order, and filter fields behind the advanced
toggle for a cleaner default UX across all YouTube operations.

Co-Authored-By: Claude Opus 4.6 <[email protected]>

* added advanced fields for vercel and youtube, added cloudflare and dataverse block

* addded desc for dataverse

* add more tools

* ack comment

* more

* ops

---------

Co-authored-by: Claude Opus 4.6 <[email protected]>

* feat(tables): added tables (#2867)

* updates

* required

* trashy table viewer

* updates

* updates

* filtering ui

* updates

* updates

* updates

* one input mode

* format

* fix lints

* improved errors

* updates

* updates

* chages

* doc strings

* breaking down file

* update comments with ai

* updates

* comments

* changes

* revert

* updates

* dedupe

* updates

* updates

* updates

* refactoring

* renames & refactors

* refactoring

* updates

* undo

* update db

* wand

* updates

* fix comments

* fixes

* simplify comments

* u[dates

* renames

* better comments

* validation

* updates

* updates

* updates

* fix sorting

* fix appearnce

* updating prompt to make it user sort

* rm

* updates

* rename

* comments

* clean comments

* simplicifcaiton

* updates

* updates

* refactor

* reduced type confusion

* undo

* rename

* undo changes

* undo

* simplify

* updates

* updates

* revert

* updates

* db updates

* type fix

* fix

* fix error handling

* updates

* docs

* docs

* updates

* rename

* dedupe

* revert

* uncook

* updates

* fix

* fix

* fix

* fix

* prepare merge

* readd migrations

* add back missed code

* migrate enrichment logic to general abstraction

* address bugbot concerns

* adhere to size limits for tables

* remove conflicting migration

* add back migrations

* fix tables auth

* fix permissive auth

* fix lint

* reran migrations

* migrate to use tanstack query for all server state

* update table-selector

* update names

* added tables to permission groups, updated subblock types

---------

Co-authored-by: Vikhyath Mondreti <[email protected]>
Co-authored-by: waleed <[email protected]>

* fix(snapshot): changed insert to upsert when concurrent identical child workflows are running (#3259)

* fix(snapshot): changed insert to upsert when concurrent identical child workflows are running

* fixed ci tests failing

* fix(workflows): disallow duplicate workflow names at the same folder level (#3260)

* feat(tools): added redis, upstash, algolia, and revenuecat (#3261)

* feat(tools): added redis, upstash, algolia, and revenuecat

* ack comment

* feat(models): add gemini-3.1-pro-preview and update gemini-3-pro thinking levels (#3263)

* fix(audit-log): lazily resolve actor name/email when missing (#3262)

* fix(blocks): move type coercions from tools.config.tool to tools.config.params (#3264)

* fix(blocks): move type coercions from tools.config.tool to tools.config.params

Number() coercions in tools.config.tool ran at serialization time before
variable resolution, destroying dynamic references like <block.result.count>
by converting them to NaN/null. Moved all coercions to tools.config.params
which runs at execution time after variables are resolved.

Fixed in 15 blocks: exa, arxiv, sentry, incidentio, wikipedia, ahrefs,
posthog, elasticsearch, dropbox, hunter, lemlist, spotify, youtube, grafana,
parallel. Also added mode: 'advanced' to optional exa fields.

Closes #3258

* fix(blocks): address PR review — move remaining param mutations from tool() to params()

- Moved field mappings from tool() to params() in grafana, posthog,
  lemlist, spotify, dropbox (same dynamic reference bug)
- Fixed parallel.ts excerpts/full_content boolean logic
- Fixed parallel.ts search_queries empty case (must set undefined)
- Fixed elasticsearch.ts timeout not included when already ends with 's'
- Restored dropbox.ts tool() switch for proper default fallback

* fix(blocks): restore field renames to tool() for serialization-time validation

Field renames (e.g. personalApiKey→apiKey) must be in tool() because
validateRequiredFieldsBeforeExecution calls selectToolId()→tool() then
checks renamed field names on params. Only type coercions (Number(),
boolean) stay in params() to avoid destroying dynamic variable references.

* improvement(resolver): resovled empty sentinel to not pass through unexecuted valid refs to text inputs (#3266)

* fix(blocks): add required constraint for serviceDeskId in JSM block (#3268)

* fix(blocks): add required constraint for serviceDeskId in JSM block

* fix(blocks): rename custom field values to request field values in JSM create request

* fix(trigger): add isolated-vm support to trigger.dev container builds (#3269)

Scheduled workflow executions running in trigger.dev containers were
failing to spawn isolated-vm workers because the native module wasn't
available in the container. This caused loop condition evaluation to
silently fail and exit after one iteration.

- Add isolated-vm to build.external and additionalPackages in trigger config
- Include isolated-vm-worker.cjs via additionalFiles for child process spawning
- Add fallback path resolution for worker file in trigger.dev environment

* fix(tables): hide tables from sidebar and block registry (#3270)

* fix(tables): hide tables from sidebar and block registry

* fix(trigger): add isolated-vm support to trigger.dev container builds (#3269)

Scheduled workflow executions running in trigger.dev containers were
failing to spawn isolated-vm workers because the native module wasn't
available in the container. This caused loop condition evaluation to
silently fail and exit after one iteration.

- Add isolated-vm to build.external and additionalPackages in trigger config
- Include isolated-vm-worker.cjs via additionalFiles for child process spawning
- Add fallback path resolution for worker file in trigger.dev environment

* lint

* fix(trigger): update node version to align with main app (#3272)

* fix(build): fix corrupted sticky disk cache on blacksmith (#3273)

---------

Co-authored-by: Claude Opus 4.6 <[email protected]>
Co-authored-by: Lakee Sivaraya <[email protected]>
Co-authored-by: Vikhyath Mondreti <[email protected]>
Co-authored-by: Vikhyath Mondreti <[email protected]>
… fixes, removed retired models, hex integration
…ogle tasks and bigquery integrations, workflow lock
@vercel
Copy link

vercel bot commented Mar 14, 2026

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

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Mar 14, 2026 11:51pm

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 14, 2026

Greptile Summary

This PR removes resolveVfsResource from vfs-tools.ts and stops populating the resources field on ToolCallResult when executeVfsRead succeeds. The net effect is that reading VFS files (tables, workflows, knowledgebases, files) will no longer emit resource_added SSE events or persist resources to the chat's resources column — previously those side-effects were triggered by attaching resource metadata derived from each file's sibling meta.json.

Key observations:

  • The downstream consumer in tool-execution.ts handles a missing resources field safely; when result.resources is undefined, it falls back to extractResourcesFromToolResult, which returns [] for vfs_read since vfs_read is not in RESOURCE_TOOL_NAMES.
  • Unused imports (MothershipResource, VFS_DIR_TO_RESOURCE, WorkspaceVFS) are correctly removed alongside the deleted helper.
  • The ToolCallResult interface still declares resources?: MothershipResource[]; this field remains available for other tools that populate it intentionally.
  • The PR description is essentially empty — the motivation for disabling this tracking is not documented. If VFS reads should ever resume emitting resource_added events, vfs_read would also need to be added to RESOURCE_TOOL_NAMES in resources.ts together with a corresponding extractResourcesFromToolResult case, rather than relying on the inline resolution that was just removed.

Confidence Score: 4/5

  • Safe to merge — the change is a clean removal with a graceful fallback already in place.
  • The removed code path had a clear and correctly-handled fallback in tool-execution.ts. No runtime errors are introduced; the only behavioural change is that VFS reads will stop emitting resource_added events. The scope is narrow (one file, two return sites) and the remaining code compiles cleanly after the dead imports are removed.
  • No files require special attention, though reviewers may want to verify the intent to silence resource_added events for VFS reads is deliberate.

Important Files Changed

Filename Overview
apps/sim/lib/copilot/orchestrator/tool-executor/vfs-tools.ts Removes the resolveVfsResource helper and strips the resources field from executeVfsRead return values, stopping automatic resource-tracking on VFS reads. The remaining code is clean and the fallback path in tool-execution.ts handles absent resources gracefully.

Sequence Diagram

sequenceDiagram
    participant TE as tool-execution.ts
    participant VFS as vfs-tools.ts (executeVfsRead)
    participant R as resources.ts

    TE->>VFS: executeVfsRead(params, context)
    VFS-->>TE: { success: true, output: result }<br/>(resources field removed)

    Note over TE: Check result.resources (now always falsy for vfs_read)
    TE->>R: isResourceToolName("vfs_read")
    R-->>TE: false (vfs_read not in RESOURCE_TOOL_NAMES)

    Note over TE: resources = [] — no resource_added events emitted,<br/>no persistChatResources() called
Loading

Last reviewed commit: 24526b7

@Sg312 Sg312 changed the title fix(mothership): tools fix(mothership): file materialization tools Mar 14, 2026
@Sg312 Sg312 merged commit f077751 into staging Mar 14, 2026
11 checks passed
@icecrasher321 icecrasher321 deleted the fix/mothership-1 branch March 14, 2026 23:57
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.

3 participants