Skip to content

feat(wiki): P88 — claude+haiku wiki generation 경고 (#93)#98

Merged
hang-in merged 2 commits into
mainfrom
fix/p88-haiku-wiki-warn
May 28, 2026
Merged

feat(wiki): P88 — claude+haiku wiki generation 경고 (#93)#98
hang-in merged 2 commits into
mainfrom
fix/p88-haiku-wiki-warn

Conversation

@hang-in
Copy link
Copy Markdown
Owner

@hang-in hang-in commented May 28, 2026

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 조합 감지 시 경고 출력:

  • sonnet/opus 권장
  • haiku 는 review backend 용도로 안내
  • silent 빈 결과로 끝나는 혼란 제거 (차단 아님)

generation 경로에만 위치 → review backend (별도 build_reviewer) 영향 없음.

Test plan

  • cargo fmt --all -- --check clean
  • cargo clippy --workspace --all-targets -- -D warnings clean
  • 수동: [wiki.backends.claude] model="haiku"secall wiki update → 경고 출력 확인 (다음 release 빌드 후)

Closes #93

🤖 Generated with Claude Code

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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".

Comment thread crates/secall/src/commands/wiki.rs Outdated
// 되묻는 경우가 잦다 (sonnet/opus 는 정상). 차단하진 않되 (haiku 도 도구
// 호출 자체는 가능하고 review backend 로는 적합) 빈 결과로 끝나는 혼란을
// 줄이기 위해 경고한다.
if backend_name == "claude" && resolved_model.trim().eq_ignore_ascii_case("haiku") {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

현재 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"로 엄격하게 비교하는 것이 안전합니다.

Suggested change
if backend_name == "claude" && resolved_model.trim().eq_ignore_ascii_case("haiku") {
if backend_name == "claude" && resolved_model == "haiku" {

@hang-in
Copy link
Copy Markdown
Owner Author

hang-in commented May 28, 2026

Gemini 리뷰 반영 (commit f1e3cdb). 경고 조건을 resolved_model == "haiku" 로 엄격화 — claude.rs 의 model_id 매칭 (정확히 "haiku" 만 haiku, "Haiku"/"haiku " 는 sonnet) 과 일치시켜 sonnet 실행 시 haiku 경고 뜨는 불일치 제거. fmt + clippy clean.

hang-in pushed a commit that referenced this pull request May 28, 2026
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>
d9ng and others added 2 commits May 29, 2026 07:56
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>
@hang-in hang-in force-pushed the fix/p88-haiku-wiki-warn branch from f1e3cdb to 1c5d15c Compare May 28, 2026 22:57
@hang-in hang-in merged commit e96e19b into main May 28, 2026
3 checks passed
@hang-in hang-in deleted the fix/p88-haiku-wiki-warn branch May 28, 2026 23:10
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.

backend 가 haiku 인 경우, wiki update 가 진행되지 않음

1 participant