Skip to content

Commit ba9e9b8

Browse files
committed
doc: note lease last importance
1 parent f7d6845 commit ba9e9b8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/services/tools/file_read.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,15 @@ export const createFileReadTool: ToolFactory = (config: ToolConfiguration) => {
137137
const content = numberedLines.join("\n");
138138

139139
// Return file info and content
140+
// IMPORTANT: lease must be last in the return object so it remains fresh in the LLM's context
141+
// when it's reading this tool result. The LLM needs the lease value to perform subsequent edits.
140142
return {
141143
success: true,
142144
file_size: stats.size,
143145
modifiedTime: stats.mtime.toISOString(),
144146
lines_read: numberedLines.length,
145147
content,
146-
lease,
148+
lease, // Must be last - see comment above
147149
};
148150
} catch (error) {
149151
// Handle specific errors

0 commit comments

Comments
 (0)