Repository navigation
큰 도구 결과 한 줄 때문에 세션 읽기가 멈추지 않는다 - #860
Merged
Merged
Conversation
A Claude Code tool result over the 256 KiB line cap (a screenshot Claude Code writes inline as base64) carries a tool_use_id, and the large-record scan treated every such result as a possible question answer it could not certify, so the read failed at that record forever. The session's labels froze, its turn state never settled, and every letter to the agent was held as session_unread until it expired undelivered. The scan now keeps the bounded native ids a record's turn mark needs (a block's id or tool_use_id, a Codex CLI call_id, turn_id and mode) and folds that mark when it discards the body: a result answers its call, a question waits with its content absent, and a Codex CLI plan or lifecycle record keeps its turn. Conversation text and unclassifiable envelopes still fail the read. A checkpoint an older scan took inside such a record is reread from the record's start, so sessions that are already stuck recover.
yansfil
added a commit
that referenced
this pull request
Oct 9, 2026
Related: #860 ## Summary 256 KiB가 넘는 기록 중 큰 기록 판정이 도구 기록으로 확인하지 못한 것은 세션 읽기를 실패시켰고, 커서가 그 자리에 영구히 멈췄습니다. 그러면 그 세션의 라벨이 굳고, 그 패널로 가는 벨이 모두 `session_unread`로 보류되다 편지가 undelivered가 됩니다. #860 이후 남은 경우는 스크린샷을 붙인 사람 메시지입니다(wCQ:p1이 2026-10-01 389 KB 메시지에서 멈춰 있음). 이제 그런 기록은 본문을 잃고 읽기는 계속됩니다. - 대화 기록: 구조로 확인한 도구 turn 기록(질문, 답)은 그대로 접고, 본문은 버리고 `conversation_capacity`로 셉니다. 본문만 줄 수 있는 turn 기록(사람 메시지, 중단)은 대기를 지우거나 끝낼 뿐 만들지 않습니다. 그래서 잃어도 벨이 메뉴에 들어가지 않고, 보류될 수만 있습니다. - 구조를 읽을 수 없는 기록(모르는 봉투, escape된 판별자, 64단계 넘는 중첩)은 `unreadable` 표시를 접습니다. 다음 turn이 시작되거나 사람이 쓸 때까지 대기는 "모름"이고 벨은 보류됩니다. - 검색도 이 기록을 건너뛰고 뒤를 계속 읽습니다. 전에는 읽기 거부로 그 파일의 검색 행이 빠졌습니다. - main에 들어온 Grok 읽기(#868)도 따라갈 수 없는 큰 기록(64단계 넘는 중첩, 깨진 줄)에서 읽기를 멈췄습니다. 같은 방식으로 건너뛰게 했습니다. ## Review - **판단해 주세요**: 사람 메시지 하나의 본문이 라벨과 검색에서 사라집니다. 대신 세션 전체가 멈추지 않습니다. 잃은 개수는 `read.lines_skipped` 진단에 `conversation_capacity`로 남습니다. - **판단해 주세요**: 질문이 대기 중일 때 이미지를 붙여 답하면, 그 메시지가 지웠을 대기가 남아 다음 답·turn까지 `awaiting_operator`로 보류됩니다. 반대 방향(대기를 놓쳐 메뉴에 벨)은 생기지 않습니다. - **조심해서 볼 파일**: `hide-session/src/conversation_cursor.rs` - failure path. 실패하던 자리가 skip으로 바뀌었고, 체크포인트에 직렬화되는 분류기에 `overflow` 필드가 생겼습니다(옛 체크포인트는 기본값 0으로 읽힘). - **조심해서 볼 파일**: `hide-session/src/turns.rs` - 기기 helper와 오가는 tracker에 `unreadable` 필드가 생겼습니다. 옛 core는 이 필드를 무시합니다(`question_capacity` 때와 같은 방식). ## Evidence - **확인한 것**: 바뀐 테스트 6개가 모두 수정 전 커서에서 실패하고 수정 후 통과합니다. main 병합 후 `hide-session` 165개 통과(Grok 중첩 기록 경우 추가). - **확인한 것**: 새 user-turn 테스트가 `Claude Code`·`Codex CLI` 각각 확인합니다. 스크린샷 메시지 뒤 대기는 "없음"으로 읽히고, 모르는 봉투 뒤에는 "모름"이며, 사람 메시지가 오면 풀립니다. - **확인한 것**: 운영 중 멈춘 wCQ:p1의 실제 체크포인트(`labels.json` 복사)로 실제 12 MB 세션을 읽었습니다. 10번에 파일 끝까지 0.16초 걸렸고, 대화 기록 1개와 도구 기록 5개를 건너뛰었으며, 대기는 "없음"입니다. - **확인한 것**: `herdr-core`·`hide-host`·`hide-node-link`의 label/turn/question/session/doorbell/waiting 테스트 455개 통과(main 병합 후, grok 포함). `hide-session` clippy(`-D warnings`)와 fmt 통과. - **확인하지 못한 것**: 이 빌드를 설치한 앱에서 wCQ:p1 라벨이 다시 움직이는 것. 운영자 앱 교체가 필요해 하지 않았습니다. - **확인하지 못한 것**: `OpenCode`·`Pi`·`omp`의 큰 도구 기록 판정은 범위 밖입니다. 이들의 큰 기록은 모두 `unreadable`이 됩니다(전에는 읽기가 멈춤).
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.
Summary
Claude Code는 스크린샷 같은 도구 결과를 base64로 세션 기록 한 줄에 그대로 씁니다.256 KiB가 넘는 이런 줄에서 세션 읽기가 거부되고 그 자리에 영구히 멈췄습니다.
그 세션의 라벨이 굳고, 턴 상태가 확정되지 않아 그 에이전트에게 가는 편지가 모두
session_unread로 보류되다 undelivered가 됐습니다.#786의 큰 기록 판정이
tool_use_id가 달린 도구 결과를 모두 "질문의 답일 수 있음"으로 보고 거부한 것이 원인입니다.Claude Code의 도구 결과에는 전부 이 id가 붙습니다.이제 큰 기록을 훑을 때 turn 기록에 필요한 짧은 id만 기억하고, 본문은 버린 채 그 turn 기록을 넘깁니다.
AskUserQuestion·request_user_input은 내용 없이 "질문 대기"가 됩니다.Codex CLI의 계획·시작·완료·중단 기록은 turn id와 mode를 유지합니다.대화 본문과 분류할 수 없는 줄은 지금처럼 실패합니다.
이전 빌드가 이런 줄 한가운데에서 남긴 체크포인트는 그 줄의 처음부터 다시 읽습니다. 그래서 이미 멈춘 세션도 업데이트 후 풀립니다.
Review
hide-session/src/conversation_cursor.rs- failure path. 체크포인트에 직렬화되는 분류기 모양이 바뀌었고, 복원할 때 옛 모양이면 되감기를 합니다.Evidence
hide-session139개 테스트 통과. 바뀐 테스트 4개는 수정 전 코드에서 실패합니다(실제 모양인tool_use_id가 달린 결과, 분할 복원, 기록 종류별 turn 기록).labels.json에서 복사)를 복원해 실제 세션 파일을 읽었습니다. 36 MB 세션은 21번 만에 파일 끝(0.39초)까지, 다른 세션은 33번 만에 끝(0.67초)까지 읽었고, 큰 도구 결과 3개와 7개를 건너뛰었습니다.Claude Code세션 69개 중 22개에 이런 줄이 있었고, 큰 줄 701개 중 694개가 도구 결과였습니다.herdr-core·hide-host의 label/turn/question/session 테스트 407개 통과, fmt와 clippy(hide-session) 통과.