Skip to content

fix: Prevent insert-fragment from hanging on a styled nested SVG #6132

Description

@webstudio-issue-reporter

User story

As a Webstudio user, I want a small native inline SVG fragment with editable styles to insert without stalling the authoring workflow.

Summary

insert-fragment repeatedly stalled with no structured result when the authored fragment included a local ws:style block on a nested SVG element.

What the agent tried

  1. Inspect the target hierarchy and retrieve the current insert-fragment schema.
  2. Dry-run a small anchor containing an inline SVG and a local ws:style declaration on that SVG.
  3. Retry the same documented operation through the explicit single-op-call form.

Expected behavior

The dry run should either return a planned transaction or a structured validation error within the normal tool timeout.

Actual result

The operation repeatedly stalled until the calling process ended and produced no stdout, stderr, transaction, or diagnostic result.

Recovery attempts

  1. Removed token styles from the fragment and retried.
  2. Removed the nested SVG local ws:style block and retried.
  3. Inserted the simplified native fragment successfully, then applied the SVG styles with update-styles and attached the reusable visual token separately.

User impact

A small native UI change required multiple retries and an undocumented split-mutation workaround, increasing implementation time and uncertainty.

Technical context

The failure occurred with CLI version 0.290.0 using insert-fragment. A comparable fragment without the nested SVG ws:style declaration completed successfully, and the same declarations were accepted later by update-styles.

Agent environment

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

Technical runtime

  • CLI: 0.290.0
  • Node.js: 26.0.0
  • Operating system: darwin 25 (arm64)
  • Execution mode: mcp
  • API contract: public-api:iqd6ok

Acceptance criteria

  1. insert-fragment completes or returns a structured error for a nested SVG carrying ws:style.
  2. A regression test covers an anchor with an inline SVG and a pointer-events declaration.
  3. The tool never exits silently or stalls without a diagnostic for this input shape.

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