Skip to content

feat(wiki): P59 — wiki backend timeout 300s → 1800s + docs sync#69

Merged
hang-in merged 1 commit into
mainfrom
feat/p59-docs-sync-timeout-1800
May 15, 2026
Merged

feat(wiki): P59 — wiki backend timeout 300s → 1800s + docs sync#69
hang-in merged 1 commit into
mainfrom
feat/p59-docs-sync-timeout-1800

Conversation

@hang-in
Copy link
Copy Markdown
Owner

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

Summary

  • wiki backend timeout 300s → 1800s (4 백엔드: claude/codex/ollama/lmstudio)
  • README.md(한국어) P40 항목 추가 (영문엔 이미 존재, 한국어만 누락)
  • untracked reference docs 커밋: handoff_2026-05-12.md, sync-monitor-2026-05-15.md

배경

P52 에서 wiki backend 4 종에 300s timeout 을 추가했으나, sync-monitor 2026-05-15 검증에서 정상 wiki 생성 케이스도 5분 넘는 사례 관측됐다. 대형 vault (1000+ 세션) 의 wiki update 는 LLM 이 vault 전체 분석 후 합성하는 작업이라 10~20분 걸리는 게 정상 — 300s 한도가 정상 케이스도 SIGKILL 시키는 회귀를 유발했다.

P59 는 한도를 30분 (1800s) 으로 상향. kill_on_drop + tokio timeout 구조는 그대로 유지 — 실제 hang 케이스는 여전히 차단된다.

Changes

파일 변경
crates/secall-core/src/wiki/claude.rs Duration::from_secs(300)1800 + 주석
crates/secall-core/src/wiki/codex.rs 동일
crates/secall-core/src/wiki/ollama.rs reqwest .timeout(300)1800
crates/secall-core/src/wiki/lmstudio.rs 동일
README.md 한국어 history table 에 P40 (Wiki 검색 hybrid mode) 항목 추가
docs/reference/handoff_2026-05-12.md tunaFlow → 터미널 에이전트 이관 핸드오프
docs/reference/sync-monitor-2026-05-15.md P49~P52 머지 후 실 환경 검증 보고

Notes

CHANGELOG v0.3.x~v0.4.x backfill 은 의도적으로 skip — CHANGELOG.md 머리말에 "v0.2.x 시점에서 README 의 버전 히스토리 표로 SSOT 이전됨" 명시. P57 의 git tag SSOT 정책과 일치.

ollama/lmstudio HTTP 응답 streaming (P58 패턴의 다른 백엔드 확장) 은 SSE/chunked 응답으로의 큰 전환이라 별도 plan 으로 분리 — 본 PR 에는 포함되지 않음.

Test plan

  • cargo check --workspace 통과
  • cargo test --lib -p secall-core wiki 통과 (46 tests)
  • CI ubuntu/windows/web 통과 확인
  • (수동) wiki backend 1800s timeout 정상 동작 — 다음 wiki update 실행 시 자연스레 검증됨

🤖 Generated with Claude Code

## wiki backend timeout 상향 (300s → 1800s)

P52 의 300s 한도는 정상 wiki 생성 케이스에서도 SIGKILL 당하는 회귀를
유발 (sync-monitor 2026-05-15 에서 sonnet 가 5분 넘는 분석을 정상적으로
수행 중인 케이스 관측). 대형 vault (1000+ 세션) 의 wiki update 는
10~20분 걸리는 게 정상 — 30분 한도로 상향한다.

- `wiki/claude.rs`: `Duration::from_secs(300)` → `1800`
- `wiki/codex.rs`: 동일
- `wiki/ollama.rs`: reqwest `.timeout(300)` → `1800`
- `wiki/lmstudio.rs`: 동일

## docs sync

- `README.md` 한국어 history table 에 P40 항목 추가 (영문은 이미 존재,
  한국어만 누락이었음)
- `docs/reference/handoff_2026-05-12.md` 추가 (tunaFlow → 터미널 에이전트
  환경 이관 핸드오프)
- `docs/reference/sync-monitor-2026-05-15.md` 추가 (P49~P52 머지 후 실
  환경 검증 보고 — 1240 세션 cloud graph rebuild + wiki claude 5분
  hang fix 검증)

NOTE: CHANGELOG v0.3.x~v0.4.x backfill 은 의도적으로 skip — CHANGELOG.md
머리말에 "v0.2.x 시점에서 README 의 버전 히스토리 표로 SSOT 이전됨"
명시. P57 의 git tag SSOT 정책과 일치.

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 increases the wiki generation timeout from 300 to 1800 seconds across the Claude, Codex, LM Studio, and Ollama backends to support long-running analysis. It also introduces a session handoff document, a sync monitoring report, and updates the README with a new milestone entry. Feedback from the review suggests centralizing the duplicated timeout constant for better maintainability and improving the consistency of error messages across backends. Additionally, a discrepancy in task numbering (P-numbers) within the documentation was identified for correction.

Comment on lines +92 to +94
tokio::time::timeout(std::time::Duration::from_secs(1800), stream_and_wait)
.await
.map_err(|_| anyhow::anyhow!("claude wiki generation timed out after 300s"))??;
.map_err(|_| anyhow::anyhow!("claude wiki generation timed out after 1800s"))??;
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초가 여러 백엔드 파일(claude.rs, codex.rs, ollama.rs, lmstudio.rs)에 중복되어 하드코딩되어 있습니다. 이를 공통 상수로 분리하여 관리하면 유지보수가 용이해집니다. 또한, ollama.rslmstudio.rs에서는 에러 발생 시 타임아웃 정보가 에러 메시지에 포함되지 않아 다른 백엔드와 형식이 일관되지 않는 문제가 있습니다.


| 항목 | 값 |
|------|-----|
| 머지된 PR | #57 (P49 노이즈), #58 (P50-B LlmBackend), #59 (P50-C/D/E 분해), #60 (P51 cloud default), #61 (P52 timeout) |
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

PR 제목에서는 이번 변경사항을 P59로 명시하고 있으나, 본 문서의 15행에서는 P59를 "분해" 작업으로, 타임아웃 작업을 P61로 기재하고 있습니다. 프로젝트의 히스토리 추적 및 문서의 정확성을 위해 작업 번호(P-number)와 PR 번호의 정합성을 확인하고 수정이 필요해 보입니다.

@hang-in hang-in merged commit 62f95d6 into main May 15, 2026
3 checks passed
@hang-in hang-in deleted the feat/p59-docs-sync-timeout-1800 branch May 15, 2026 09:29
hang-in added a commit that referenced this pull request May 19, 2026
…on (#87) (#90)

* feat(wiki,config): P85 — `[wiki].generation_timeout_secs` config option (#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>

* fix(config): P85 follow-up — Gemini 리뷰 반영 (const 정의)

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>

---------

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