mirror of
https://github.com/logancyang/obsidian-copilot.git
synced 2026-07-22 07:50:24 +00:00
fix: preserve raw stdout for daily:read to avoid stripping Markdown whitespace
Only trim stdout for non-read commands (append, prepend, path) where whitespace is not semantically meaningful. Read commands return note content where leading/trailing whitespace may be intentional. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
605b846b8c
commit
d2c81b5655
1 changed files with 5 additions and 1 deletions
|
|
@ -59,11 +59,15 @@ export const obsidianDailyNoteTool = createLangChainTool({
|
|||
|
||||
if (!result.ok) throwCliFailure(result);
|
||||
|
||||
// Preserve raw stdout for read commands — trimming may alter meaningful Markdown whitespace.
|
||||
// Non-read commands (append, prepend, path) return short status strings where trimming is safe.
|
||||
const content = command === "daily:read" ? result.stdout : result.stdout.trim();
|
||||
|
||||
return {
|
||||
type: "obsidian_cli_daily_note",
|
||||
command: result.command,
|
||||
vault: vault ?? null,
|
||||
content: result.stdout.trim(),
|
||||
content,
|
||||
durationMs: result.durationMs,
|
||||
};
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue