feat(wiki): P88 — claude+haiku wiki generation 경고 (#93)#98
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds a warning when using the Claude backend with the Haiku model for wiki generation, as Haiku's weak instruction-following can lead to incomplete tasks. It also adds corresponding planning documentation. The reviewer pointed out that the warning condition is too permissive compared to the actual backend model matching logic, which could lead to false-positive warnings (e.g., for "Haiku" or "haiku "), and suggested strictly checking for "haiku".
| // 되묻는 경우가 잦다 (sonnet/opus 는 정상). 차단하진 않되 (haiku 도 도구 | ||
| // 호출 자체는 가능하고 review backend 로는 적합) 빈 결과로 끝나는 혼란을 | ||
| // 줄이기 위해 경고한다. | ||
| if backend_name == "claude" && resolved_model.trim().eq_ignore_ascii_case("haiku") { |
There was a problem hiding this comment.
현재 crates/secall-core/src/wiki/claude.rs 파일의 ClaudeBackend::generate 메서드에서는 모델명을 다음과 같이 엄격하게 매칭하고 있습니다:\n\nrust\nlet model_id = match self.model.as_str() {\n "opus" => "claude-opus-4-6",\n "haiku" => "claude-haiku-4-5",\n _ => "claude-sonnet-4-6",\n};\n\n\n따라서 resolved_model이 "Haiku" 또는 "haiku "와 같이 대소문자가 다르거나 공백이 포함된 경우, claude.rs에서는 _ 패턴으로 넘어가 "claude-sonnet-4-6"(sonnet) 모델을 사용하게 됩니다.\n\n하지만 현재 조건문인 resolved_model.trim().eq_ignore_ascii_case("haiku")는 이러한 경우에도 true가 되어 경고를 출력하게 되므로, 실제로는 sonnet 모델이 실행됨에도 불구하고 haiku 경고가 표시되는 불일치가 발생합니다.\n\nclaude.rs의 매칭 방식과 일치하도록 resolved_model == "haiku"로 엄격하게 비교하는 것이 안전합니다.
| if backend_name == "claude" && resolved_model.trim().eq_ignore_ascii_case("haiku") { | |
| if backend_name == "claude" && resolved_model == "haiku" { |
|
Gemini 리뷰 반영 (commit f1e3cdb). 경고 조건을 |
PR #98 Gemini 리뷰 (medium): claude.rs 의 model_id 매칭이 정확히 "haiku" 일 때만 haiku 를 쓰고 "Haiku"/"haiku " 는 sonnet 으로 보낸다. 경고 조건도 `trim().eq_ignore_ascii_case("haiku")` (느슨) → `== "haiku"` (엄격) 로 일치 시켜, sonnet 실행인데 haiku 경고 뜨는 불일치 제거. 검증: cargo fmt --check + clippy -D warnings clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
PR #98 Gemini 리뷰 (medium): claude.rs 의 model_id 매칭이 정확히 "haiku" 일 때만 haiku 를 쓰고 "Haiku"/"haiku " 는 sonnet 으로 보낸다. 경고 조건도 `trim().eq_ignore_ascii_case("haiku")` (느슨) → `== "haiku"` (엄격) 로 일치 시켜, sonnet 실행인데 haiku 경고 뜨는 불일치 제거. 검증: cargo fmt --check + clippy -D warnings clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
f1e3cdb to
1c5d15c
Compare
Summary
Issue #93 (cakel):
[wiki.backends.claude] model = "haiku"설정 시secall wiki update가 작업을 안 하고 "뭘 원하나요?" 되묻고 빈 결과로 종료.model = "sonnet"은 정상.원인 (코드 버그 아님 — 모델 capability)
wiki batch/incremental prompt 는 MCP 도구 능동 호출 +
wiki/파일 생성을 요구하는 복잡한 instruction. claude CLI 는 haiku/sonnet 모두 도구 호출 가능하나, haiku 는 instruction-following 이 약해 작업을 시작하지 않고 되묻는 경우가 잦음. #88(ollama, 도구 호출 자체 불가)과 달리 haiku 는 가능은 하므로 완전 차단은 부적절 (review backend 로는 정상).Fix
commands/wiki.rs의 generation 경로 (run_update_with_sink, P86 fail-fast 다음) 에서 claude+haiku 조합 감지 시 경고 출력:generation 경로에만 위치 → review backend (별도
build_reviewer) 영향 없음.Test plan
cargo fmt --all -- --checkcleancargo clippy --workspace --all-targets -- -D warningsclean[wiki.backends.claude] model="haiku"로secall wiki update→ 경고 출력 확인 (다음 release 빌드 후)Closes #93
🤖 Generated with Claude Code