fix: read 200 tail lines to find preview through progress noise
Claude Code emits many progress lines during work, burying the last assistant text. 5 lines was not enough to reach it. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -188,7 +188,7 @@ func FindSessionForProcess(claudeDir string, proc Process) (string, []JSONLMessa
|
||||
})
|
||||
|
||||
newest := topLevel[0]
|
||||
messages, err := TailReadJSONL(newest, 5)
|
||||
messages, err := TailReadJSONL(newest, 200)
|
||||
if err != nil {
|
||||
return "", nil, err
|
||||
}
|
||||
|
||||
4
state.go
4
state.go
@@ -63,8 +63,8 @@ func DetectState(messages []JSONLMessage, now time.Time) SessionState {
|
||||
return Unknown
|
||||
}
|
||||
|
||||
// ExtractPreview finds the last assistant text content and returns the first
|
||||
// 5 lines, truncated to 300 characters.
|
||||
// ExtractPreview finds the last assistant text content and returns
|
||||
// the first 5 lines, truncated to 300 characters.
|
||||
func ExtractPreview(messages []JSONLMessage) string {
|
||||
for i := len(messages) - 1; i >= 0; i-- {
|
||||
msg := messages[i]
|
||||
|
||||
Reference in New Issue
Block a user