fix: preserve inline frontmatter values

This commit is contained in:
Peter Steinberger
2026-01-17 19:54:44 +00:00
parent 1e2ab8bf1e
commit 31c6f178f3
2 changed files with 11 additions and 2 deletions

View File

@@ -12,6 +12,7 @@ Docs: https://docs.clawd.bot
### Fixes
- Doctor: avoid re-adding WhatsApp ack reaction config when only legacy auth files exist. (#1087) — thanks @YuriNachos.
- Hooks: parse multi-line/YAML frontmatter metadata blocks (JSON5-friendly). (#1114) — thanks @sebslight.
- CLI: add WSL2/systemd unavailable hints in daemon status/doctor output.
- Status: show both usage windows with reset hints when usage data is available. (#1101) — thanks @rhjoh.
- Memory: probe sqlite-vec availability in `clawdbot memory status`.

View File

@@ -123,7 +123,15 @@ export function parseFrontmatterBlock(content: string): ParsedFrontmatter {
if (endIndex === -1) return {};
const block = normalized.slice(4, endIndex);
const lineParsed = parseLineFrontmatter(block);
const yamlParsed = parseYamlFrontmatter(block);
if (yamlParsed !== null) return yamlParsed;
return parseLineFrontmatter(block);
if (yamlParsed === null) return lineParsed;
const merged: ParsedFrontmatter = { ...yamlParsed };
for (const [key, value] of Object.entries(lineParsed)) {
if (value.startsWith("{") || value.startsWith("[")) {
merged[key] = value;
}
}
return merged;
}