Skip to content

Commit 623ee30

Browse files
t3dotggclaude
andcommitted
fix(client-runtime): thought heading also matches Windows line endings
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
1 parent 59e1eac commit 623ee30

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

‎packages/client-runtime/src/work-log/presentation.test.ts‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -983,6 +983,9 @@ describe("liveThoughtLine", () => {
983983
expect(
984984
liveThoughtLine("**Narrowing dispatch files**\n\nI should check the adapter. Then more."),
985985
).toBe("Narrowing dispatch files");
986+
expect(liveThoughtLine("**Narrowing dispatch files**\r\n\r\nI should check the adapter.")).toBe(
987+
"Narrowing dispatch files",
988+
);
986989
});
987990

988991
it("returns unpunctuated text whole and flattens markdown", () => {

‎packages/client-runtime/src/work-log/presentation.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,7 @@ export function toolGroupSummaryKind(
761761
* the first sentence of the reasoning text. Web and mobile both render it.
762762
*/
763763
export function liveThoughtLine(markdown: string): string {
764-
const heading = /^\s*\*\*([^*\n]+)\*\*[ \t]*(?:\n|$)/.exec(markdown)?.[1];
764+
const heading = /^\s*\*\*([^*\r\n]+)\*\*[ \t]*\r?(?:\n|$)/.exec(markdown)?.[1];
765765
const text = (heading ?? markdown)
766766
.replace(/!?\[([^\]]*)\]\([^)]*\)/g, "$1")
767767
.replace(/^[ \t]*(?:#{1,6}|[-*+]|\d+\.)[ \t]+/gm, "")

0 commit comments

Comments
 (0)