Commit Graph
14 Commits
Author SHA1 Message Date
kimandClaude Sonnet 5.5 042768f067 세션 컨텍스트 창 추정: Anthropic은 200K로(8192 폴백으로 토큰 사용률이 100%를 넘게 뜨던 허수 수정)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-20 16:43:35 +09:00
kimandClaude Opus 5 68bfba1e4d fix: 해석 실패한 컨텍스트 창 추측값을 브라우저가 캐시해 세션창이 8K에 박히던 문제
사용자 제보: "지서버 모델 연결됐는데 컨텍스트가 세션창에서만 8킬로", 그리고
"웹을 리로드하면 256킬로가 된다".

서버 쪽 마지막 폴백(8192)은 이미 캐시하지 않게 돼 있어서 매번 다시 조회한다
(그 사고를 겪고 고친 주석이 남아 있다). 문제는 브라우저였다 — app.js가

  if (_appCtxMax > 0 && !force) return;   // 한 번 받으면 끝

로 한 번 받은 값을 페이지 수명 내내 들고 있어서, 지서버가 자고 있을 때 열면
8192가 그대로 박혔다. 리로드가 고친 게 아니라 리로드로 캐시가 비워진 것.

메인 채팅 게이지는 SSE usage로 라이브 값을 받아서 멀쩡했고 세션창만 틀렸던
이유가 이것 — 두 화면이 서로 다른 경로로 같은 숫자를 구하고 있었다.

어댑터 쪽(bfbf04e)과 같은 원칙으로 고친다: **추측을 측정처럼 다루지 않는다.**

- resolveNumCtxInfo()가 value와 known(진짜 해석 결과인지)을 함께 반환
- /api/model-context가 provisional 플래그를 실어 보낸다. /api/show 실패나
  마지막 폴백이면 true
- app.js: provisional이면 화면에는 보여주되 _appCtxMax에 저장하지 않아 다음
  호출에서 다시 묻는다
- code.js: provisional이면 모델별 1회 래치(_codeAiCtxMaxFetchedFor)를 풀어
  다시 조회하게 한다

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-12 10:28:10 +09:00
kimandClaude Opus 5 1146b59199 fix: 컨텍스트 윈도우가 이전 모델 값에 고정되던 문제
게이지가 8192로 표시됐으나 지서버 gemma4:26b의 실제 값은 262144, 32배 차이.
원인이 세 겹이었다.

1. resolveNumCtx()의 _cachedNumCtx가 아무 키 없이 프로세스 수명 내내 유지됐다.
   6곳에서 설정되는데 무효화하는 코드가 어디에도 없어, 모델/provider를 바꿔도
   이전 값을 계속 반환했다(클로서버로 바꿨는데 지서버의 262k가 계속 보이던 증상).
   → (provider, models.primary, provider별 model, llm.num_ctx) 키에 연동

2. 활성 provider가 아니라 localhost:11434를 하드코딩해 조회했다.
   provider가 ollama_local(지서버)일 때 클로서버 로컬 Ollama에 물어보니
   "model not found" → 최후 폴백 8192로 떨어졌다.
   → activeOllamaEndpoint() 추가, /api/model-context의 per-model 조회에도 적용

3. 프론트엔드 _fetchAppCtxMax()가 페이지 로드 시 한 번만 조회했다.
   → force 인자 추가, 설정 저장 직후 재조회

검증: 게이지 8192 → 262144(지서버 실제값 일치), 반복 호출 5회 안정.
캐시 키는 모델 전환 시 무효화되고 설정 동일 시 적중.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-09 01:04:12 +09:00
kimandClaude Sonnet 5 814f32a63e v4.3.19-5: 컨텍스트 게이지 provider-aware하게 수정 + 캐시 버그 제거
- resolveNumCtx()가 Ollama 전용이라 primary가 Google로 바뀐 뒤 세션
  컨텍스트 게이지가 419%까지 잘못 표시되던 버그 수정 — google provider면
  Gemini API에서 inputTokenLimit을 실시간 조회(하드코딩 아님, API 실패시만
  1048576 폴백)
- 최종 폴백(8192)을 캐시하던 버그 제거 — 재시작 직후 첫 조회가 일시적으로
  실패하면 프로세스 수명 내내 8192에 고정되던 문제, 이제 재시도 가능
- /api/model-context: model 파라미터 없을 때(메인 채팅 사이드바 게이지)
  무조건 200000(클로드 가정) 반환하던 걸 resolveNumCtx() 재사용으로 교체
  — 이제 실제 활성 provider와 항상 동기화됨

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-26 17:17:14 +09:00
kimandClaude Sonnet 5 05976e3f05 v4.3.6: gateway 루트에 남아있던 나머지 20개 파일도 서브디렉토리로 분류
- memory/ (3): fact-store, memory-manager, memory-vector
- hooks/ (2): hooks, hook-loader
- infra/ (4): boot, gpu-detector, ollama-process-manager, mcp-manager
- guards/ (6): link-validator, visual-error-detection, context-injection,
  prompt-gates, retry-strategy, verification-flow
- internal-agent-task.ts(실제 express 라우터), music-renderer.ts(routes-music.ts
  전용 백엔드)는 routes/로 편입
- server.ts/session.ts/skills-manager.ts는 5곳 안팎에서 두루 참조되는 핵심
  모듈이라 루트 유지, orchestrator.ts(export {}뿐인 죽은 레거시 껍데기)도
  분류 대상이 아니라 별도 이슈로 루트에 남김
