Skip to content

Bug: | block scalar description in safe-inputs breaks generated Python script #18745

@srgibbs99

Description

@srgibbs99

Bug: | block scalar description in safe-inputs breaks generated Python script

Version: v0.50.6

Summary

When a safe-inputs tool uses YAML | (literal block scalar) for its description, gh aw compile emits only the first line with a # prefix. The remaining lines are written as bare unindented text, causing a SyntaxError at runtime.

Minimal repro

safe-inputs:
  my-tool:
    description: |
      First line of description.
      Second line of description.
      Third line of description.
    inputs:
      foo:
        type: string
    py: |
      print("hello")

After gh aw compile, the generated Python script contains:

# Auto-generated safe-input tool: my-tool
# First line of description.
          Second line of description.
          Third line of description.

The continuation lines have no # prefix, so Python raises:

SyntaxError: invalid syntax

The tool fails silently — the agent receives an MCP error and proceeds without it for the entire run.

Expected behavior

All lines of the block scalar description should be emitted as #-prefixed comments.

Workaround

Use a quoted single-line string instead of |:

    description: "First line of description. Second line of description."

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions