refactor: clean AI slop (-1886 lines) and fix 5 P0 capability gaps#70
Merged
Merged
Conversation
Slop cleanup (-1,847 lines): - Delete 8 dead code files (models_dev, checkpoints, rate_limit_tracker, subdirectory_hints, prompt_caching, display, redact, rate_limit_tracker_test) - Remove dead functions: loadResumedHistory, fireToolGenStarted, SetupFromEnv, ProbeContextLength, hasStreamingCallbacks, termWidth, hexToRGB, min, etc. - Replace custom stdlib reimplementations with strings.Contains, builtin min - Consolidate splitMessage in dmwork.go to use platforms.SplitMessage - Delete empty content filter hook and containsIgnoreCase - Remove dead currentBlockType variable and _ = strings.Contains workaround - Unexport internal helpers (defaultStatePath, parseRetryAfter, strategyFromConfig) - Fix writeToLogFile to use config.HermesHome() instead of hardcoded path - Fix MCP RefreshTools deadlock (called DiscoverTools while holding mutex) - Simplify resolveTools() signature (removed unused parameters) P0 capability gaps fixed: - Wire resolveTools() to toolsets package with enabled/disabled support - Add context file injection scanning (10 threat patterns + invisible Unicode) - Implement secret redaction (23 regex patterns) wired into agent loop - Add Anthropic prompt caching for last 3 messages (~75% input cost reduction) - Make vision_analyze call multimodal LLM with image data (base64/URL) - Add ImageURLs multimodal support to llm.Message and OpenAI client
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
RefreshToolscalledDiscoverToolswhile holding mutex — would deadlock on SSE tool change notificationsSlop Cleanup
strings.Contains, builtinminsplitMessageduplication in dmwork.gocontainsIgnoreCasewriteToLogFileto useconfig.HermesHome()instead of hardcoded~/.hermes/logsP0 Capability Gaps Fixed
resolveTools()hardcodedtoolsets.ResolveMultipleToolsets()with enabled/disabled supportscanContextContent()with 10 threat patterns + invisible Unicode detectioncache_controlto last 3 messages (~75% input cost reduction)vision_analyzestubTest plan
go build ./...passesgo vet ./...cleanmake test— all 14 packages passcontext_refs_test.go(25 tests),redact_test.go(13 tests)