Skip to content

Fix cleanSummary dropping and duplicating text around $ in the summary - #104

Merged
ernestrc merged 3 commits into
unstablebuild:mainfrom
ejb711:fix-summary-dollar-expansion
Sep 20, 2026
Merged

ernestrc merged 3 commits into
unstablebuild:mainfrom
ejb711:fix-summary-dollar-expansion

Conversation

@ejb711

@ejb711 ejb711 commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

cleanSummary rebuilt the summary with regexp.ReplaceAllString, whose replacement string expands
$ sequences: $HOME is read as a named group and becomes empty, $1 is the whole captured summary.
A summary that mentions $HOME lost that text, and one that mentions $1 had the entire summary
pasted in again, before being persisted as the resume prompt. Coding-session summaries mention shell
variables and positional arguments routinely.

Use ReplaceAllLiteralString so the summary text is kept as written.

Test: a TestCleanSummary row with $HOME, $1 and $5; on main it yields
Summary:\nSet and ran ./build.sh \nSet $HOME and ran ./build.sh $1; cost was $5\n; cost was.

cleanSummary rebuilt the summary with regexp ReplaceAllString, which expands $ sequences
in the replacement. A summary mentioning $HOME lost that text, and one mentioning $1
had the whole summary pasted in again, before being persisted as the resume prompt. Use
the literal replacement so the summary text is kept as written.

Signed-off-by: Eric Brooks <[email protected]>
@codecov

codecov Bot commented Sep 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@ernestrc
ernestrc merged commit b358106 into unstablebuild:main Sep 20, 2026
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants