feat: skip or slim down the owner finalize turn

(a) When the reviewer approves the owner's first TASK_DONE answer on the
first review (one review round, outputs are exactly owner -> reviewer, no
revision or arbiter turns) and the owner workspace still matches the
approved tree with a clean working tree, no owner run happens: the task is
completed as done and the reviewed answer (status line stripped) is posted
as the final message. If the review was requested with a bare "검토해줘"
after a review-skipped answer, a one-line confirmation is posted instead of
repeating the answer.

(b) Every other finalize turn runs in a fresh, non-persisted session (no
resume of the task's long working session, no room memory briefing) with a
self-contained prompt: this task's user messages, the latest six turn
outputs and the finalize instructions/format. All three finalize entry
points (pending turn, inline bot-only follow-up, queued turn) use it.

The owner prompt now states that the first TASK_DONE answer must already
follow the final-message format because it may be posted as the final
message unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Codex
2026-10-01 20:42:12 +09:00
parent 7f54c47e64
commit 0283abbb56
14 changed files with 604 additions and 39 deletions

View File

@@ -11,6 +11,7 @@
### Changed
- 마무리(finalize) 턴 비용 절감. (가) 리뷰어가 owner의 첫 TASK_DONE 답변을 첫 리뷰에서 바로 승인했고(리뷰 1회, owner 수정·중재 턴 없음) 승인 이후 작업 폴더가 그대로면 owner를 다시 실행하지 않고 그 답변(상태 줄 제외)을 최종 메시지로 올리고 task를 완료함. 검토 생략 답변에 "검토해줘"로 받은 리뷰가 바로 승인되면 답변을 반복하지 않고 `-# 검토 완료: …` 한 줄만 올림. (나) 그 밖의 마무리 턴은 task의 긴 작업 세션을 resume하지 않는 새 세션에서, 이번 task의 사용자 요청과 최근 turn 출력(최대 6개)과 마무리 형식 안내만 담은 프롬프트로 실행하고 세션을 저장하지 않음(방 메모리 브리핑도 생략). owner 규칙에 첫 TASK_DONE 답변도 최종 답변 형식을 따라야 한다고 명시
- paired 방의 owner·리뷰어 세션을 paired task 단위로 새로 시작. 같은 task 안의 후속 턴(리뷰 반영, 같은 task에 들어온 사용자 후속 메시지)은 그 세션을 이어 쓰고, 새 task의 첫 턴은 이전 세션을 resume하지 않음. 세션이 어느 task 것인지는 `router_state`의 `paired_session_task:<세션 폴더>`에 기록. 이전 task의 마지막 최종 답변은 새 task의 turn 0(carry-forward)으로 계속 전달되며, 이를 위해 `PAIRED_CARRY_FORWARD_LATEST_OWNER_FINAL` 기본값을 `true`로 변경. single 방은 그대로
- Claude가 사용 한도에 도달하면 Codex로 넘기는 대신 방에 "Claude 사용 한도에 도달했습니다. 21:40에 재개할 수 있습니다."처럼 재개 시각(KST)을 바로 알리고, 열린 paired task를 `claude_usage_limit`으로 닫음. 재개 시각은 오류 문구(`resets 9:40pm (Asia/Seoul)` 등)에서 읽고, 없으면 사용량 API 캐시에서, 그것도 없으면 "잠시 후 다시 시도해 주세요"로 안내. 조용한 자동 재시도는 하지 않음
- 기본 Claude 모델을 Claude Opus 5.5(`claude-opus-5-5`)로 상향. Opus 5.5는 Claude Code CLI 2.1.280 이상이 필요해 `@anthropic-ai/claude-agent-sdk`를 0.3.153 → 0.3.286(번들 CLI 2.1.286)으로 올림 (8b68885)