fix(yaml): pin goose recipe prompt block-scalar indentation#3343
Open
Quratulain-bilal wants to merge 1 commit into
Open
fix(yaml): pin goose recipe prompt block-scalar indentation#3343Quratulain-bilal wants to merge 1 commit into
Quratulain-bilal wants to merge 1 commit into
Conversation
the goose recipe renderer emitted the prompt body under a bare '|' block scalar. yaml infers a plain block scalar's indentation from its first non-empty line, so a command body whose first line is itself indented (a markdown code block, a nested list item) made the parser expect that deeper indent for the whole block and reject the later, shallower lines - the generated .goose recipe then failed to parse. use an explicit '|2' indentation indicator so the block is always read at 2 spaces regardless of the body. added a regression test that round-trips an indented-first-line body through the yaml parser.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fixes #3342
the goose recipe renderer wrote the prompt body under a bare
|block scalar. yaml infers a plain block scalar's indentation from its first non-empty line, so a command body whose first line is itself indented (a markdown code block, a nested list item) made the parser expect that deeper indent for the whole block and reject the later, shallower lines. the generated.gooserecipe then failed to parse. a plain body was unaffected, which is why the existing fixtures didn't catch it.the fix uses an explicit
|2indentation indicator so the block is always read at 2 spaces regardless of what the body looks like. the body is already emitted at a fixed 2-space indent, so this just tells the parser what the renderer already does.added a regression test (
test_yaml_prompt_with_indented_first_line_stays_valid) that round-trips an indented-first-line body through the yaml parser. i confirmed it fails on the pre-fix code by stashing the source and re-running, and the full goose/yaml suites pass with the fix.