Skip to content

feat: ACP standardization + ko i18n + ops hardening (full branch)#1069

Open
codebit0 wants to merge 14 commits intonextlevelbuilder:devfrom
codebit0:merge/2026-04-29
Open

feat: ACP standardization + ko i18n + ops hardening (full branch)#1069
codebit0 wants to merge 14 commits intonextlevelbuilder:devfrom
codebit0:merge/2026-04-29

Conversation

@codebit0
Copy link
Copy Markdown
Contributor

Summary

Comprehensive branch covering ACP (Agent Client Protocol) provider work, Korean (ko) localization, and several operational fixes. Built on top of origin/main (merged in) so it reflects the full state we have been running internally.

This PR is broader in scope than #1067 (which extracts the ACP-only subset). Reviewers may prefer to land #1067 first and rebase this PR on top, or split it further.

Major themes

1. ACP protocol standardization and hardening

  • Handle session/request_permission for Gemini CLI 0.38.x
  • Prompt inactivity watchdog + stealth mode option
  • Unified ACPSettings config struct shared by both registration paths (config.json providers.acp and DB llm_providers.settings JSONB)
  • ACP provider hot-reload on DB updates (no gateway restart)
  • GEMINI.md-based system prompt + context restoration on session reset
  • ACP permission-mode wiring through tool bridge
  • Unit tests for extractACPContent and writeGeminiMD

