GeezerVison is showing github.com — fix(core): preserve yaml flow collections during frontmatter repair by neriousy · Pull Request #65119 · anomalyco/opencode
Conversation
neriousy
commented
Nov 20, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
Issue for this PR
Fixes #65088
Type of change
- Bug fix
- New feature
- Refactor / code improvement
- Documentation
What does this PR do?
When frontmatter fails to parse, sanitize rewrites broken lines as block scalars. It also rewrote valid flow collections on other lines (model: { ... }, permissions: [{ ... }]), so they became strings and the agent was skipped. sanitize now tracks [/{ nesting (quotes, comments and multi-line collections included) and only rewrites a flow value when text follows it, as in [Team] Does a thing. Other lines with a colon are left alone when they are already valid YAML.
One behavior change in the repair path: valid lines keep their YAML types instead of becoming strings (time: 12:30 is now 750, the same as when no repair runs). This also fixes key: |- # see: docs, which used to become the literal text |- # see: docs.
How did you verify your code works?
Unit tests in markdown.test.ts, an agent-loading test in agent.test.ts, and the issue's review.md/control.md via serve + debug agents --server: both agents load with example/chat#high. bun typecheck in core and bun run check pass.
Screenshots / recordings
N/A
Checklist
- I have tested my changes locally
- I have not included unrelated changes in this PR
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I reproduced #65088 on the base with the issue's review.md/control.md (running serve from source with debug agents --server, because --standalone doesn't start from source): review was skipped because model became a string. With this PR both agents load with example/chat#high. The core config tests and typecheck:tsc pass.
I also compared edge cases on the base and the PR. [Tag] text, unquoted colons, URLs, block scalars and unclosed flow collections behave the same as before. Flow values followed by a # comment and quoted } inside a flow value now parse correctly.
Public API is unchanged: this only affects the frontmatter fallback repair.
No blocking concerns.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new commit only moves the FlowState type and adds a test for |- # see: docs headers. My earlier review had no concerns to address. I re-checked the new head: the issue's review.md/control.md both load with example/chat#high (via serve + debug agents --server), and the core config tests and typecheck:tsc pass.
The public API is unchanged. No new concerns.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
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.
|