- 이번에도 import 경로 자동 재계산 스크립트 사용, 41곳 수정 후 빌드/재시작/
  20개 엔드포인트 재검증 완료

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-25 17:10:44 +09:00
kimandClaude Sonnet 4.6 75a36cdc7d v3.2.2: 폴더블 폰 모바일 패널 토글 전면 수정 + 탐정앱 네트워크 분석 + 음성 유틸
- mobToggle 가드 640→1024: 음악·슬라이드·코드·날씨·언어·치과·ESP32·아두이노 앱
  (CSS max-width:1024px인데 JS guard가 >640으로 남아 폴드 내부화면에서 토글 불가)
- #mob-tabbar z-index 400/490→600, 패널 bottom 0→52px, backdrop inset 0 0 52px 0
  (backdrop이 탭바를 가려 열린 상태에서 다른 탭 전환 불가 문제 해결)
- 모든 innerWidth<=640 자동트리거 →<=1024 통일 (9개 앱)
- 탐정앱: 네트워크 분석 패널 (IP조회/Traceroute/Nmap/DNS/WHOIS/SSL/취약점/해시/웹스캔/배너/CVE)
- voice-utils.js 분리 — 서브앱 공통 음성입력+TTS 유틸
- app.js: 컨텍스트 토큰 게이지 (세션 목록에 tok/max 표시), usage 이벤트 처리
- routes-music.ts: Demucs 보컬분리 + YouTube 다운로드 잡 관리 (TTL 자동정리)
- server-v2.ts: 탐정 네트워크 API (traceroute/dns/whois/ssl/nmap/vuln/hash/webscan/cve)
- session.ts: resolveNumCtx export, /api/agent/session contextTokenEstimate 노출
- config.json: 카카오 채널 설정, ITS 교통 API 키 vault 참조
- styles.css: app-mic-btn / app-tts-btn 공통 스타일

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-27 19:16:59 +09:00
kimandClaude Sonnet 4.6 508d11615a Add user workspaces, dental DB scripts, server memory + code editor improvements
- cherry: orofacial/TMD PPTX presentations + 음악가 구강건강 가이드
- papa: sinus/infraoccluded PPTX, garden-monitor Arduino, MIDI files
- databases: PCSP scraper, translation scripts, vision benchmark, batch JSONs
- web-ui: code.js/companion.py/styles.css major updates, autostart installer
- src: ollama-client, session, LLMProvider, ollama-adapter patches
- .gitignore: add claude-key, SQLite WAL/SHM, __pycache__, nohup.out

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-07 23:13:03 +09:00
kimandClaude Sonnet 4.6 5608b83850 Refactor project layout and fix workspace/subagent paths
- Remove global workspace (workspace/) — all data migrated to .smallclaw/
- Move ppt/ skins & templates to .smallclaw/skills/presenter/ppt/
- Add .smallclaw/templates/ for user bootstrap files
- Move dental_images to .smallclaw/databases/, update 1,485 DB entries
- Fix subagent store paths to use SMALLCLAW_DATA_DIR instead of workspace.path
- Per-user Telegram bots: MultiUserTelegramManager, vault-stored tokens
- Fix Telegram token persistence (vault fallback, strip from config.json)
- Fix session migration: delete global originals even when skipping
- Delete unused root images, MD docs, tests/, smallclawworkspace/ artifacts
- Add meteorologist skill, counselor skill, presenter skill scaffold
- Strip workspace.path from config.json (was causing path confusion)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-28 15:21:21 +09:00
kimandClaude Sonnet 4.6 bc9fb4043b Improve session management: token-based history, boot session cleanup, telegram user mapping
- session.ts: Replace fixed maxMessages limit with token-based trimHistory;
  resolveNumCtx() now queries Ollama API for actual model context length (cached).
  maxMessages raised to 2000 as safety ceiling only.
- session.ts: Boot sessions (boot-*) never saved to disk — ephemeral by design.
- session.ts: New sessions not written to disk until first message is added.
- session.ts: Add cleanupEmptySessions() called at startup to auto-remove empty files.
- session.ts: migrateGlobalSessionsToUser() deletes global original after copying to user dir.
- server-v2.ts: Call cleanupEmptySessions() at startup.
- server-v2.ts: User creation API accepts optional telegramId for immediate channel mapping.
- config.json: Remove explicit maxMessages (now uses dynamic token-based default).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-20 11:03:53 +09:00
kim 9714d4b50c v2.4.0 2026-05-04 17:58:17 +09:00
kim ec53a112b4 v.2.3.0 2026-05-01 23:23:11 +09:00
kimandClaude Sonnet 4.6 8da045eb72 v2.2.3
- Mobile menu: full-screen overlay on bottom nav tap (slide-up animation + close button)
- Sidebar: server log panel with auto-scroll and real-time polling
- Admin: context viewer tab (session usage per user)
- Chat export: Markdown / TXT / JSON
- Online users display in system stats (admin-only)
- Fix: workspace priority (session > global) for multi-user file isolation
- Fix: upload filenames now preserve Unicode/Korean characters
- Fix: log ring buffer wrap-around bug (logTotalCount monotonic counter)
- Security: /api/logs requires auth; online_users restricted to admin
- WebSocket: ping/pong keepalive every 30s

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 17:20:24 +09:00
kim 7b34afbd38 v2.0 2026-04-30 12:41:49 +09:00
kim 3e8974a8eb v1.0 2026-04-29 11:45:59 +09:00