From 0b60fe844e0d3b61c3ee98a74e6629dbc082eba7 Mon Sep 17 00:00:00 2001 From: "Tommy D. Rossi" Date: Wed, 4 Feb 2026 18:16:00 +0100 Subject: [PATCH] chore: update diff messaging from tests - Add "No changes since last call" hints for snapshots/html/markdown - Adjust truncation message to suggest search - Update skill.md snapshot behavior doc --- playwriter/src/clean-html.ts | 3 +++ playwriter/src/executor.ts | 5 ++++- playwriter/src/page-markdown.ts | 3 +++ playwriter/src/skill.md | 2 +- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/playwriter/src/clean-html.ts b/playwriter/src/clean-html.ts index 6162bb4..cf51d1e 100644 --- a/playwriter/src/clean-html.ts +++ b/playwriter/src/clean-html.ts @@ -83,6 +83,9 @@ export async function getCleanHTML(options: GetCleanHTMLOptions): Promise MAX_LENGTH) { finalText = finalText.slice(0, MAX_LENGTH) + - `\n\n[Truncated to ${MAX_LENGTH} characters. Better manage your logs or paginate them to read the full logs]` + `\n\n[Truncated to ${MAX_LENGTH} characters. Use search to find specific content]` } const images = screenshotCollector.map((s) => ({ data: s.base64, mimeType: s.mimeType })) diff --git a/playwriter/src/page-markdown.ts b/playwriter/src/page-markdown.ts index 8918de3..c75b7f1 100644 --- a/playwriter/src/page-markdown.ts +++ b/playwriter/src/page-markdown.ts @@ -179,6 +179,9 @@ export async function getPageMarkdown(options: GetPageMarkdownOptions): Promise< newContent: markdown, label: 'content', }) + if (diffResult.type === 'no-change') { + return 'No changes since last call. Use showDiffSinceLastCall: false to see full content.' + } return diffResult.content } diff --git a/playwriter/src/skill.md b/playwriter/src/skill.md index 85d23e7..7e51b50 100644 --- a/playwriter/src/skill.md +++ b/playwriter/src/skill.md @@ -245,7 +245,7 @@ await accessibilitySnapshot({ page, search?, showDiffSinceLastCall? }) - `search` - string/regex to filter results (returns first 10 matching lines) - `showDiffSinceLastCall` - returns diff since last snapshot (default: `true`). Pass `false` to get full snapshot. -Snapshots return full content on first call, then diffs on subsequent calls. Diff is only returned when shorter than full content. +Snapshots return full content on first call, then diffs on subsequent calls. If nothing changed, returns "No changes since last snapshot" message. Use `showDiffSinceLastCall: false` to always get full content. Example output: