mirror of
https://github.com/wassname/pi-dynamic-context-pruning.git
synced 2026-06-27 16:46:12 +08:00
fix: match overlap error to actual tool parameter schema
This commit is contained in:
+6
-3
@@ -205,12 +205,15 @@ export function registerCompressTool(
|
|||||||
.join(', ')
|
.join(', ')
|
||||||
|
|
||||||
const gapInfo = gaps.length > 0
|
const gapInfo = gaps.length > 0
|
||||||
? gaps.map(g => `compress(${g.replace('..', ', ')})`).join('; ')
|
? gaps.map(g => {
|
||||||
|
const [s, e] = g.split('..')
|
||||||
|
return `{startId: "${s}", endId: "${e}"}`
|
||||||
|
}).join(', ')
|
||||||
: 'none available — all visible messages are covered by existing blocks'
|
: 'none available — all visible messages are covered by existing blocks'
|
||||||
|
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`You tried compress(${startId}, ${endId}) but this overlaps existing summaries: ${overlapInfo}. ` +
|
`Range {startId: "${startId}", endId: "${endId}"} overlaps existing summaries: ${overlapInfo}. ` +
|
||||||
`Instead use: ${gapInfo}`,
|
`Available ranges: ${gapInfo}`,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user