fix(canvas): toYaml always emits tools: [] and serializes nested lists #274

Merged
release-manager merged 1 commits from fix/canvas-yaml-utils-test-failure into staging 2026-05-10 09:29:33 +00:00

1 Commits

Author SHA1 Message Date
854803b3ee fix(canvas): toYaml always emits tools: [] and serializes nested lists
Some checks failed
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 29s
sop-tier-check / tier-check (pull_request) Failing after 27s
audit-force-merge / audit (pull_request) Successful in 44s
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>
2026-05-10 09:18:27 +00:00