fix(compaction): match artifact refs from both soft trim and truncation markers

The extractArtifactRef regex only matched "Full result saved to" (from
pre-emptive truncation) but not "Full result available at" (from soft
trim). This caused hard clear to lose artifact references when preceded
by soft trim in the same pruning pass.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jiayuan Zhang 2026-02-15 23:13:05 +08:00
parent a1ac250e2b
commit 58f02a2080

View file

@ -283,7 +283,7 @@ function takeTail(text: string, maxChars: number): string {
* Returns the artifact relative path, or null if not found.
*/
function extractArtifactRef(text: string): string | null {
const match = text.match(/Full result saved to (artifacts\/[^\s.]+\.txt)/);
const match = text.match(/Full result (?:saved to|available at) (artifacts\/[^\s.]+\.txt)/);
return match?.[1] ?? null;
}