fix: preserve line breaks in thinking output#144
fix: preserve line breaks in thinking output#144Huarong wants to merge 2 commits intoopenclaw:mainfrom
Conversation
Triage resultHuman attention: Quick readPR intent: preserve multi-line IntentMake the text-mode CLI output preserve multi-line agent thinking exactly enough to stay readable, instead of flattening it into one line. Why
Codex reviewNo GitHub Codex review findings were collected for the current head. The established local Codex review reported no discrete correctness issue that would warrant a follow-up fix. Targeted validation reproduced and confirmed the fix:
CI/CDThe initial CI workflow run was approval-blocked with RecommendationThis PR is ready for human landing decision. If the change aligns with maintainer expectations for text-mode thought rendering, it can proceed through normal human review and landing. |
8c115ef to
7858125
Compare
* fix: preserve line breaks in thinking output * docs(changelog): note thinking output line-break fix (#144) --------- Co-authored-by: huohuarong <huohuarong@zuoshouyisheng.com>
Summary
This change preserves line breaks in text-mode thinking output instead of collapsing all whitespace into a single line.
Problem
agent_thought_chunkcontent is currently rendered throughcollapseWhitespace(...), which flattens\ninto spaces before printing. This makes multi-line reasoning hard to read and loses structure that agents intentionally send.Changes
\nwhen flushing buffered thought text[thinking]block instead of a single flattened lineWhy this should be separate
This PR only fixes formatting/readability. It does not change when thought chunks are emitted.
Testing
./node_modules/.bin/tsc -p tsconfig.test.jsonnode --test dist-test/test/output.test.js