fix: address code quality concerns from walkthrough#32
Closed
philoserf wants to merge 5 commits intoagent-ecosystem:mainfrom
Closed
fix: address code quality concerns from walkthrough#32philoserf wants to merge 5 commits intoagent-ecosystem:mainfrom
philoserf wants to merge 5 commits intoagent-ecosystem:mainfrom
Conversation
CheckTokens previously created a new tokenizer.Get(O200kBase) on every call. The encoder is now initialized once at package level via sync.Once and reused across invocations. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Both content/ and links/ defined codeBlockStrip and inlineCodeStrip independently. The content version only handled backtick fences; the links version handled both backticks and tildes. Shared patterns now live in util/ using the more complete tilde-aware version. This is also a correctness fix: content analysis previously did not strip tilde-fenced code blocks, inflating word and sentence counts. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Clone http.DefaultTransport and set MaxIdleConnsPerHost to 10 (default is 2). Cloning preserves existing defaults for TLS timeouts, proxy support, and idle connection management. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add RateLimit field to evaluate.Options (requests per second). Uses a time.Ticker to throttle actual API calls while allowing cache hits to bypass the limiter. Default 0 means unlimited (existing behavior). Applies to both EvaluateSkill and EvaluateSingleFile. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
5c45e06 to
f27c63b
Compare
Contributor
Author
|
Now that I've had some time to steep in the tea, I realize this should have been five PRs. Feel free to reject it. I'll reorg and resubmit. |
Member
|
Hey @philoserf - thanks for taking the time to put this together and think about it! I probably won't get a chance to look deeply into this for the next day or two, but at a quick glance, these seem like good optimizations. I'll spend some more time with this later this week and will likely merge as-is after I've had a chance to dig in. |
Contributor
Author
|
The new smaller pull requests will be easier. |
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
structure/tokens.gonow initializes the tokenizer once viasync.Onceinstead of perCheckTokenscallCodeBlockStrip,InlineCodeStrip, andCodeBlockPatterninutil/regex.go; fixes tilde-fence stripping in content analysisDefaultTransportwithMaxIdleConnsPerHost=10for the link checkerRateLimitfield toevaluate.Optionsusingtime.Ticker; cache hits bypass the limitergo fixandgofumpt -extraTest plan
-race🤖 Generated with Claude Code