(stale: PendingFile[])
| 398 | * without waiting for the debounced sync (issue #403). |
| 399 | */ |
| 400 | export function formatStaleBanner(stale: PendingFile[]): string { |
| 401 | const now = Date.now(); |
| 402 | const lines = stale.map((p) => { |
| 403 | const ageMs = Math.max(0, now - p.lastSeenMs); |
| 404 | const label = p.indexing ? 'indexing in progress' : 'pending sync'; |
| 405 | return ` - ${p.path} (edited ${ageMs}ms ago, ${label})`; |
| 406 | }); |
| 407 | return ( |
| 408 | '⚠️ Some files referenced below were edited since the last index sync — ' + |
| 409 | 'their codegraph entries may be stale:\n' + |
| 410 | lines.join('\n') + |
| 411 | '\nFor accurate content of those specific files, Read them directly. ' + |
| 412 | 'The rest of this response is fresh.' |
| 413 | ); |
| 414 | } |
| 415 | |
| 416 | /** |
| 417 | * Compact footer listing pending files that are NOT referenced in this |
no test coverage detected