Skip to content

feat(wiki,config): P85 — [wiki].generation_timeout_secs config option (#87)#90

Merged
hang-in merged 2 commits into
mainfrom
fix/p85-wiki-timeout-config
May 19, 2026
Merged

feat(wiki,config): P85 — [wiki].generation_timeout_secs config option (#87)#90
hang-in merged 2 commits into
mainfrom
fix/p85-wiki-timeout-config

Conversation

@hang-in
Copy link
Copy Markdown
Owner

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

Summary

Issue #87 (cakel): wiki update 시 claude/codex/ollama/lmstudio 백엔드의 timeout 값을 사용자가 직접 조정할 수 있는 config 옵션 추가.

배경:

  • P59 (feat(wiki): P59 — wiki backend timeout 300s → 1800s + docs sync #69) 머지로 hardcoded 5분 → 30분 (1800s) 상향됨.
  • cakel 보고의 300s 에러는 P59 이전 버전 사용 의심 — release (v0.6.0) 진행으로 fix.
  • 단 1800s 도 부족한 케이스 (수만 세션 vault 또는 느린 모델) 가 있어 사용자 override 옵션은 정당한 기능.

변경

  • vault/config.rs: WikiConfig.generation_timeout_secs: u64 (default 1800).
  • wiki/{claude,codex,ollama,lmstudio}.rs: 각 Backend struct 에 timeout_secs 필드. generate()from_secs(self.timeout_secs).
  • commands/wiki.rs::build_wiki_backend: 5개 instantiation 모두 timeout_secs: config.wiki.generation_timeout_secs 전달.
  • commands/log.rs: log command 의 backend 5 instantiation 도 동일 (log 가 wiki backend struct 를 reuse).
  • tests/sync_termination.rs + wiki/{ollama,lmstudio} unit test literal 갱신.

사용 예시

```toml

config.toml

[wiki]
generation_timeout_secs = 3600 # 30분 → 1시간
```

Out of scope

  • haiku (Anthropic API HTTP 120s) + reviewers (60~120s) timeout 은 별도.
  • log 가 별도 timeout 필요해지면 future 에 [log] 섹션에 추가 가능 (현재는 wiki 와 unify).

Test plan

  • `cargo fmt --all -- --check` clean
  • `cargo clippy --workspace --all-targets -- -D warnings` clean
  • `cargo test --workspace --no-fail-fast` all green (lib 426 + integration)

Closes #87

🤖 Generated with Claude Code

…on (#87)

Issue #87 (cakel): wiki update 시 claude/codex/ollama/lmstudio 백엔드의 timeout
값 (1800s) 을 사용자가 직접 조정할 수 있는 config 옵션 추가.

배경: P59 (#69) 머지로 hardcoded 5분 → 30분 (1800s) 상향됐지만, 수만 세션 vault
또는 느린 모델 사용 시 1800s 도 부족할 수 있음. cakel 보고의 300s 에러는 P59
이전 버전 사용 의심이지만 (release 진행으로 별도 해소), 사용자 override 옵션은
정당한 기능 요청.

변경:
- `vault/config.rs`: WikiConfig 에 `generation_timeout_secs: u64` 필드 (default 1800).
- `wiki/{claude,codex,ollama,lmstudio}.rs`: 각 Backend struct 에 `timeout_secs` 필드.
  generate() 가 hardcoded `from_secs(1800)` → `from_secs(self.timeout_secs)`.
- `commands/wiki.rs::build_wiki_backend`: 5개 instantiation 모두에
  `timeout_secs: config.wiki.generation_timeout_secs` 전달.
- `commands/log.rs`: log command 의 backend 5 instantiation 도 동일 (log 가
  wiki backend struct 를 reuse 하므로 동일 timeout 적용).
- `tests/sync_termination.rs` + wiki/{ollama,lmstudio} unit test 의 backend
  literal 갱신 (test 는 짧은 timeout 사용).

사용:
```toml
[wiki]
generation_timeout_secs = 3600  # 30분 → 1시간
```

비목표: haiku (Anthropic API HTTP 120s) + reviewers (60~120s) timeout 은 별도.
log 가 별도 timeout 필요해지면 future 에 `[log]` 섹션에 추가 가능.

검증:
- cargo fmt --check: clean
- cargo clippy --workspace --all-targets -D warnings: clean
- cargo test --workspace --no-fail-fast: all green (lib 426 + integration)

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 configurable timeout for wiki generation backends, addressing issue #87. The previously hardcoded 1800-second timeout is replaced with a generation_timeout_secs field in the WikiConfig, which is then propagated to the Claude, Codex, Ollama, and LM Studio backends. The changes include updates to configuration structures, backend logic, command-line tool instantiation, tests, and documentation. Review feedback recommends defining the default timeout value as a constant to enhance code maintainability and clarity.

Comment on lines +168 to +170
fn default_wiki_generation_timeout_secs() -> u64 {
1800
}
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

기본 타임아웃 값 1800을 상수로 정의하여 코드의 명확성과 유지보수성을 높이는 것을 제안합니다. serdedefault 속성을 위해 함수는 유지하되, Default 구현에서는 상수를 직접 사용하는 것이 Rust 관례에 더 부합합니다.

const DEFAULT_WIKI_GENERATION_TIMEOUT_SECS: u64 = 1800;

fn default_wiki_generation_timeout_secs() -> u64 {
    DEFAULT_WIKI_GENERATION_TIMEOUT_SECS
}

Comment thread crates/secall-core/src/vault/config.rs Outdated
backends: std::collections::HashMap::new(),
review_backend: None,
review_model: None,
generation_timeout_secs: default_wiki_generation_timeout_secs(),
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

앞서 제안한 DEFAULT_WIKI_GENERATION_TIMEOUT_SECS 상수를 여기서 직접 사용하면, Default 구현이 컴파일 타임 상수에 의존하게 되어 코드가 더 명확해집니다.

Suggested change
generation_timeout_secs: default_wiki_generation_timeout_secs(),
generation_timeout_secs: DEFAULT_WIKI_GENERATION_TIMEOUT_SECS,

Gemini PR #90 리뷰 (2건 medium):
- `DEFAULT_WIKI_GENERATION_TIMEOUT_SECS: u64 = 1800` const 정의
- `Default` impl 에서 함수 호출 대신 const 직접 사용
- serde default 속성용 함수도 같은 const 반환 (단일 source of truth)

검증:
- cargo fmt --check: clean
- cargo clippy --workspace --all-targets -D warnings: clean
- cargo test -p secall-core --lib vault::config: 17 passed

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@hang-in
Copy link
Copy Markdown
Owner Author

hang-in commented May 19, 2026

Gemini 리뷰 2건 모두 반영 (commit d5c9e4c). DEFAULT_WIKI_GENERATION_TIMEOUT_SECS const 정의 + Default impl 에서 const 직접 사용. cargo fmt + clippy -D warnings + test 모두 통과.

@hang-in hang-in merged commit d107a15 into main May 19, 2026
3 checks passed
@hang-in hang-in deleted the fix/p85-wiki-timeout-config branch May 19, 2026 06:40
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.

claude 를 통한 wiki update 시 지정되는 time out 값(300s) 변경가능 문의

1 participant