Skip to content

feat(workflows): dry runs stub reads that depend on a stubbed write, and flag MCP tools servers call read-only - #10416

Open
waleedlatif1 wants to merge 2 commits into
stagingfrom
feat/dry-run-mcp-derived-reads
Open

waleedlatif1 wants to merge 2 commits into
stagingfrom
feat/dry-run-mcp-derived-reads

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Dry-run placeholders are distinctive tokens: every string a dry-run sample makes up is dry_run_<field>_<n> and every number is above 900000000; hooks mint ids with dryRunId
  • A read that would send one of the run's own placeholders is stubbed too, so create-then-read chains no longer hit the provider with a fake id: read tools, MCP calls, API-block GETs and a Function's GET fetch all count; each is recorded in sideEffects.stubbed with dependsOnStub: true (matching is exact per run: token boundaries, any case, numbers whole or as digit runs, bounded scan)
  • MCP: discovered tools keep their readOnlyHint/destructiveHint annotations; a dry run still stubs every MCP call (annotations are server claims Sim can't verify) but flags readOnlyHint so --allow '<block>' is the one step to send it; stubbed MCP calls return a placeholder built from the tool's outputSchema, and entries name the MCP server/tool instead of mcp_run_operation
  • Workflow-test reports and the Mothership tests tool carry dependsOnStub, readOnlyHint and the MCP tool
  • The v2 MCP tools route returns only contract fields
  • firecrawl_crawl, firecrawl_extract and slack_message_reader were re-checked against the read rule and stay write (async provider jobs; a DM open)

Type of Change

  • New feature

Testing

  • dry-run.integration.ts (real Postgres/Redis, a real Streamable HTTP MCP fixture server, loopback HTTP server): MCP stubbed with readOnlyHint and outputSchema placeholders, --allow sends, derived-read chains across table, MCP, GitHub-by-number, Function fetch and API GET, a real id still sent, non-dry run unaffected; each guard red-proofed (50/50)
  • lib/workflows/dry-run/placeholders.test.ts (match / no-match cases), MCP use-case, client, internal MCP, v2 mcp-servers, workflow-tests and Mothership tests-tool suites; sim-cli protocol tests; type-check; lint; generate

Checklist

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

…and flag MCP tools servers call read-only

Placeholder values are distinctive: the dry-run sample mints each string it makes up as
dryRunId(<field>, n) and each number as dryRunNumber(n) (above 900000000), beside the ids
dryRunOutput hooks mint. The policy registers the placeholders of every answer it returns
(stubbed writes, derived reads, blocks answered whole; never mocks or real results), per run
and with no hook signature change. A read that would send a registered placeholder (a token
anywhere in a string, in any case and ending at its _<digits>, or a number whole or as a digit
run) is not sent and is listed in stubbed with dependsOnStub: a read tool's declared params, an
HTTP GET/HEAD/OPTIONS (readsWhen reads go through the same check), an MCP call's arguments, and
a GET/HEAD/OPTIONS fetch code makes in the isolate (its URL or body; answered with the empty
stubbed 200 and left out of the --allow hint). Create-then-read chains, by id or by number, no
longer reach the provider; free text quoting a placeholder counts too. Runs without a
side-effect policy do no extra work.

MCP tools keep their readOnlyHint/destructiveHint annotations, but a dry run never acts on them:
annotations are the server's unverified claim. A held-back MCP call is still authorized and
checked against an uncached tools/list without being sent; the check reports what it learned of
the tool, so the stubbed entry carries readOnlyHint (read-only and not destructive), the CLI
says --allow '<block>' sends it, and the placeholder samples the tool's outputSchema as
structuredContent (integer as number, a union as its first non-null member, untyped fields left
out). MCP block entries (stubbed and allowed) record the MCP server and tool they named, and
allowed ones are deduplicated by it. Workflow test reports keep mcp, dependsOnStub and
readOnlyHint. The v2 MCP tools route projects the strict contract fields, since discovered tools
now carry annotations.

Effect labels reviewed, unchanged: firecrawl_crawl and firecrawl_extract start async provider
jobs with their own ids (write); slack_message_reader opens a DM conversation via
conversations.open when given a user (param-dependent, write).
@vercel

vercel Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
docs Building Building Preview Nov 25, 2026 9:15pm UTC

Request Review

@greptile-apps

greptile-apps Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 2/5 · Fix saved-report compatibility and the two incorrect read decisions before merging.RetriggerView in GreptileConfidence Score: 2/5

[Medium impact] The changes affect dry-run behavior across workflow tools and their reports.

Fix saved-report compatibility and the two incorrect read decisions before merging.

Findings

  1. P1 Earlier test results stop loading ▶
  2. P1 Fake IDs escape through headers ▶
  3. P1 Real IDs become fake ▶

Summary

This PR gives dry-run outputs recognizable placeholders and skips reads that would send them. It also carries MCP read-only hints and output shapes into dry-run results.

  • Dry runs keep reads from sending values made up by stubbed writes.
  • Dry runs use discovered MCP tool details to shape and label held calls.
  • Dry-run reports name MCP calls and mark reads that depend on placeholders.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Dry-run tool call] --> B{Read or write?}
  B -->|Write| C{Block allowed?}
  C -->|Yes| D[Send call]
  C -->|No| E[Return placeholder]
  E --> F[Track placeholder values]
  B -->|Read| G{Sends tracked value?}
  F -.-> G
  G -->|Yes| H[Return placeholder and mark dependsOnStub]
  G -->|No| D
Loading

Reviews (1) · Last reviewed commit: "feat(workflows): dry runs stub reads tha..." · Reviewed by Greptile

Comment thread apps/sim/lib/workflow-tests/protocol.ts Resolved

@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 31 files

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

Turn on auto-fix | Re-trigger cubic

Comment thread apps/sim/lib/workflow-tests/protocol.ts Resolved
Comment thread apps/docs/openapi-v2-workflows.json Resolved
Comment thread .agents/skills/add-tools/SKILL.md Resolved
…n code header values, and old test reports still parse

This branch was successfully deployed

1 active (outdated) deployment
Preview — f8e767ee Deployed Nov 25, 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