Skip to content

Improvement: ship faithful mocks with every integration (connector), so a test run proves a workflow end to end and changes nothing outside Tale #4943

Closed

Description

@yannickmonney

Summary

Requested on 2026-10-13, as three goals:

  1. Mock data ships with every integration (in Tale's words, every connector) in a way that lets a workflow (an automation) be tested end to end before it goes into production, and that covers all cases.
  2. A test run changes nothing outside Tale, and still earns trust. The mocks the integrations ship are what make it "bullet proof".
  3. Improve more generally how integrations work in Tale. This part is deliberately open. Whoever takes this ticket, a person or an agent, may propose and make changes beyond the mocks. The evidence below shows where to look. It is not a scope.

This issue records what exists today, how a test run uses it, what a faithful mock would have to cover, and the design space, with no preferred answer. A follow-up, #4944, ranks the 1,000 integrations that matter most to businesses and opens one issue for each. It builds on whatever standard this ticket settles for shipped mocks.

Snapshot: main 0cf2c45fda (2026-10-13).

What exists today

The catalog

  • 22 connectors under configs/platform/system/connectors/, with 127 actions: 89 reads and 38 writes. 87 actions run a JavaScript body and 40 a native platform module.
  • A connector is one connector.yml (plus an icon for 16 of them). No mock or fixture file lives beside any of them.
  • Two actions are declared idempotent: notify.member and task.create, both the platform's own. No vendor write is. (.agents/repo.md:800 still says no shipped action is.)
  • Adding a connector is a source contribution. The runtime reads the platform catalog and has no organization-level upload (docs/en/develop/connectors.md:43).

The mock an integration ships

  • Every action must carry a mock: "Deterministic mock body (JS): input in scope, returns the mock output. Required — the authoring/test loop runs on it." (packages/shared/src/schemas/connectors.ts:239-241). The docs say the same: "Required deterministic JavaScript implementation; same input, same output, no network I/O" (docs/en/develop/connectors.md:56).
  • Measured over all 127 mocks with a script over the connector.yml files (the patterns are heuristic): the median mock is 2 lines long; 26 (about a fifth) branch on their input at all; 2 can raise an error (both in task); none reads ctx, so none can remember anything between two calls; 17 mention paging fields. For example, slack.list_channels returns one fixed public channel and next_cursor: null, whatever it is asked.
  • output is "documentation, not a runtime output validator" (docs/en/develop/connectors.md:54). The one catalog-wide check of the mocks runs each of them with its exampleInput, twice, and compares the two answers (services/platform/lib/shared/schemas/shipped-connectors.test.ts:122-134). Nothing compares a mock's answer with its action's declared output, or with what the vendor returns. 124 of the 127 actions have an exampleInput.

What a test run does with it

  • A run is mock or live (services/platform/backend/core/automations/stepper.ts:432). In mock mode a connector node resolves its input and checks it against the action's input schema. It then takes a stand-in output if the test gave one, and otherwise runs the action's mock; it records a write as an effect without performing it. In live mode it calls the action's live body (services/platform/lib/engine/core/execute/index.ts:849-897).
  • The promise to the user: "Test run uses the selected saved version with deterministic mocks. It does not send mail or change external records." (docs/en/platform/automations/editor.md:207). Over MCP, run_automation runs a draft "on the deterministic mocks: nothing leaves Tale and nothing is stored" (docs/en/develop/mcp-endpoint.md:136).
  • A workflow's acceptance tests can replace any node's call with a stand-in output (mocks: node id → output) or a simulated failure (failures: node id → message, worded "(simulated by the test)"), and then assert on the output, the effects and the node states (services/platform/lib/engine/api/docs.ts:300-345, lib/engine/api/tests.ts). So every case beyond the one canned answer is invented by the workflow's author, test by test, and nothing says it resembles what the vendor does.
  • In mock mode a model node returns a deterministic default text and an agent node a deterministic default reply (lib/engine/core/execute/scope.ts:77-85). A mock run's results "were made up", so they cannot seed a live replay (lib/engine/core/record/replay.ts:305).
  • Approvals are out of the picture: "A mock test does not prove that a live approval will appear" (docs/en/platform/approvals/configure.md:29).

A second mock mechanism, outside the connectors

  • services/platform/lib/mocks/ is a Prism-based local gateway. It serves OpenAPI examples at /mock/<connector>/* for 10 vendor specs (Confluence, Discord, GitHub, Gmail, Google Drive, Microsoft Graph, Shopify, Slack, Tavily and Twilio, from a handful to a few dozen operations each) and for AI providers.
  • Its README says: "The specs cover the operations they list, not every operation an upstream service offers", and "There is no blanket connector redirect wired into the current backend by setting TALE_MOCK_CONNECTORS_BASE alone." Its registry still names the retired Convex sandbox (lib/mocks/registry.ts).
  • It is test infrastructure of the repository. It is not shipped with a connector, and a test run in the app cannot reach it.

What the docs ask of a contributor

"Test three things separately when contributing: schema validation, deterministic mock behavior, and the live vendor path. Check failure handling as well as success: missing credential, wrong scope, denied destination, invalid input, vendor refusal, and an approval wait for writes." (docs/en/develop/connectors.md:130). Of the mocks, the shipped-catalog test checks only that each one runs and is deterministic (above); no catalog-wide test of the failure cases on that list was found.

Neighbouring work

What "faithful" has to mean (considerations, not decisions)

  1. Cases per action. Success; an empty result; not found; the first, a middle and the last page; a refusal of invalid input; credentials missing, expired or short of a scope; a rate limit with a wait; a timeout or outage; a partial failure inside a batch; a repeated request with the same idempotency key; a large payload; text in other encodings and languages.
  2. State. Create then read, update then read, delete then read within one run. Per run, isolated, and discarded with the run.
  3. Shape fidelity. The mock's answer matches the action's declared output and what the vendor really returns. How drift is found (against recorded real responses, against the vendor's own OpenAPI document, or against a vendor sandbox) and who is told.
  4. Writes. A test run shows the write that would have happened (today an effect record) and the answer the vendor would give to it.
  5. Failure classes. A live failure is classified, and the class decides whether a step is retried or parked in doubt. A simulated failure has to pass through the same classification, or a test cannot prove either behaviour.
  6. Data. Synthetic only. .agents/repo.md keeps client names, fixtures and business rules out of the shared implementation, and this repository is public.
  7. Cost. Mocks multiply by integrations: 22 today, and Epic: the 1,000 integrations that matter most to businesses — rank them and open one issue per integration #4944 plans many more. What it costs to write and to review a mock per integration is the real constraint.

Open design space (no preference stated; the assignee decides)

  • Where a mock lives. In the connector's file (today), as files beside it, as a pack, generated from the vendor's OpenAPI document, or recorded from real traffic and scrubbed.
  • Where a test run swaps it in. At the action (today); at the HTTP layer, so the real live body runs against a vendor-shaped mock (what lib/mocks does for tests); or both.
  • What a mock is. A function (today); a table of scenarios (input matcher to response, errors included); a small stateful simulator; or an OpenAPI mock server (Prism is already in the repository).
  • How a test picks a case. By input, by a scenario name per node, or from a library of named scenarios per integration; and how a failing scenario is written in a test.
  • How completeness is held. A catalog gate in CI: each action ships a minimum set of scenario kinds (a read: success, empty, error; a write: success, refusal, duplicate).
  • Who writes them. How a person, or an agent (the product's own over MCP, or a coding agent), writes and checks the mocks of a new integration.
  • Beyond mocks, "how integrations work". Open. The evidence above points at: how credentials, consent and per-credential endpoints are declared; idempotency (2 of 38 writes are declared); the two failure and retry classes; the second mock mechanism; the lack of an organization-level connector upload (a source contribution or the generic http connector); the contributor flow and its docs; and how a call is observed. These are pointers, not a scope.

Maintained tools that already exist (each read on 2026-10-13): stripe/stripe-mock (MIT; "a mock HTTP server that responds like the real Stripe API", usable "instead of Stripe's testmode"), stoplightio/prism (Apache-2.0; already used in lib/mocks), wiremock/wiremock (Apache-2.0), mockoon/mockoon (MIT), mswjs/msw (MIT), nock/nock (MIT), and the Pact contract-testing framework.

Constraints

  • Org configuration is files, not tables (.agents/repo.md). If scenarios or mocks become organization-visible configuration, they follow that rule.
  • Tenant isolation. Any mock state is per run and per organization, and never shared across organizations.
  • Isolation of code. Mock bodies run in the code runner's sandbox today; a new form of mock keeps that boundary.
  • A domain's rules are a checked spec. The automations and connectors specs, the manual boxes and the docs move with the change, in English, German and French, with accessibility held.
  • "Reach for a well-known, maintained library before hand-rolling" (AGENTS.md:137).

Questions

  • Is the aim "no real change, ever" (a mock-only test run), or also "real reads, held writes" (the preview of Improvement: durable test runs with stand-ins, preview mode, a wait step and the approval line in the run record #4929), as separate modes?
  • Which cases count as "all cases", and who decides the list for each integration?
  • Must a mock be checked against the real service on a schedule? That needs test accounts per vendor.
  • Are the 22 shipped connectors the reference and upgraded first?
  • Is a mock, with a minimum coverage, a required part of every connector, or optional per integration?

Not examined

  • The code of each vendor's live body, and how closely any mock matches its vendor today.
  • Whether a vendor offers a sandbox or test accounts, per integration. Nothing was run against a real vendor.
  • The org-level custom connector gap beyond what the docs say, and the MCP and REST surfaces for connectors.
  • The patterns used for the measurements above are heuristic. The counts describe the mock bodies as text.

Related

#4944 (the follow-up that ranks the integrations and opens one issue each), #4929, #4936, #4927, #4928.

Observed at main 0cf2c45fda (2026-10-13).

Activity

  1. added
    agent-ready
    on Oct 29, 2026
  2. tale-code-bot commented on Nov 1, 2026

    @tale-code-bot
    Collaborator

    Step 1 of this issue is worked in TALE-198 on the branch feat/connector-mock-scenarios. After review it lands on the feature line: feature-train, then release/0.6.

    What it does.

    • A connector action can ship named scenarios beside its mock. Each scenario is data, never code: a kind (success, empty, error, refusal, duplicate), a description, an optional when (the input members a call must carry), and an output or an error with an optional HTTP status.
    • A test picks one per step (scenarios: {<node>: <name>}), and so does run_automation over MCP. A matching call gets the scenario's answer. An error is classified as the same live failure would be, so onError and the failure path act as they would live. Any other call gets the mock.
    • get_catalog lists each action's scenarios.
    • A catalog ratchet makes each listed connector ship at least success, empty and error on every read, and success, refusal and duplicate on every write. Slack is the first, and its scenarios are proven against its live body.

    The parts left, each filed as its own issue:

    Not filed.

  3. added a commit that references this issue on Nov 1, 2026
    55391b0
  4. added a commit that references this issue on Nov 2, 2026
    a6ff0fd
  5. tale-code-bot commented on Nov 2, 2026

    @tale-code-bot
    Collaborator

    Done on the feature line: feature train #5279 landed on release/0.6 by rebase at 2026-11-02 01:30:34 UTC. This issue's change is commit a6ff0fd5981784ff560e3adef18e88f2738fd447 (feat(platform): let connector actions ship scenarios that tests pick) on release/0.6, and it ships with Tale 0.6.0. GitHub closes issues itself only for commits that reach main, so the feature-train role closes this one now. Board task: TALE-198.

  6. added 15 commits that reference this issue on Nov 2, 2026
    4b56007
    d4c9ad3
    8450a9e
    c19f7d6
    35a29cc
    4c58fee
    6ebb2d0
    48c9721
    04a6844
    ccd3566
    b599a9f
    d7c5e96
    37c140c
    a69d85f
    0d4b34e
  7. added a commit that references this issue on Nov 15, 2026
    d395115
  8. added a commit that references this issue on Nov 23, 2026
    69f6dc3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyimprovementservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions