fix(wiki): P86 — ollama/lmstudio 백엔드 + wiki update fail-fast (#88)#89
Merged
Conversation
Issue #88 (cakel): ollama (gemma4:26b) 로 wiki update 시 모델이 "임무 이해, 시작 준비됨" 답변만 출력하고 종료. 실제 wiki 생성 안 됨. 원인: `docs/prompts/wiki-update.md` + `wiki-incremental.md` 둘 다 MCP 도구 호출 (`secall recall`/`get`/`status` + `wiki/` 파일 쓰기) 을 가정. claude/codex CLI 는 도구 호출 가능, haiku 는 세션 데이터를 prompt 에 inline 하므로 도구 불필요. 하지만 ollama/lmstudio 는 HTTP API 단순 text generation 으로 도구 호출 능력 없음 — 모든 모드 (batch / incremental / --since) 에서 실패. Fix: - `commands/wiki.rs` 의 backend 선택 직후 ollama/lmstudio 차단. - 명시적 에러 + 사용 가능한 백엔드 가이드 (claude / codex / haiku) 출력. - 사용자가 silent 30분 wait 후 빈손으로 깨닫는 사고 차단. 비목표: ollama 의 wiki update 지원 자체 추가는 별도 PR (향후 haiku 같은 데이터-inline batch 방식 검토). 검증: - cargo fmt --check: clean - cargo clippy --workspace --all-targets -D warnings: clean - cargo test --workspace --no-fail-fast: all green Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request introduces a fail-fast mechanism for the wiki update command to prevent silent failures when using backends that lack tool-calling capabilities, specifically ollama and lmstudio. The changes include a guard in the command logic and a new plan document. Review feedback correctly identifies that the ollama_cloud backend should also be included in this check and the documentation updated accordingly to ensure consistency.
Comment on lines
+193
to
+198
| // P86 (issue #88): ollama / lmstudio 백엔드는 wiki update 의 prompt 가 | ||
| // 가정하는 MCP 도구 호출 (`secall recall/get/status` + `wiki/` 파일 쓰기) 을 | ||
| // 수행할 능력이 없다. batch / incremental / --since 모든 모드에서 모델이 | ||
| // "임무 이해" 응답만 출력하고 종료 → 사용자가 silent wait (timeout 까지) | ||
| // 후 빈손으로 깨닫는 사고. 명시적 fail-fast + 가이드. | ||
| if matches!(backend_name.as_str(), "ollama" | "lmstudio") { |
There was a problem hiding this comment.
ollama_cloud 백엔드도 ollama와 동일하게 도구 호출 능력이 없는 단순 텍스트 생성 방식이므로, fail-fast 체크 대상에 포함하는 것이 좋습니다. 현재 구현으로는 ollama_cloud를 사용할 경우 여전히 silent failure가 발생할 수 있습니다.
Suggested change
| // P86 (issue #88): ollama / lmstudio 백엔드는 wiki update 의 prompt 가 | |
| // 가정하는 MCP 도구 호출 (`secall recall/get/status` + `wiki/` 파일 쓰기) 을 | |
| // 수행할 능력이 없다. batch / incremental / --since 모든 모드에서 모델이 | |
| // "임무 이해" 응답만 출력하고 종료 → 사용자가 silent wait (timeout 까지) | |
| // 후 빈손으로 깨닫는 사고. 명시적 fail-fast + 가이드. | |
| if matches!(backend_name.as_str(), "ollama" | "lmstudio") { | |
| // P86 (issue #88): ollama / ollama_cloud / lmstudio 백엔드는 wiki update 의 prompt 가 | |
| // 가정하는 MCP 도구 호출 (`secall recall/get/status` + `wiki/` 파일 쓰기) 을 | |
| // 수행할 능력이 없다. batch / incremental / --since 모든 모드에서 모델이 | |
| // "임무 이해" 응답만 출력하고 종료 → 사용자가 silent wait (timeout 까지) | |
| // 후 빈손으로 깨닫는 사고. 명시적 fail-fast + 가이드. | |
| if matches!(backend_name.as_str(), "ollama" | "ollama_cloud" | "lmstudio") { |
| 진단 결과: | ||
| - `docs/prompts/wiki-update.md` (batch) + `wiki-incremental.md` (incremental) 둘 다 **MCP 도구 호출** (`secall recall`, `secall get`, `secall status`) + **`wiki/` 디렉토리 파일 쓰기** 를 가정. | ||
| - Claude Code CLI = MCP 통합 / Codex CLI = 도구 호출 가능 / Haiku = 세션 데이터를 prompt 에 직접 inline (도구 불필요) | ||
| - **ollama / lmstudio = HTTP API 단순 text generation, 도구 호출 능력 없음** |
| backend selection (line 188~191) 다음, prompt build 직전에 가드: | ||
|
|
||
| ```rust | ||
| if matches!(backend_name.as_str(), "ollama" | "lmstudio") { |
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
Issue #88 (cakel): ollama 백엔드로 wiki update 실행 시 모델이 "임무 이해, 시작 준비됨" 응답만 출력하고 종료. 실제 wiki 생성 안 됨.
원인:
docs/prompts/wiki-update.md+wiki-incremental.md둘 다 MCP 도구 호출 (secall recall/get/status+wiki/파일 쓰기) 을 가정. ollama/lmstudio 는 HTTP API 단순 text generation 으로 도구 호출 능력 없음 — 모든 모드 (batch / incremental / --since) 에서 실패.Fix:
commands/wiki.rs의 backend 선택 직후 ollama/lmstudio 차단 + 명시적 에러 + 사용 가능한 백엔드 가이드.백엔드 호환성 매트릭스
Error message
Test plan
cargo fmt --all -- --checkcleancargo clippy --workspace --all-targets -- -D warningscleancargo test --workspace --no-fail-fastall greensecall wiki update --backend ollama→ 즉시 명시적 에러 출력 (다음 release 빌드 후 확인)Out of scope
ollama/lmstudio 의 wiki update 지원 자체 추가는 별도 PR. 향후 haiku 같은 데이터-inline batch 방식으로 확장 가능 (큰 작업).
Closes #88
🤖 Generated with Claude Code