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
This commit is contained in:
@@ -83,6 +83,9 @@ export async function getCleanHTML(options: GetCleanHTMLOptions): Promise<string
|
||||
newContent: htmlStr,
|
||||
label: 'html',
|
||||
})
|
||||
if (diffResult.type === 'no-change') {
|
||||
return 'No changes since last call. Use showDiffSinceLastCall: false to see full content.'
|
||||
}
|
||||
return diffResult.content
|
||||
}
|
||||
|
||||
|
||||
@@ -571,6 +571,9 @@ export class PlaywrightExecutor {
|
||||
newContent: snapshotStr,
|
||||
label: 'snapshot',
|
||||
})
|
||||
if (diffResult.type === 'no-change') {
|
||||
return 'No changes since last snapshot. Use showDiffSinceLastCall: false to see full content.'
|
||||
}
|
||||
return diffResult.content
|
||||
}
|
||||
|
||||
@@ -869,7 +872,7 @@ export class PlaywrightExecutor {
|
||||
if (finalText.length > 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 }))
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user