fix(supervisor): multi-turn follow-up turn handoff + savefig nesting#14
Merged
Merged
Conversation
S-G 시나리오(같은 thread 2번째 메시지에서 동일 csv 재사용 차트 추가) 실패
원인 4건을 한 묶음으로 fix.
1) LLMRouter parse-failure 1회 retry + raw error JSON salvage (plan §4.0.5)
- decide_route가 첫 호출 ValueError 시 즉시 fallback FINISH로 종료하던
문제. 1회 재시도 + 그래도 실패 시 ValidationError 메시지에 박힌
RouterDecision JSON 추출하여 복원. test_llm_router.py +2 cases.
2) head supervisor _max_same_team_streak를 current-turn-only로 필터
- 멀티 turn에서 누적된 head→team 카운트로 인해 turn 2 첫 호출부터
redirect 5/2 safeguard 발동. route_history를 가장 최근 head
status="completed" 이후로 슬라이스.
3) team supervisor dispatch count도 current-turn 재계산
- shared_context의 _dispatch_count는 turn 누적 → follow-up turn에서
첫 worker 호출도 6/5 ceiling hit. route_history 슬라이스로 재계산.
4) team worker history note를 prev/current turn 분리 + finalizer
경유 head도 turn 종료로 status="completed" 마킹
- "이전 turn은 이미 완료" + "이번 turn은 아직 미시작" 컨텍스트를
team supervisor LLM에 명확히 전달. finalizer 경로도 route entry
status="completed"로 boundary 신호.
5) matplotlib savefig monkey-patch nesting 차단
- matplotlib.pyplot은 process-wide singleton이라 매 turn 새 wrapper가
이전 wrapper 위에 nesting되어 stale artifact_dir로 path rewriting.
_plt._orchagent_real_savefig에 진짜 savefig를 1회 보존하고 매 turn
그 reference로 fresh wrap.
E2E (dong, playwright) S-G:
- turn 1: region별_revenue_합계_막대차트.png ✅
- turn 2: product별_units_sold_합계_막대차트.png ✅ (같은 csv 재사용)
pytest 316 → 319 PASS (+3 retry/salvage tests), 회귀 0.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This was referenced May 22, 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.
Summary
S-G 시나리오(같은 thread 2번째 메시지 동일 csv 재사용 차트 추가) 실패의 4가지 원인을 일괄 fix.
Fixes
_max_same_team_streakcurrent-turn only 슬라이싱 — multi-turn redirect 5/2 false positive 차단status="completed"(finalizer 경로 포함) → boundary 신호 명확_plt._orchagent_real_savefig에 진짜 savefig 1회 보존, fresh wrapVerification
region별_revenue_합계_막대차트.png✅product별_units_sold_합계_막대차트.png✅🤖 Generated with Claude Code