Skip to content

fix unterminated string errors in workflow edit tool args #20757

@sudorest

Description

@sudorest

Summary

GitLab Duo workflow edit-writing flows can fail with unterminated string errors when tool arguments are wrapped in fenced JSON or surrounding prose instead of being emitted as a strict JSON object.

Reproduction

  1. Use a GitLab workflow-backed model in opencode.
  2. Trigger an edit-writing flow that emits a tool call with multiline arguments.
  3. Observe the tool execution path fail before the tool runs when the arguments are wrapped or malformed.

Expected

The workflow tool executor should tolerate common wrapper formats around object-shaped JSON tool args, while still rejecting malformed inputs cleanly.

Actual

The executor calls JSON.parse directly on the raw args string, which surfaces parser failures like unterminated string during edit-writing flows.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions