Skip to content

feat(wiki): P56 — WikiBackendConfig cloud_* 필드 + claude CLI haiku alias#66

Merged
hang-in merged 1 commit into
mainfrom
feat/p56-claude-alias-wiki-config
May 15, 2026
Merged

feat(wiki): P56 — WikiBackendConfig cloud_* 필드 + claude CLI haiku alias#66
hang-in merged 1 commit into
mainfrom
feat/p56-claude-alias-wiki-config

Conversation

@hang-in
Copy link
Copy Markdown
Owner

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

Summary

v0.5.0 release 후 follow-up. 두 fix 묶음.

1. WikiBackendConfig cloud_api_key / cloud_host 필드 (Gemini PR #64 MEDIUM)

P55 의 ollama_cloud backend 가 graph/log 의 cloud_* 만 봐서 wiki 전용 키/엔드포인트 지정 불가. 이제 wiki backend config 우선:

[wiki.backends.ollama_cloud]
cloud_api_key = "..."           # 우선
cloud_host = "https://ollama.com"  # 우선

Fallback: OLLAMA_CLOUD_API_KEY env → [graph].cloud_api_key[log].cloud_api_key.

2. claude CLI "haiku" alias

WIKI_REVIEW_DEFAULT = "haiku" (P51) 가 claude CLI 환경에서 fallback sonnet 으로 매핑되어 review default 효과 잃었음. "haiku"claude-haiku-4-5 alias 추가 → ANTHROPIC_API_KEY 없어도 claude CLI subscription 으로 haiku 활용 가능.

Test plan

  • cargo test 전체 0 failed
  • RUSTFLAGS=-Dwarnings cargo check 경고 0
  • cargo fmt --all -- --check OK

🤖 Generated with Claude Code

…lias

두 fix 묶음:

## 1. WikiBackendConfig 에 `cloud_api_key` / `cloud_host` 필드 추가

Gemini PR #64 MEDIUM 후속 반영. ollama_cloud backend (P55) 의 API 키/엔드포인트
lookup 이 graph/log 의 cloud_* 만 봤었음 → wiki 전용 키/엔드포인트 지정 불가.

이제 우선순위:
`[wiki.backends.ollama_cloud].cloud_api_key`
  → `OLLAMA_CLOUD_API_KEY` env
  → `[graph].cloud_api_key` / `[log].cloud_api_key`

`[wiki.backends.ollama_cloud].cloud_host` → `[graph].cloud_host` → `https://ollama.com`

build_wiki_backend / build_reviewer 의 ollama_cloud branch 양쪽 동일 로직.
에러 메시지도 갱신 — `[wiki.backends.ollama_cloud].cloud_api_key` 안내.

## 2. claude CLI 의 `"haiku"` model alias 추가

`WIKI_REVIEW_DEFAULT = "haiku"` (P51) 가 claude CLI 사용 시 의도대로 동작
안 함 — 이전엔 ClaudeBackend 의 model match 가 "haiku" → fallback sonnet
으로 매핑. review default 효과 잃음.

```rust
let model_id = match self.model.as_str() {
    "opus" => "claude-opus-4-6",
    "haiku" => "claude-haiku-4-5",  // ← P56 신규
    _ => "claude-sonnet-4-6",
};
```

이제 claude CLI 환경에서도 review default = haiku 가 의도대로 claude-haiku-4-5
사용. ANTHROPIC_API_KEY 없어도 claude CLI subscription 으로 haiku 활용.

회귀: cargo test 전체 0 failed, RUSTFLAGS=-Dwarnings cargo check 경고 0.

Co-Authored-By: Claude Opus 4.7 (1M context) <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 enhances the ollama_cloud backend configuration by allowing specific API keys and host URLs to be defined within the wiki backend settings, rather than relying solely on environment variables or global configurations. It also adds support for the 'haiku' model alias in the Claude backend. Feedback was provided to ensure consistency in how the API URL is resolved between the wiki backend and the reviewer, specifically by checking the explicit api_url configuration before falling back to cloud-specific host settings.

Comment on lines +1263 to 1266
let api_url = cfg
.cloud_host
.clone()
.or_else(|| config.graph.cloud_host.clone())
.unwrap_or_else(|| "https://ollama.com".to_string());
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 reviewer의 api_url 결정 로직이 build_wiki_backend와 일관되지 않습니다. cfg.cloud_hostconfig.graph.cloud_host로 폴백하기 전에 cfg.api_url을 먼저 확인하도록 수정하는 것이 좋습니다. 이를 통해 사용자가 wiki 백엔드 설정에서 api_url을 통해 명시적으로 커스텀 엔드포인트를 지정한 경우, 생성(generation)과 검수(review) 모두에서 일관되게 적용되도록 할 수 있습니다.

            let api_url = cfg
                .api_url
                .or(cfg.cloud_host)
                .or_else(|| config.graph.cloud_host.clone())
                .unwrap_or_else(|| "https://ollama.com".to_string());

@hang-in hang-in merged commit f3c5bb6 into main May 15, 2026
3 checks passed
@hang-in hang-in deleted the feat/p56-claude-alias-wiki-config branch May 15, 2026 07:42
@hang-in hang-in mentioned this pull request May 19, 2026
hang-in added a commit that referenced this pull request May 19, 2026
* chore: v0.6.0 release

P56 ~ P86 누적 18+ PR (#66~#90) — wiki self-ingest 루프 차단 (#82), wiki timeout
config (#87), ollama/lmstudio fail-fast (#88), web 디자인 / model discovery /
graph snapshot 개선, CI 시간 단축, 문서 룰 정리.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* chore: update Cargo.lock for v0.6.0

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* docs(changelog): v0.6.0 follow-up — Gemini 리뷰 반영 (P83/P86 중복 제거)

PR #91 Gemini 리뷰 (medium): Behavior changes + Fixes 양쪽에 중복 기재되던
P83 / P86 항목을 Behavior changes 로 통합 (Closes #82 / Closes #88 명시 포함)
+ Fixes 섹션에서 해당 라인 제거.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---------

Co-authored-by: d9ng <d9ng@outlook.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
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.

1 participant