Skip to content

Commit 13d622a

Browse files
tool inputs badger
1 parent 701088b commit 13d622a

3 files changed

Lines changed: 8 additions & 1 deletion

File tree

lib/prompts/compress.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ WHERE TO PICK STRINGS FROM (important for reliable matching):
6161
- The user's own words in their messages
6262
- Tool result output text (distinctive substrings within the output)
6363
- Previous compress summaries
64-
- Tool input string values (individual values, not whole serialized objects)
64+
- Tool input string values (LEAST RELIABLE - only single concrete field values, not keys or schema fields, may be transformed by AI SDK)
6565

6666
NEVER USE GENERIC OR REPEATING STRINGS:
6767

@@ -83,6 +83,9 @@ WHERE TO NEVER PICK STRINGS FROM:
8383
- Strings that span across message or part boundaries
8484
- Entire serialized JSON objects (key ordering may differ - pick a distinctive substring within instead)
8585

86+
CRITICAL: AVOID USING TOOL INPUT VALUES
87+
NEVER use tool input schema keys or field names as boundary strings (e.g., "startString", "endString", "filePath", "content"). These may be transformed by the AI SDK and are not reliable. The ONLY acceptable use of tool input strings is a SINGLE concrete field VALUE (not the key), and even then, prefer using assistant text, user messages, or tool result outputs instead. When in doubt, choose boundaries from your own assistant responses or distinctive user message content.
88+
8689
PARALLEL COMPRESS EXECUTION
8790
When multiple independent ranges are ready and their boundaries do not overlap, launch MULTIPLE `compress` calls in parallel in a single response. Run compression sequentially only when ranges overlap or when a later range depends on the result of an earlier compression.
8891

lib/prompts/nudge.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ If you are performing a critical atomic operation, do not interrupt it, but make
3535

3636
BE VERY MINDFUL of the startString and endString you use for compression for RELIABLE boundary matching. NEVER use generic tool outputs like "Edit applied successfully." or generic status message as boundaries. Use unique assistant text or distinctive content instead with enough surrounding context to ensure uniqueness.
3737

38+
CRITICAL: AVOID USING TOOL INPUT VALUES AS BOUNDARIES
39+
NEVER use tool input schema keys or field names. The ONLY acceptable use of tool input strings is a SINGLE concrete field VALUE (not the key), and even then, prefer assistant text, user messages, or tool result outputs instead.
40+
3841
Ensure your summaries are inclusive of all parts of the range.
3942
If the compressed range includes user messages, preserve user intent exactly. Prefer direct quotes for short user messages to avoid semantic drift.
4043
</instruction>

lib/prompts/system.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ NEVER use generic tool status messages as boundaries (e.g. "Edit applied success
3131
RESPECT THE CHRONOLOGY OF THE RANGE
3232
STARTSTRING MUST ALWAYS BE ABOVE ENDSTRING
3333
ENDSTRING MUST ALWAYS BE BELOW STARTSTRING
34+
DO NOT USE A TOOL SCHEMA FIELD FOR START OR END STRING.
3435

3536
THE SUMMARY STANDARD
3637
Your summary MUST be technical and specific enough to preserve FULL understanding of what transpired, such that NO ambiguity remains about what asked, found, planned, done, or decided - yet noise free

0 commit comments

Comments
 (0)