Remove server recommendation consultation system:
- 30-year expert AI persona
- Session-based information gathering
- Brave Search / Context7 tool integration
- Automatic spec inference
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Consolidate OpenAI types to types.ts
- Create reusable callOpenAI() function
- Add tool call parsing and result handling
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Create reusable SessionManager<T> with CRUD operations
- Support for session expiry, message limits
- Specialized managers for Domain and Server agents
- Reduce code duplication across 4 agents
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Server Management:
- Fix /server command API auth (query param instead of header)
- Show server specs (vCPU/RAM/Bandwidth) in /server list
- Prevent AI from refusing server deletion based on expiration date
- Add explicit instructions in tool description and system prompt
Refund Display:
- Show before/after balance in server deletion refund message
- Format: 환불 전 잔액 → 환불 금액 → 환불 후 잔액
Other Changes:
- Add stopped status migration for server orders
- Clean up callback handler (remove deprecated code)
- Update constants and pattern utilities
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Fix USD price display: all prices now show in KRW (₩)
- Add Korea region auto-detection: extracts region preference from user messages
- Fix low-spec recommendation for high-performance requirements:
- Add extractTechStack() to detect PostgreSQL, Redis, MongoDB keywords
- Enhance inferExpectedUsers() to consider tech stack complexity
- SaaS/B2B services now recommend 4GB+ RAM servers
- Fix __DIRECT__ tag appearing in output:
- Reorder message concatenation in server-agent.ts
- Add stripping logic in conversation-service.ts and api.ts
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Remove Queue-based server provisioning (moved to cloud-orchestrator)
- Add manage_server tool with Service Binding to Cloud Orchestrator
- Add CDN cache hit rate estimation based on tech_stack
- Always display bandwidth info (show "포함 범위 내" when no overage)
- Add language auto-detection (ko, ja, zh, en)
- Update system prompt to always call tools fresh
- Add Server System documentation to CLAUDE.md
BREAKING: Server provisioning now requires cloud-orchestrator service
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add server recommendation integration (SERVER_RECOMMEND worker)
- Implement KV-based session management for multi-step ordering
- Add Linode/Vultr API clients for server provisioning
- Add server-tool for Function Calling support
refactor: major code reorganization (Phase 1-3)
- Remove 443 lines of deprecated callback handlers
- Extract handlers to separate files (message-handler, callback-handler)
- Extract cloud-spec-service, server-recommend-service
- Centralize constants (OS_IMAGES, REGION_FLAGS, NUM_EMOJIS)
- webhook.ts reduced from 1,951 to 30 lines
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
DRY Improvements (api.ts):
- Extract requireApiKey() helper for API authentication
- Extract getCorsHeaders() helper for CORS header generation
- Eliminate ~20 lines of duplicated code
Type Safety (new utils/error.ts):
- Add toError() utility for safe error type conversion
- Replace all 6 `error as Error` assertions with toError()
- Proper handling of Error, string, and unknown types
Error Handling (api.ts):
- Add explicit JSON parsing error handling to all POST endpoints
- Return 400 Bad Request for malformed JSON
- Clearer error messages for API consumers
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Type Safety Improvements:
- Add isErrorResult() type guard for API responses (domain-tool.ts)
- Replace `any` with `unknown` in executeTool args (tools/index.ts)
- Add JSON.parse error handling in function calling (openai-service.ts)
- Fix nullable price handling with nullish coalescing
- Add array type guard for nameservers validation
Code Quality Improvements:
- Extract convertNamecheapDate() to eliminate duplicate functions
- Move hardcoded bank account info to environment variables
- Add JSDoc documentation to executeDepositFunction
- Fix unused variables in optimistic-lock.ts
- Handle Error.captureStackTrace for Workers environment
All TypeScript strict mode checks now pass.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Implement optimistic locking for deposit balance updates
- Prevent race conditions in concurrent deposit requests
- Add automatic retry with exponential backoff (max 3 attempts)
- Add version column to user_deposits table
- Improve type safety across codebase
- Add explicit types for Namecheap API responses
- Add typed function arguments (ManageDepositArgs, etc.)
- Remove `any` types from deposit-agent and tool files
- Add reconciliation job for balance integrity verification
- Compare user_deposits.balance vs SUM(confirmed transactions)
- Alert admin on discrepancy detection
- Set up test environment with Vitest + Miniflare
- Add 50+ test cases for deposit system
- Add helper functions for test data creation
- Update documentation
- Add migration guide for version columns
- Document optimistic locking patterns
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Phase 5-3 모니터링 강화 작업의 통합을 완료했습니다.
변경사항:
- Logger 통합: console.log를 구조화된 로깅으로 전환 (9개 파일)
- JSON 기반 로그, 환경별 자동 전환 (개발/프로덕션)
- 타입 안전성 보장, 성능 측정 타이머 내장
- Metrics 통합: 실시간 성능 모니터링 시스템 연결 (3개 파일)
- Circuit Breaker 상태 추적 (api_call_count, error_count, state)
- Retry 재시도 횟수 추적 (retry_count)
- OpenAI API 응답 시간 측정 (api_call_duration)
- 알림 통합: 장애 자동 알림 시스템 구현 (2개 파일)
- Circuit Breaker OPEN 상태 → 관리자 Telegram 알림
- 재시도 실패 → 관리자 Telegram 알림
- Rate Limiting 적용 (1시간에 1회)
- 문서 업데이트:
- CLAUDE.md: coder 에이전트 설명 강화 (20년+ 시니어 전문가)
- README.md, docs/: 아키텍처 문서 추가
영향받은 파일: 16개 (수정 14개, 신규 2개)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>