Skip to content

feat: thread-based session continuity#1

Merged
Chanki-Min merged 7 commits intomainfrom
feat/thread-session-continuity
Mar 6, 2026
Merged

feat: thread-based session continuity#1
Chanki-Min merged 7 commits intomainfrom
feat/thread-session-continuity

Conversation

@Chanki-Min
Copy link
Copy Markdown
Owner

Summary

  • 같은 Slack 쓰레드 내에서 Claude 세션이 자동으로 이어지도록 구현
  • 봇이 포스팅한 세션 정보에서 마지막 세션 ID를 역추출하여 --session-id로 전달
  • session:new (새 세션 강제), session:<uuid> (특정 세션 지정) 프리픽스 지원
  • 세션 이어가기 시 thread context 중복 주입 방지

Changes

파일 변경
parser.ts session: prefix 파싱 + extractPrefix 헬퍼로 중복 제거
handler.ts resolveSessionId (우선순위 기반 세션 결정), fetchThreadContext 반환 타입 확장, SESSION_ID_RE
handler.test.ts resolveSessionId 5개 분기 테스트
parser.test.ts session: 파싱 테스트

Test plan

  • bun test — 60개 전체 통과
  • biome check — 린트 클린
  • Slack 쓰레드에서 실제 세션 이어가기 동작 확인
  • session:new 로 새 세션 강제 시작 확인
  • session:<uuid> 로 다른 쓰레드 세션 이어가기 확인

🤖 Generated with Claude Code

Chanki-Min and others added 7 commits March 6, 2026 09:48
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add session field to ParsedMessage (session:new, session:<uuid>)
- Extract extractPrefix helper to eliminate 3x repeated parsing blocks
- Add tests for session parsing and combined prefix usage

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Extract last session ID from bot messages in thread via regex
- Add resolveSessionId with priority: session:new > session:<id> > thread > new
- Return SessionResolution { sessionId, isResuming } to eliminate duplicated logic
- Skip thread context injection when resuming (Claude session has history)
- Fix SESSION_ID_RE to match both block format and text fallback

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Verify regex matches both text fallback and block format
- Test last-wins behavior with multiple session messages
- Test non-UUID strings are rejected

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
--session-id creates a new conversation with a specific UUID, which
causes "Session ID already in use" errors when trying to continue an
existing session. Use --resume for session resumption instead.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Chanki-Min Chanki-Min merged commit 8395915 into main Mar 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant