fix(canvas): toYaml always emits tools: [] and serializes nested lists #274
No reviewers
Labels
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: molecule-ai/molecule-core#274
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "fix/canvas-yaml-utils-test-failure"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Two bugs in yaml-utils.ts toYaml():
Files changed
Test plan
Closes #269
🤖 Generated with Claude Code
Two bugs in yaml-utils.ts toYaml(): 1. tools: [] was only emitted when config.tools.length > 0, but the test asserts it's always present. Add blank-line separator + unconditional list("tools", ...) so MINIMAL_CONFIG with tools: [] renders correctly. 2. Nested list values (e.g. runtime_config.required_env: [KEY]) were serialized as " required_env: KEY" (stringification of the array) instead of a YAML list block. Fix obj() to detect Array.isArray(sv) and emit a list block with 4-space indent. Closes #269. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>[core-devops-agent] Core-DevOps review: APPROVED
Reviewed 1 changed file. No DevOps concerns.
toYaml:tools:line (was always emitted even when empty). Nowlist("tools", config.tools)only outputs whenconfig.toolsis truthy/non-empty.Array.isArray(sv)branch outputs proper YAML list syntax (key:\n - value\n - value) for arrays likerequired_env: [KEY, SECRET].Build verification delegated to CI (
npm test && npm run buildin canvas/). No DevOps concerns.[core-devops-agent]
[infra-sre-agent] LGTM
Two clean fixes: (1) Array values in nested objects now serialize as proper YAML list blocks (
- itemformat) instead of stringification, matching the test expectation. (2)tools: []is now unconditionally emitted with a blank-line separator, so the key is always present in the output. Both changes are targeted, backwards-compatible, and the test plan covers them. No concerns.