Files
claude-mem/src/services/worker/http/routes/CLAUDE.md
T
Alex Newman 05323c9db5 Cleanup worker-service.ts: remove dead code and fallback concept (#706)
* refactor(worker): remove dead code from worker-service.ts

Remove ~216 lines of unreachable code:
- Delete `runInteractiveSetup` function (defined but never called)
- Remove unused imports: fs namespace, spawn, homedir, readline,
  existsSync/writeFileSync/readFileSync/mkdirSync
- Clean up CursorHooksInstaller imports (keep only used exports)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(worker): only enable SDK fallback when Claude is configured

Add isConfigured() method to SDKAgent that checks for ANTHROPIC_API_KEY
or claude CLI availability. Worker now only sets SDK agent as fallback
for third-party providers when credentials exist, preventing cascading
failures for users who intentionally use Gemini/OpenRouter without Claude.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* refactor(worker): remove misleading re-export indirection

Remove unnecessary re-export of updateCursorContextForProject from
worker-service.ts. ResponseProcessor now imports directly from
CursorHooksInstaller.ts where the function is defined. This eliminates
misleading indirection that suggested a circular dependency existed.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* refactor(mcp): use build-time injected version instead of hardcoded strings

Replace hardcoded '1.0.0' version strings with __DEFAULT_PACKAGE_VERSION__
constant that esbuild replaces at build time. This ensures MCP server and
client versions stay synchronized with package.json.

- worker-service.ts: MCP client version now uses packageVersion
- ChromaSync.ts: MCP client version now uses packageVersion
- mcp-server.ts: MCP server version now uses packageVersion
- Added clarifying comments for empty MCP capabilities objects

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* feat: Implement cleanup and validation plans for worker-service.ts

- Added a comprehensive cleanup plan addressing 23 identified issues in worker-service.ts, focusing on safe deletions, low-risk simplifications, and medium-risk improvements.
- Created an execution plan for validating intentional patterns in worker-service.ts, detailing necessary actions and priorities.
- Generated a report on unjustified logic in worker-service.ts, categorizing issues by severity and providing recommendations for immediate and short-term actions.
- Introduced documentation for recent activity in the mem-search plugin, enhancing traceability and context for changes.

* fix(sdk): remove dangerous ANTHROPIC_API_KEY check from isConfigured

Claude Code uses CLI authentication, not direct API calls. Checking for
ANTHROPIC_API_KEY could accidentally use a user's API key (from other
projects) which costs 20x more than Claude Code's pricing.

Now only checks for claude CLI availability.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

* fix(worker): remove fallback agent concept entirely

Users who choose Gemini/OpenRouter want those providers, not secret
fallback behavior. Removed setFallbackAgent calls and the unused
isConfigured() method.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-13 23:30:13 -05:00

4.4 KiB

# Recent Activity

Dec 5, 2025

ID Time T Title Read
#20734 9:08 PM 🔵 SearchRoutes Context Injection Endpoint with Dynamic Import ~614
#20548 8:21 PM 🔵 Context generator imported from services directory in worker ~334
#20547 " 🔵 Context injection route implementation in SearchRoutes.ts ~289

Dec 7, 2025

ID Time T Title Read
#21742 10:16 PM 🔵 SessionRoutes Analysis: Identified 10+ Scattered Broadcast Calls ~540

Dec 8, 2025

ID Time T Title Read
#22301 9:44 PM 🔵 Privacy Validation in Observation Processing ~399
#22296 9:43 PM 🔵 SessionRoutes HTTP Endpoints and SDK Agent Lifecycle ~442
#22222 8:29 PM 🔵 Found waiting logic in SessionRoutes but it may not be working correctly ~359
#22005 5:40 PM 🔵 handleObservationsByClaudeId Current Implementation ~443
#22004 " 🔵 Legacy Observation Handling Pattern Identified ~337
#22003 " 🔵 SessionRoutes Architecture Confirmed ~354
#21969 5:22 PM 🟣 Worker Routes Pass tool_use_id to SessionManager Queue ~290
#21968 " Worker Endpoint Extracts toolUseId from Observation Request ~243
#21962 5:21 PM 🟣 Implemented handleGetObservationsForToolUse Endpoint Handler ~325
#21961 " 🟣 Added GET Endpoint for Fetching Observations by Tool Use ID ~272
#21951 5:18 PM 🔵 Worker SessionRoutes Architecture and Endpoints Reviewed ~418
#21948 5:09 PM 🟣 Implemented PreToolUse Endpoint Handler ~334
#21947 5:07 PM 🟣 Added PreToolUse Route Registration ~287

Dec 9, 2025

ID Time T Title Read
#23143 6:42 PM Updated Skip Tools Logic to Use USER_SETTINGS_PATH Constant ~150
#23142 " Fixed Settings Path Import in SessionRoutes ~148
#23140 6:41 PM 🟣 Implemented Skip Tools Filtering in Observations Endpoint ~386
#23138 " Added SettingsDefaultsManager and Paths Imports to SessionRoutes ~222
#23136 " 🔵 SessionRoutes handleObservationsByClaudeId Handler Structure ~329
#23007 4:02 PM 🔵 Settings Write Implementation Using Nested Schema ~398
#22859 2:28 PM 🔴 Fixed Python Version Validation to Support 3.10+ ~322
#22854 2:27 PM 🔵 Located Python Version Validation Regex in SettingsRoutes ~316

Dec 10, 2025

ID Time T Title Read
#23593 5:52 PM 🔵 SearchRoutes Handler Pattern ~268
#23588 5:51 PM 🔵 Search Routes HTTP API Integration ~281

Dec 14, 2025

ID Time T Title Read
#26253 8:31 PM 🔵 SearchRoutes Confirms Context Endpoints Use generateContext, Search Uses SearchManager ~397
#25689 4:23 PM 🔵 SessionRoutes queueSummarize receives messages but doesn't persist them to database ~496

Dec 15, 2025

ID Time T Title Read
#27043 6:04 PM 🔵 Subagent confirms no version switcher UI exists, only orphaned backend infrastructure ~539
#27041 6:03 PM 🔵 Branch switching code isolated to two backend files, no frontend UI components ~473
#27037 6:02 PM 🔵 Branch switching functionality exists in SettingsRoutes with UI switcher removal intent ~463

Dec 16, 2025

ID Time T Title Read
#27414 3:25 PM 🔵 Batch Observations Endpoint Already Implemented ~330

Dec 19, 2025

ID Time T Title Read
#30077 8:05 PM 🔵 SessionRoutes HTTP API Manages SDK Agent Lifecycle and Message Queue ~516

Dec 26, 2025

ID Time T Title Read
#32949 10:55 PM 🔵 Complete settings persistence flow for Xiaomi MIMO v2 Flash model ~320
#32939 10:53 PM 🔵 Settings API routes handle model configuration persistence ~288

Dec 30, 2025

ID Time T Title Read
#34491 2:28 PM 🔵 SessionRoutes Implements Multi-Provider Agent Management ~635