Skip to content

fix(wiki): P86 — ollama/lmstudio 백엔드 + wiki update fail-fast (#88)#89

Merged
hang-in merged 1 commit into
mainfrom
fix/p86-ollama-batch-fail-fast
May 19, 2026
Merged

fix(wiki): P86 — ollama/lmstudio 백엔드 + wiki update fail-fast (#88)#89
hang-in merged 1 commit into
mainfrom
fix/p86-ollama-batch-fail-fast

Conversation

@hang-in
Copy link
Copy Markdown
Owner

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

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 차단 + 명시적 에러 + 사용 가능한 백엔드 가이드.

백엔드 호환성 매트릭스

Backend 도구 호출 능력 wiki update 동작
claude (CLI) ✅ MCP 통합
codex (CLI) ✅ 도구
haiku (API) — (세션 데이터를 prompt 에 inline)
ollama ❌ 단순 text generation ❌ (silent fail)
lmstudio ❌ 동일 ❌ (silent fail)

Error message

wiki backend `ollama` 는 wiki update 와 호환되지 않습니다.
도구 호출 (`secall recall`/`get`/`status` + `wiki/` 파일 쓰기) 능력이 없어
prompt 가 가정하는 작업을 수행할 수 없습니다.

해결책 (편한 것 사용):
  • `--backend claude`  (Claude Code CLI + MCP 통합)
  • `--backend codex`   (Codex CLI)
  • `--backend haiku`   (Anthropic API, 세션 데이터를 prompt 에 inline,
                         `ANTHROPIC_API_KEY` 필요)

참고: issue #88, docs/plans/p86-ollama-batch-fail-fast.md

Test plan

  • cargo fmt --all -- --check clean
  • cargo clippy --workspace --all-targets -- -D warnings clean
  • cargo test --workspace --no-fail-fast all green
  • Manual smoke: secall wiki update --backend ollama → 즉시 명시적 에러 출력 (다음 release 빌드 후 확인)

Out of scope

ollama/lmstudio 의 wiki update 지원 자체 추가는 별도 PR. 향후 haiku 같은 데이터-inline batch 방식으로 확장 가능 (큰 작업).

Closes #88

🤖 Generated with Claude Code

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>
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 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") {
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

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, 도구 호출 능력 없음**
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

코드 수정 사항에 맞춰 ollama_cloud를 설명에 추가하는 것이 좋습니다.

Suggested change
- **ollama / lmstudio = HTTP API 단순 text generation, 도구 호출 능력 없음**
- **ollama / ollama_cloud / lmstudio = HTTP API 단순 text generation, 도구 호출 능력 없음**

backend selection (line 188~191) 다음, prompt build 직전에 가드:

```rust
if matches!(backend_name.as_str(), "ollama" | "lmstudio") {
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

계획서 내의 예시 코드도 실제 구현과 일치하도록 ollama_cloud를 추가해야 합니다.

Suggested change
if matches!(backend_name.as_str(), "ollama" | "lmstudio") {
if matches!(backend_name.as_str(), "ollama" | "ollama_cloud" | "lmstudio") {

@hang-in hang-in merged commit b51f3cf into main May 19, 2026
3 checks passed
@hang-in hang-in deleted the fix/p86-ollama-batch-fail-fast branch May 19, 2026 06:12
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.

ollama (gemma4:26b)에서 wiki update 시, 준비만하고 실제 업데이트가 안됨

1 participant