You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 05dca95
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: src/hooks_read.ts
+8-4Lines changed: 8 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -401,7 +401,7 @@ function symbolsMeetingRange(
401
401
returnfound
402
402
}
403
403
404
-
/** Names up to 3 real symbols indexed for `filePath` instead of the bare `::Symbol`/`::SymbolName` placeholder a deny/hint text would otherwise print even when the file has none. When `range` is given (a ranged Read's offset/limit), symbols overlapping those lines are preferred over the file's first few. Falls back to a line-range read (`range` given) or `outline` (whole-file) when the file has no indexed symbols at all, since a bare `::Symbol` read would just fail. When the top pick is a large symbol (see {@link isLargeSymbolSpan}), the hint points at a `grep -C --symbol` slice (or `scope` to confirm the enclosing symbol) instead of naming it for a whole-body read. */
404
+
/** Names up to 3 real symbols indexed for `filePath` instead of the bare `::Symbol`/`::SymbolName` placeholder a deny/hint text would otherwise print even when the file has none. It attempts the synchronous stale-index heal before querying so a newly created or edited file does not look symbol-less while the worker is behind. When `range` is given (a ranged Read's offset/limit), symbols overlapping those lines are preferred over the file's first few. Falls back to a line-range read (`range` given) or `outline` (whole-file) when parsing still yields no indexed symbols. When the top pick is a large symbol (see {@link isLargeSymbolSpan}), the hint points at a `grep -C --symbol` slice (or `scope` to confirm the enclosing symbol) instead of naming it for a whole-body read. */
@@ -1143,6 +1143,9 @@ function preReadHandlerInner(event: HookEvent): HookOutput {
1143
1143
// Grep's cost/relevance depends on its pattern, not just the directory/file it's scoped to — re-scoping several Greps at the same path with different patterns is a legitimate workflow, so Grep is exempt from the count-based re-read dedup below (unlike a repeated whole-file Read).
? ' Recently edited -- run `git diff HEAD -- '+quotedArg(shown)+'` or `token-goat changed --symbol` to inspect recent changes.'
1148
+
: ''
1146
1149
// Both counts are epoch-scoped: a read from before the last compaction no longer describes what the model currently holds, so it neither counts toward a deny nor shows in the "N reads" a deny quotes. `fullReads` is whole-file re-reads only -- a file touched by nothing but a few narrow offset/limit/view-range slices has never actually been read in full, so the count-based denies below (which assume every prior touch handed over the whole file) must gate on it, not on `reads`, which a slice bumps too.
'Sequential line-range paging detected on '+readSubject(normalized,hint)+' ('+(prevRanges.length+1)+' slices read). '+hint+
1280
+
editedPagingHint+
1277
1281
' Inspect structure directly without manual chunk paging. Delegate bounded symbol or code extraction to an explore agent (specifically GPT-6 Luna, else Haiku or equivalent) rather than getting stuck in micro-paging loops. Further Read/view line ranges of this file will be denied.',
1278
1282
)
1279
1283
}
@@ -1282,8 +1286,8 @@ function preReadHandlerInner(event: HookEvent): HookOutput {
realSymbolReadHint(normalized,shown,activeSpan)+', or delegate bounded extraction to an explore agent (specifically Luna, else Haiku).'
1369
+
realSymbolReadHint(normalized,shown,activeSpan)+', or delegate bounded extraction to an explore agent (specifically Luna, else Haiku).'+editedPagingHint
1366
1370
: ''
1367
1371
// A ranged Read whose window touches no line served before, with no whole-file read behind it, hands over lines the model has never seen: the already-read note would be false.
0 commit comments