Skip to content

fix(engine): post-delta 전송 오류를 안전하게 재시도한다 - #2

Open
rainstorm0907 wants to merge 1 commit into
rubato/basefrom
fix/post-delta-websocket-retry
Open

rainstorm0907 wants to merge 1 commit into
rubato/basefrom
fix/post-delta-websocket-retry

Conversation

@rainstorm0907

Copy link
Copy Markdown
Collaborator

왜 바꿨나

모델이 글을 조금 내보낸 뒤 WebSocket이 끊기면 Rubato가 모든 post-delta 오류에 senpi:no-turn-retry:를 붙였어. 그 결과 글만 쓰던 턴이나 아직 실행되지 않은 일반 toolCall도 재시도하지 못하고, 해당 세션을 기다리던 다른 세션까지 그대로 멈췄어.

원래 막으려던 건 텍스트 중복이 아니라 provider가 stream 안에서 이미 실행한 도구의 중복 실행이야. 재시도 경계를 delta 유무가 아니라 실제 provider 실행 여부로 좁혔어.

어떻게 바꿨나

  • text·thinking·일반 toolCall 뒤 전송 오류는 Senpi의 횟수 제한 재시도로 넘겨.
  • Cursor exec-channel의 kCursorExecResolved가 보이면 call state에 latch하고 기존 senpi:no-turn-retry:를 유지해.
  • terminal message가 다른 객체로 바뀌어도 실행 표식을 잃고 fail-open하지 않게 했어.
  • 실패한 toolCall을 성공한 toolUse로 바꾸는 기존 방어는 그대로 유지해.
  • 실제 AgentSession._isRetryableError 판정까지 회귀 테스트에 넣었어.

검증

  • node --test harness/rubato-pi/test/unit/rubato-stream.test.mjs — 34/34 통과
  • 일반 Rubato Opus 독립 검토 — P0~P2 없음, P3 세 건 반영
  • npm --prefix harness/rubato-pi test — exit 1
  • npm --prefix harness/rubato-pi run test:integration — exit 1
  • bun run typecheck — exit 1

마지막 세 검사는 변경분을 전부 stash한 최신 rubato/base 원본에서도 각각 같은 자리에서 exit 1이었어. 이번 수정이 만든 회귀는 아니야. 자세한 실패와 판단 근거는 cycles/2026-09/wk1/09-01/1917-post-delta-websocket-retry-wrap.md에 남겼어.

남은 위험

실제 네트워크를 강제로 끊는 live fault injection은 하지 않았어. 테스트는 설치된 Senpi의 실제 retry 판정과 pi-ai의 실제 module-local Symbol을 사용해.

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