2. Korean (ko) localization

  • New internal/i18n/catalog_ko.go with full key coverage
  • LocaleKO constant and IsSupported extended
  • All UI namespaces translated under ui/web/src/i18n/locales/ko/*.json
  • SUPPORTED_LANGUAGES and language label tables updated

3. Provider verify (#1034 refactor)

  • model is now required (ping-mode entrypoint kept as a fallback in this branch — see file diff)
  • Response shape: {success, models[]} for richer feedback
  • CLI: goclaw providers verify <id> prints the available model list

4. Gemini native embedding provider

  • New internal/memory/embedding_gemini.go (memory.NewGeminiEmbeddingProvider)
  • buildEmbeddingProvider adds ProviderGeminiNative branch

5. Operational fixes

  • Bot token masking in channel logs (Telegram, etc.)
  • Episodic memory worker timeout raised to 120s
  • path_escape log corrections
  • Channel watchdog retry on transient failures
  • Missing X-GoClaw-User-Id header on gateway HTTP client
  • Heartbeat FK migration (after upgraded v3.11.1 from v3.9.2, the provider is broken #1034) and tenant-scoped DeleteProvider retained from upstream main

6. Docs / repo hygiene

  • GEMINI.md moved to parent directory
  • KIS integration guidelines added to DEVNOTE.md
  • CLAUDE.md / DEVNOTE.md scoped out of earlier PRs (per repository convention)

Out of scope / known caveats

Test plan

  • go build ./... passes (PG)
  • go build -tags sqliteonly ./... passes (Desktop/SQLite)
  • go vet ./... passes
  • Unit tests pass (go test ./...pkg/browser has 1 pre-existing IPv4-DNS-fallback failure unrelated to this PR)
  • Reviewer to run integration tests with pgvector pg18 on port 5433
  • Manually verify Gemini CLI (0.38.x) ACP flow: session/new, prompt, request_permission
  • Manually verify ACP provider hot-reload (DB add → no gateway restart needed)
  • Switch UI locale to ko and spot-check translated strings
  • Verify Telegram bot token is masked in logs

codebit0 and others added 14 commits April 26, 2026 12:04
- CLAUDE.md: add Work Process Rules (ask before modify) and KIS Strategy
  Builder Integration section (direct Python import, no automation in
  strategy builder, master file schedule is goclaw's responsibility)
- DEVNOTE.md: architecture notes, master file URLs/format, NXT support,
  autonomous agent scan cycle, TODO list
- GEMINI.md: reference CLAUDE.md for Gemini ACP agent instructions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- 백엔드: LocaleKO 상수, IsSupported에 ko 추가, catalog_ko.go 185개 문자열
- 웹 UI: 38개 네임스페이스 JSON 파일 (locales/ko/)
- constants.ts SUPPORTED_LANGUAGES에 ko 추가
- index.ts에 ko 리소스 등록 및 getInitialLanguage에 ko 감지
- en/topbar.json languages에 한국어 옵션 추가
- webui handler: index.html에 no-cache 헤더 추가하여 배포 후 캐시 문제 방지
- ClientInfo.Name을 빈 문자열로 변경하여 일반 CLI 요청과 동일하게 처리
- GEMINI_TELEMETRY_ENABLED=false로 Clearcut 텔레메트리 비활성화
- Prompt에 비활성 감시(10분) 추가하여 무응답 행 방지
- 에러/취소 시 기존 누적 응답도 함께 반환하도록 개선
- reapLoop에서 Delete를 cancel 이전으로 이동하여 race 방지
- sessionReaper에서 sessionMu도 함께 정리
- ACP MCP 브리지 노출: Gemini가 skill_search 등 goclaw 빌트인 툴 사용 가능
  - NewBridgeServer가 BuiltinToolStore에서 활성화된 툴 목록을 동적으로 로딩
  - bridgeAlwaysExcluded(spawn, create_forum_topic, heartbeat) 제외 처리
- Gemini McpServer 헤더 포맷 수정: 스펙(object) 대신 Gemini CLI 0.36.x 실제
  구현에 맞춰 []McpServerKV 배열 형식으로 변경
- ACP 퍼-세션 cwd 격리: cli-workspaces와 동일하게 세션별 독립 워크스페이스 생성
- enrichGeminiACPArgs: skills-store 등 5개 스킬 소스 디렉토리를 --include-directories로 추가
- buildACPMcpServersFunc: context 헤더 + HMAC 인증 + UI 등록 MCP 서버 통합
- is_system 시맨틱 정리: UpsertSystemSkill이 is_system을 강제하지 않음
  - INSERT: is_system=false (운영자가 명시적으로 설정)
  - UPDATE: is_system 컬럼 유지 (시더 재실행이 운영자 설정 덮어쓰지 않음)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- writeGeminiMD: 시스템 프롬프트를 세션 워크스페이스의 GEMINI.md에 기록
  (Claude CLI의 writeClaudeMD와 동일한 패턴)
  - 내용 변경 시에만 디스크 쓰기
  - 변경 감지 시 acpSessions 무효화 → 다음 요청이 업데이트된 GEMINI.md로 새 세션 시작
- resolveSession: sessionDir 파라미터 추가, isNew bool 반환
  - isNew=true: session/new로 생성된 신규 세션 (컨텍스트 주입 필요)
  - isNew=false: 기존 세션 유지 또는 session/load 복원
- extractACPContent(req, isNew bool) 재설계:
  - isNew=false: 현재 유저 메시지만 전송 (시스템 프롬프트 반복 제거)
  - isNew=true: req.Messages 전체 직렬화 (system 제외)
    → episodic summary + 최근 히스토리 + 현재 메시지 포함
    → 세션 리셋 후에도 compaction된 과거 맥락 유지

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- NormalTurn: isNew=false 시 유저 메시지만 전송, system 미포함 검증
- NewSession_WithHistory: isNew=true 시 summary+history+current 포함 검증
- NewSession_FirstEver: 첫 메시지에서도 isNew=true 정상 동작 검증
- NoUserMessage: 유저 메시지 없으면 nil 반환 검증
- WriteGeminiMD: 신규 생성/변경없음 no-op/내용변경 갱신 각각 검증

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…atchdog retry

- Pass gateway token through wireHTTP and wire ACP register fn on provider save
- Support PermMode setting when registering ACP providers from DB
- Add Gemini native embedding provider in gateway agent setup
- Add channel manager watchdog with exponential retry schedule for failed channels
- Add onDisconnect callback on BaseChannel for runtime auto-retry
- ACP tool bridge and session improvements

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Gemini CLI 0.38.x가 MCP 툴 실행 전 permission 요청에 "permission/request"
대신 "session/request_permission" 메서드를 사용하는데, 이 메서드가 처리되지
않아 JSON-RPC error가 plain object로 reject되고 String({...}) = "[object Object]"
오류로 툴 실행이 모두 실패하던 문제를 수정.

- SessionRequestPermissionRequest/Response 타입 추가 (중첩 outcome 구조)
- ToolBridge.Handle()에 session/request_permission case 추가
- handleSessionPermission(): permMode에 따라 cancelled/selected 응답,
  approve-all 모드에서 proceed_always_server 우선 선택으로 세션 내 이후
  goclaw-bridge 툴 호출이 confirmation 없이 실행되도록 처리
- 디버그 시 추가한 ACP 로깅 개선 (tool_call_update, MCP 서버 목록,
  session/prompt 내용 preview, notification params Info 레벨)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…_escape 로그 수정

- channels: MaskBotToken() export, failed start/watchdog retry 로그 마스킹
- telegram: sync menu commands 오류 로그 봇 토큰 마스킹
- consolidation: episodic summarize 타임아웃 30s → 120s (ACP init 지연 대응)
- tools: resolvePathWithAllowed security.path_escape warn 추가, resolvePath는 debug로 변경

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- ACPSettings 통합 설정 구조체 — config.json/DB JSONB 양쪽 등록 경로 공유
- ACP MCP 브리지 설정(acpMCPData) 패키지 변수로 공급, 핫리로드 시 갱신
- DB 변경 시 ACP provider 자동 재등록 (gateway 재시작 불필요)
- Gemini native 임베딩 provider (memory.NewGeminiEmbeddingProvider) 추가

Co-Authored-By: Claude Opus 4.7 (1M context) <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