fix: surface refs for live sessions with stale HasRefs#71
Merged
Conversation
A live (in-progress) session keeps growing after the scan that set HasRefs, so a PR/Jira URL written moments ago (e.g. a PR just created in that same session) hasn't flipped HasRefs yet — the flag is a stale snapshot. The References preview gated its offline extract on HasRefs, so such links showed 'No PR or Jira links in this session' until a rescan/refresh. - updateSessionRefsPreview now treats live sessions as possibly-having-refs (mayHaveRefs = HasRefs || IsLive) and runs the cheap offline extract straight off the file, so freshly-added links surface without waiting for a rescan. - Empty-state render uses mayHaveRefs so a live session with a pending extract shows 'Resolving…' instead of the misleading 'No PR or Jira links'. - refsInFlight dedup + updateSessionPreview cacheKey still gate re-parsing. Regression test: TestLiveSessionDispatchesExtractWithoutHasRefs.
Kairo-Kim
approved these changes
Jul 16, 2026
mitrilmad
approved these changes
Jul 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
라이브(진행 중) 세션에서 방금 만든 PR/Jira 링크가 References 패널에 안 뜨고 "No PR or Jira links in this session" 이 뜨는 문제.
원인: 세션 스캐너는 JSONL에
/pull/이 있으면HasRefs=true로 켜는데, 라이브 세션은 스캔 이후에도 파일이 계속 커진다. PR URL이 방금 기록됐다면 그 시점 스냅샷의HasRefs는 아직 false다. References preview는 offline extract를HasRefs에 gate하고 있어서, rescan/refresh 전까지 링크가 안 나타났다.Fix
updateSessionRefsPreview가 라이브 세션은mayHaveRefs = HasRefs || IsLive로 취급 → 파일에서 바로 offline extract(ExtractSessionRefsFromFile, 네트워크 없음, 빠름) 실행. rescan 안 기다리고 즉시 링크 표시.mayHaveRefs사용 → 라이브 세션은 extract 진행 중일 때 "No PR..." 대신 "Resolving…" 표시.refsInFlightdedup +updateSessionPreviewcacheKey 게이트가 프레임당 재파싱을 계속 막으므로 CPU 스파이크 없음.Test
TestLiveSessionDispatchesExtractWithoutHasRefs(HasRefs=false + IsLive=true 에서 extract 발동 + "Resolving…" 표시 검증)go build ./...,go vet ./...,go test ./...전부 통과