Skip to content

fix: Return a structured result when an MCP run terminates #6032

Description

@webstudio-issue-reporter

User story

As an agent running several read-only verification calls in one MCP session, I need every run to return a terminal structured result so I can determine which checks completed.

Summary

A multi-call MCP run ended after the lifecycle event that started its final read-only preview query. It emitted neither a terminal lifecycle event for that call nor the run's structured JSON result.

What the agent tried

  1. Started one MCP run containing four sequential read-only calls.
  2. Observed successful terminal lifecycle events for the first three calls.
  3. Waited for the fourth preview query and the run's structured result.

Expected behavior

The final call should emit either success or failure, and the run should always return structured JSON that includes terminal status and any partial call results.

Actual result

The process ended after reporting that the final preview query had started. No success or failure event and no structured run result were returned.

Recovery attempts

  1. Polled the active process twice for additional output.
  2. Inspected the lifecycle stream to confirm the earlier calls had completed before the missing terminal event.

User impact

Batch verification cannot be parsed or trusted, so each read-only check must be repeated in a separate process and automation cannot distinguish termination from success.

Technical context

The workflow used the source-tree CLI in MCP execution mode. The final operation was a read-only asset query preview; no write was in progress.

Agent environment

  • Client: Codex
  • Provider: OpenAI
  • Model: unknown
  • Reasoning effort: unknown
  • Trigger: automatic-friction
  • Category: hang-or-crash

Acceptance criteria

  1. Every MCP run emits a structured terminal result on both success and failure.
  2. Unexpected termination preserves completed call results and identifies the unfinished call.
  3. A regression test covers a multi-call run that terminates during a read-only preview operation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions