fix: Claude Code 2.1.1 compatibility + log-level audit + path validation fixes (#614)
* Refactor CLAUDE.md and related files for December 2025 updates - Updated CLAUDE.md in src/services/worker with new entries for December 2025, including changes to Search.ts, GeminiAgent.ts, SDKAgent.ts, and SessionManager.ts. - Revised CLAUDE.md in src/shared to reflect updates and new entries for December 2025, including paths.ts and worker-utils.ts. - Modified hook-constants.ts to clarify exit codes and their behaviors. - Added comprehensive hooks reference documentation for Claude Code, detailing usage, events, and examples. - Created initial CLAUDE.md files in various directories to track recent activity. * fix: Merge user-message-hook output into context-hook hookSpecificOutput - Add footer message to additionalContext in context-hook.ts - Remove user-message-hook from SessionStart hooks array - Fixes issue where stderr+exit(1) approach was silently discarded Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Update logs and documentation for recent plugin and worker service changes - Added detailed logs for worker service activities from Dec 10, 2025 to Jan 7, 2026, including initialization patterns, cleanup confirmations, and diagnostic logging. - Updated plugin documentation with recent activities, including plugin synchronization and configuration changes from Dec 3, 2025 to Jan 7, 2026. - Enhanced the context hook and worker service logs to reflect improvements and fixes in the plugin architecture. - Documented the migration and verification processes for the Claude memory system and its integration with the marketplace. * Refactor hooks architecture and remove deprecated user-message-hook - Updated hook configurations in CLAUDE.md and hooks.json to reflect changes in session start behavior. - Removed user-message-hook functionality as it is no longer utilized in Claude Code 2.1.0; context is now injected silently. - Enhanced context-hook to handle session context injection without user-visible messages. - Cleaned up documentation across multiple files to align with the new hook structure and removed references to obsolete hooks. - Adjusted timing and command execution for hooks to improve performance and reliability. * fix: Address PR #610 review issues - Replace USER_MESSAGE_ONLY test with BLOCKING_ERROR test in hook-constants.test.ts - Standardize Claude Code 2.1.0 note wording across all three documentation files - Exclude deprecated user-message-hook.ts from logger-usage-standards test Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix: Remove hardcoded fake token counts from context injection Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Address PR #610 review issues by fixing test files, standardizing documentation notes, and verifying code quality improvements. * fix: Add path validation to CLAUDE.md distribution to prevent invalid directory creation - Add isValidPathForClaudeMd() function to reject invalid paths: - Tilde paths (~) that Node.js doesn't expand - URLs (http://, https://) - Paths with spaces (likely command text or PR references) - Paths with # (GitHub issue/PR references) - Relative paths that escape project boundary - Integrate validation in updateFolderClaudeMdFiles loop - Add 6 unit tests for path validation - Update .gitignore to prevent accidental commit of malformed directories - Clean up existing invalid directories (~/, PR #610..., git diff..., https:) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * fix: Implement path validation in CLAUDE.md generation to prevent invalid directory creation - Added `isValidPathForClaudeMd()` function to validate file paths in `src/utils/claude-md-utils.ts`. - Integrated path validation in `updateFolderClaudeMdFiles` to skip invalid paths. - Added 6 new unit tests in `tests/utils/claude-md-utils.test.ts` to cover various rejection cases. - Updated `.gitignore` to prevent tracking of invalid directories. - Cleaned up existing invalid directories in the repository. * feat: Promote critical WARN logs to ERROR level across codebase Comprehensive log-level audit promoting 38+ WARN messages to ERROR for improved debugging and incident response: - Parser: observation type errors, data contamination - SDK/Agents: empty init responses (Gemini, OpenRouter) - Worker/Queue: session recovery, auto-recovery failures - Chroma: sync failures, search failures (now treated as critical) - SQLite: search failures (primary data store) - Session/Generator: failures, missing context - Infrastructure: shutdown, process management failures - File Operations: CLAUDE.md updates, config reads - Branch Management: recovery checkout failures Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> * fix: Address PR #614 review issues - Remove incorrectly tracked tilde-prefixed files from git - Fix absolute path validation to check projectRoot boundaries - Add test coverage for absolute path validation edge cases Closes review issues: - Issue 1: ~/ prefixed files removed from tracking - Issue 3: Absolute paths now validated against projectRoot - Issue 4: Added 3 new test cases for absolute path scenarios Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * build assets and context --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -3,56 +3,5 @@
|
||||
|
||||
<!-- This section is auto-generated by claude-mem. Edit content outside the tags. -->
|
||||
|
||||
### Dec 28, 2025
|
||||
|
||||
**BaseRouteHandler.ts**
|
||||
| ID | Time | T | Title | Read |
|
||||
|----|------|---|-------|------|
|
||||
| #33396 | 9:53 PM | ✅ | Queue refactoring touched 12 files with net addition of 1021 lines | ~402 |
|
||||
| #33336 | 3:36 PM | 🔴 | Fixed Windows Worker Crashes and Headers Already Sent Errors | ~351 |
|
||||
| #33259 | 2:46 PM | 🔴 | Windows Worker Stability Pull Request Created | ~386 |
|
||||
| #33258 | 2:38 PM | 🔴 | Added headersSent Guard to Error Handler | ~338 |
|
||||
| #33256 | 2:36 PM | ⚖️ | Implementation Plan for Windows Worker Issues | ~471 |
|
||||
|
||||
### Jan 1, 2026
|
||||
|
||||
**middleware.ts**
|
||||
| ID | Time | T | Title | Read |
|
||||
|----|------|---|-------|------|
|
||||
| #35614 | 10:57 PM | 🔴 | Suppressed /api/logs endpoint logging to reduce noise | ~252 |
|
||||
| #35612 | " | ✅ | HTTP logging middleware excludes /api/logs polling endpoint | ~262 |
|
||||
| #35611 | " | 🔵 | HTTP Middleware Architecture in Worker Service | ~360 |
|
||||
|
||||
**BaseRouteHandler.ts**
|
||||
| ID | Time | T | Title | Read |
|
||||
|----|------|---|-------|------|
|
||||
| #35433 | 8:43 PM | 🔵 | Try-Catch Block Distribution Across Services | ~372 |
|
||||
|
||||
### Jan 2, 2026
|
||||
|
||||
**middleware.ts**
|
||||
| ID | Time | T | Title | Read |
|
||||
|----|------|---|-------|------|
|
||||
| #35951 | 4:42 PM | 🔵 | Multi-Layer Service Architecture Discovery | ~395 |
|
||||
|
||||
### Jan 3, 2026
|
||||
|
||||
**middleware.ts**
|
||||
| ID | Time | T | Title | Read |
|
||||
|----|------|---|-------|------|
|
||||
| #36689 | 11:56 PM | 🔵 | PR #538 Review Findings - Modular Architecture Refactor | ~590 |
|
||||
|
||||
### Jan 5, 2026
|
||||
|
||||
**BaseRouteHandler.ts**
|
||||
| ID | Time | T | Title | Read |
|
||||
|----|------|---|-------|------|
|
||||
| #37665 | 5:52 PM | 🔵 | Codebase uses dependency injection and lazy initialization patterns to avoid circular dependencies | ~548 |
|
||||
| #37662 | " | 🔵 | BaseRouteHandler imports logger demonstrating HTTP layer dependency on logger | ~367 |
|
||||
|
||||
**middleware.ts**
|
||||
| ID | Time | T | Title | Read |
|
||||
|----|------|---|-------|------|
|
||||
| #37626 | 5:35 PM | 🔵 | FormatTool Function Usage Across Codebase | ~493 |
|
||||
| #37537 | 4:45 PM | 🔵 | Middleware formatTool Call Confirmed as Critical Crash Point | ~361 |
|
||||
*No recent activity*
|
||||
</claude-mem-context>
|
||||
@@ -3,105 +3,57 @@
|
||||
|
||||
<!-- This section is auto-generated by claude-mem. Edit content outside the tags. -->
|
||||
|
||||
### Jan 2, 2026
|
||||
|
||||
**SessionRoutes.ts**
|
||||
| ID | Time | T | Title | Read |
|
||||
|----|------|---|-------|------|
|
||||
| #36103 | 10:25 PM | 🟣 | Generator Crash Recovery with Automatic Restart | ~374 |
|
||||
| #36079 | 10:10 PM | 🔴 | Fixed Generator Crashes from Silent Chroma Vector Search Failures | ~531 |
|
||||
| #36066 | 9:55 PM | 🔵 | Session Generator Lifecycle and Error Handling Architecture | ~536 |
|
||||
| #36008 | 8:15 PM | 🔴 | Fixed Memory Leak in Generator Error Handler | ~358 |
|
||||
| #36007 | " | 🔵 | Generator Error Handler Missing pendingProcessingIds Clear | ~376 |
|
||||
| #35998 | 5:32 PM | 🔴 | Critical Session ID Placeholder Bug Fixed to Prevent Transcript Pollution | ~488 |
|
||||
| #35997 | " | 🟣 | Session Alignment Logging Implemented Across Hook, HTTP, and SDK Layers | ~342 |
|
||||
| #35994 | 5:18 PM | 🔄 | Session Alignment Logging Updated to Track Memory ID Capture Status | ~334 |
|
||||
| #35985 | 5:16 PM | 🔵 | Alignment logging implemented across session lifecycle touchpoints | ~377 |
|
||||
| #35977 | 4:48 PM | 🔵 | Existing alignment logging infrastructure found | ~353 |
|
||||
| #35971 | 4:47 PM | 🟣 | Added Session Alignment Logging to Session Initialization | ~349 |
|
||||
| #35970 | " | 🔵 | Session ID Logging Distribution Across Codebase | ~485 |
|
||||
| #35968 | 4:46 PM | 🔵 | Content-Session API Endpoint Registration | ~280 |
|
||||
| #35967 | " | 🔵 | Content-Session-Based Observation and Summarize Endpoints with Privacy and Tool Filtering | ~607 |
|
||||
| #35966 | 4:45 PM | 🔵 | Session Initialization Stage One - Database Setup with Privacy Filtering | ~554 |
|
||||
| #35964 | " | 🔵 | Session Initialization Two-Stage API Pattern | ~468 |
|
||||
| #35963 | " | 🔵 | Session Route Endpoints and Crash Recovery Logic | ~634 |
|
||||
| #35962 | " | 🔵 | Session ID Usage Pattern Distribution | ~309 |
|
||||
| #35961 | 4:44 PM | 🔵 | SessionRoutes Multi-Provider Agent Selection | ~575 |
|
||||
| #35936 | 2:56 PM | 🔵 | SessionRoutes Has Catch Block That Marks Failed Messages After Generator Crashes | ~437 |
|
||||
| #35901 | 2:49 PM | 🔵 | PR #525 File Changes Summary | ~376 |
|
||||
| #35854 | 2:32 PM | 🔵 | Generator Error Handler Marks Processing Messages as Failed | ~505 |
|
||||
|
||||
**SearchRoutes.ts**
|
||||
| ID | Time | T | Title | Read |
|
||||
|----|------|---|-------|------|
|
||||
| #35951 | 4:42 PM | 🔵 | Multi-Layer Service Architecture Discovery | ~395 |
|
||||
|
||||
**LogsRoutes.ts**
|
||||
| ID | Time | T | Title | Read |
|
||||
|----|------|---|-------|------|
|
||||
| #35875 | 2:39 PM | 🔵 | Logging UI Architecture Mapped | ~599 |
|
||||
| #35826 | 2:29 PM | 🔵 | Backend logs API implementation analyzed | ~284 |
|
||||
|
||||
### Jan 3, 2026
|
||||
|
||||
**SessionRoutes.ts**
|
||||
| ID | Time | T | Title | Read |
|
||||
|----|------|---|-------|------|
|
||||
| #36333 | 8:27 PM | 🔵 | pendingProcessingIds Tracking Across System | ~357 |
|
||||
| #36323 | 8:25 PM | 🔵 | Message Queue Architecture Scope Expanded | ~302 |
|
||||
|
||||
### Jan 4, 2026
|
||||
|
||||
**SearchRoutes.ts**
|
||||
| ID | Time | T | Title | Read |
|
||||
|----|------|---|-------|------|
|
||||
| #36942 | 2:43 AM | 🔵 | Recent Context Feature Architecture | ~300 |
|
||||
|
||||
**SettingsRoutes.ts**
|
||||
| ID | Time | T | Title | Read |
|
||||
|----|------|---|-------|------|
|
||||
| #36781 | 12:45 AM | 🔵 | Complete GeminiAgent Model Configuration Gap Analysis | ~552 |
|
||||
| #36768 | 12:42 AM | 🔵 | Gemini Model Validation in SettingsRoutes | ~397 |
|
||||
| #36757 | 12:33 AM | 🔵 | Issue #511 Root Cause Identified - Gemini-3-Flash Configuration Mismatch | ~416 |
|
||||
| #36755 | " | 🔵 | SettingsRoutes Validation Includes gemini-3-flash | ~344 |
|
||||
| #36754 | " | 🔵 | Gemini-3-Flash Model Already Supported | ~301 |
|
||||
|
||||
**SessionRoutes.ts**
|
||||
| ID | Time | T | Title | Read |
|
||||
|----|------|---|-------|------|
|
||||
| #36730 | 12:26 AM | ⚖️ | Revised Memory Leak Fix Strategy for Issue #532 | ~412 |
|
||||
| #36714 | 12:12 AM | 🔵 | Memory Leak Analysis Report for Issue #532 Generated | ~531 |
|
||||
| #36712 | 12:11 AM | 🔵 | Memory Leak Analysis for Issue #532 Documented | ~646 |
|
||||
| #37327 | 11:44 PM | ✅ | Cleaned Up Auto-Generated CLAUDE.md Files | ~352 |
|
||||
| #37326 | " | ✅ | Staged All Changes for Commit | ~386 |
|
||||
| #37325 | " | ✅ | Staged PR #554 Implementation Files | ~373 |
|
||||
| #37324 | " | ✅ | Cleaned Up Auto-Generated CLAUDE.md Files | ~392 |
|
||||
| #37323 | " | ✅ | Cleanup Completed - 31 Auto-Generated CLAUDE.md Files Deleted | ~411 |
|
||||
| #37286 | 11:07 PM | ✅ | Phase 1 Settings Patch Applied Successfully | ~249 |
|
||||
| #37282 | 11:06 PM | ✅ | Phase 1 Settings Patch Created | ~284 |
|
||||
| #37280 | " | 🔵 | Feature Branch Missing FOLDER_CLAUDEMD_ENABLED Setting | ~251 |
|
||||
| #37272 | 11:02 PM | ✅ | Phase 1 Verification Complete - All Checks Pass | ~275 |
|
||||
| #37270 | " | 🔵 | Settings Routes Already Include FOLDER_CLAUDEMD_ENABLED | ~333 |
|
||||
| #37267 | 11:00 PM | ✅ | Added CLAUDE_MEM_FOLDER_CLAUDEMD_ENABLED to Settings Validation | ~284 |
|
||||
| #37266 | 10:59 PM | 🟣 | Added FOLDER_CLAUDEMD_ENABLED to Settings Routes Handler | ~329 |
|
||||
| #37259 | 10:32 PM | ⚖️ | Implementation Plan Created for PR #554 Enhancements | ~621 |
|
||||
| #37258 | 10:31 PM | ⚖️ | Comprehensive Implementation Plan Created for PR #554 Review Fixes | ~722 |
|
||||
| #37257 | 10:29 PM | 🔵 | Regenerate Script and Settings Infrastructure Analyzed | ~563 |
|
||||
| #37255 | " | 🔵 | Folder CLAUDE.md Integration Flow Mapped | ~550 |
|
||||
|
||||
### Jan 5, 2026
|
||||
|
||||
**CLAUDE.md**
|
||||
| ID | Time | T | Title | Read |
|
||||
|----|------|---|-------|------|
|
||||
| #38078 | 9:54 PM | ✅ | CLAUDE.md Documentation Cleanup - 1,233 Lines Removed Across 18 Files | ~590 |
|
||||
| #37947 | 8:10 PM | 🔵 | Context injection generates formatted context via generateContext function | ~332 |
|
||||
| #37838 | 6:55 PM | 🔵 | Complete Hook Architecture Technical Specification | ~704 |
|
||||
| #37836 | 6:54 PM | 🔵 | Worker Service HTTP API Architecture and Hook Integration Pattern | ~639 |
|
||||
| #37702 | 6:01 PM | 🔵 | Codebase uses path.join() exclusively with known anchors, no project root resolution pattern exists | ~489 |
|
||||
| #37701 | " | 🔵 | Complete cwd data flow traced from hooks through observation processing | ~447 |
|
||||
| #37694 | 5:55 PM | 🔵 | Sessions initialized via SessionManager.initializeSession() with cwd from request body | ~361 |
|
||||
| #37440 | 1:13 AM | 🔵 | Comprehensive Analysis of Settings and Hard-Coded Limit | ~389 |
|
||||
| #37435 | " | 🔵 | Settings Validation Limits CLAUDE_MEM_CONTEXT_OBSERVATIONS to 1-200 | ~307 |
|
||||
| #37421 | 1:06 AM | 🔵 | Identified by-file API endpoint usage across codebase | ~406 |
|
||||
| #37408 | 12:58 AM | 🔵 | SearchRoutes API Architecture with Worktree Support | ~543 |
|
||||
| #37391 | 12:48 AM | ✅ | Staged 23 CLAUDE.md files with mix of new and modified content | ~400 |
|
||||
| #37390 | 12:47 AM | ✅ | Regenerated 23 CLAUDE.md files in budapest workspace | ~365 |
|
||||
|
||||
**SearchRoutes.ts**
|
||||
| ID | Time | T | Title | Read |
|
||||
|----|------|---|-------|------|
|
||||
| #38076 | 9:53 PM | 🟣 | Worktree-Aware Project Filtering for Unified Timeline Context | ~578 |
|
||||
| #38072 | 9:52 PM | ✅ | Worktree Support Added to Context Injection API | ~526 |
|
||||
### Jan 7, 2026
|
||||
|
||||
**SessionRoutes.ts**
|
||||
| ID | Time | T | Title | Read |
|
||||
|----|------|---|-------|------|
|
||||
| #37999 | 9:02 PM | 🔵 | getWorkerHost and getWorkerPort used in 18 files across codebase | ~282 |
|
||||
| #37758 | 6:25 PM | ⚖️ | Integration Test Design for Four Critical Testing Gaps | ~729 |
|
||||
|
||||
**SettingsRoutes.ts**
|
||||
| ID | Time | T | Title | Read |
|
||||
|----|------|---|-------|------|
|
||||
| #37997 | 9:01 PM | 🔵 | SettingsRoutes validation pattern for CLAUDE_MEM_WORKER_HOST | ~320 |
|
||||
| #37995 | " | 🔵 | CLAUDE_MEM_WORKER_HOST setting implementation pattern | ~304 |
|
||||
| #37990 | 9:00 PM | 🔵 | CLAUDE_MEM_WORKER_HOST setting used across 19 files | ~289 |
|
||||
| #37665 | 5:52 PM | 🔵 | Codebase uses dependency injection and lazy initialization patterns to avoid circular dependencies | ~548 |
|
||||
| #37651 | 5:50 PM | 🔵 | SettingsRoutes uses both logger and SettingsDefaultsManager creating circular dependency exposure | ~404 |
|
||||
| #37592 | 4:56 PM | ✅ | Phase 3 Anti-Pattern Check Complete - Clean Implementation | ~434 |
|
||||
| #37548 | 4:48 PM | ✅ | Issue #543 Analysis Report Created for Slash Command Availability | ~540 |
|
||||
| #37547 | 4:47 PM | ✅ | Issue #557 Analysis Report Created for Plugin Startup Failure | ~491 |
|
||||
| #37543 | " | 🔵 | Settings File Auto-Creation Logic Found in SettingsRoutes | ~463 |
|
||||
| #38467 | 10:29 PM | ⚖️ | Log Level Audit Strategy: Tighten ERROR Messages for Runtime Issue Discovery | ~464 |
|
||||
| #38456 | 10:26 PM | 🔵 | happyPathError Inline Fallback: Missing CWD When Queueing Observations | ~463 |
|
||||
| #38453 | " | 🔵 | Generator Exit Patterns: Distinguishing Aborts from Unexpected Failures | ~454 |
|
||||
| #38437 | 10:24 PM | 🔵 | Claude-mem core functionality and logging patterns identified | ~710 |
|
||||
| #38431 | " | 🔵 | ERROR-Level Logging Used Across 21 Source Files | ~480 |
|
||||
| #38405 | 10:07 PM | ⚖️ | DEBUG Log Level Analysis - One Message Requires WARN Promotion | ~819 |
|
||||
| #38404 | 10:06 PM | ⚖️ | Log Level Audit Analysis - WARN to ERROR Promotion Criteria Established | ~769 |
|
||||
| #38372 | 9:43 PM | 🔵 | Logging Anti-Pattern Found: Critical Errors Logged as DEBUG Instead of ERROR | ~464 |
|
||||
| #38356 | 9:16 PM | 🔴 | Fixed AbortController Leak During Crash Recovery | ~384 |
|
||||
| #38354 | 9:10 PM | 🔵 | Provider Selection Architecture and Default Settings Location | ~478 |
|
||||
| #38351 | 9:09 PM | 🔵 | AbortController Replacement Without Abort Confirmed at Line 191 | ~434 |
|
||||
</claude-mem-context>
|
||||
@@ -150,7 +150,7 @@ export class SessionRoutes extends BaseRouteHandler {
|
||||
try {
|
||||
const failedCount = pendingStore.markSessionMessagesFailed(session.sessionDbId);
|
||||
if (failedCount > 0) {
|
||||
logger.warn('SESSION', `Marked messages as failed after generator error`, {
|
||||
logger.error('SESSION', `Marked messages as failed after generator error`, {
|
||||
sessionId: session.sessionDbId,
|
||||
failedCount
|
||||
});
|
||||
@@ -168,7 +168,7 @@ export class SessionRoutes extends BaseRouteHandler {
|
||||
if (wasAborted) {
|
||||
logger.info('SESSION', `Generator aborted`, { sessionId: sessionDbId });
|
||||
} else {
|
||||
logger.warn('SESSION', `Generator exited unexpectedly`, { sessionId: sessionDbId });
|
||||
logger.error('SESSION', `Generator exited unexpectedly`, { sessionId: sessionDbId });
|
||||
}
|
||||
|
||||
session.generatorPromise = null;
|
||||
@@ -187,8 +187,10 @@ export class SessionRoutes extends BaseRouteHandler {
|
||||
pendingCount
|
||||
});
|
||||
|
||||
// Create new AbortController for the restarted generator
|
||||
// Abort OLD controller before replacing to prevent child process leaks
|
||||
const oldController = session.abortController;
|
||||
session.abortController = new AbortController();
|
||||
oldController.abort();
|
||||
|
||||
// Small delay before restart
|
||||
setTimeout(() => {
|
||||
@@ -282,7 +284,7 @@ export class SessionRoutes extends BaseRouteHandler {
|
||||
prompt: truncatedPrompt
|
||||
});
|
||||
}).catch((error) => {
|
||||
logger.warn('CHROMA', 'User prompt sync failed, continuing without vector search', {
|
||||
logger.error('CHROMA', 'User prompt sync failed, continuing without vector search', {
|
||||
promptId: latestPrompt.id,
|
||||
prompt: promptText.length > 60 ? promptText.substring(0, 60) + '...' : promptText
|
||||
}, error);
|
||||
@@ -466,13 +468,13 @@ export class SessionRoutes extends BaseRouteHandler {
|
||||
tool_input: cleanedToolInput,
|
||||
tool_response: cleanedToolResponse,
|
||||
prompt_number: promptNumber,
|
||||
cwd: cwd || logger.happyPathError(
|
||||
'SESSION',
|
||||
'Missing cwd when queueing observation in SessionRoutes',
|
||||
{ sessionId: sessionDbId },
|
||||
{ tool_name },
|
||||
''
|
||||
)
|
||||
cwd: cwd || (() => {
|
||||
logger.error('SESSION', 'Missing cwd when queueing observation in SessionRoutes', {
|
||||
sessionId: sessionDbId,
|
||||
tool_name
|
||||
});
|
||||
return '';
|
||||
})()
|
||||
});
|
||||
|
||||
// Ensure SDK agent is running
|
||||
|
||||
Reference in New Issue
Block a user