perf(clients): bound routine queries by default#37
Merged
Conversation
Signed-off-by: Shawn Stratton <shawn.stratton@mface.net>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates sting’s default behavior to cap routine queries at 100 commits (while preserving 0 as “unlimited”), and reduces upstream pagination/work once the cap is satisfied. It also refines MCP semantics so diff retrieval is explicitly opt-in per call and adds a per-call max_commits override for MCP clients.
Changes:
- Set default
max_commitsto 100 across config, CLI flags, docs, and examples; keep0as the explicit exhaustive-scan escape hatch. - Make MCP
include_diffsdefault tofalsewhen omitted (independent of server config), and add MCPmax_commitsas a per-call override. - Reduce GitHub/GitLab pagination and stop repo/org/group enumeration once the remaining commit budget is exhausted; add regression tests for these behaviors.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Documents the new default cap and clarifies MCP diffs are opt-in. |
| internal/mcpserver/server.go | Adds max_commits to MCP input; makes omitted include_diffs default to false for MCP calls. |
| internal/mcpserver/getcommits_test.go | Adds tests for MCP max-commit override and diffs-default-off behavior. |
| internal/cli/root.go | Changes CLI default --max-commits from unlimited to config.DefaultMaxCommits. |
| internal/cli/cli_test.go | Asserts loaded config defaults include the new default max commits. |
| config/config.go | Introduces DefaultMaxCommits = 100; updates default config and validation. |
| config/config_test.go | Adds validation coverage for negative max_commits. |
| config/resolve.go | Adds per-request MaxCommits override handling and validation. |
| config/resolve_test.go | Adds coverage for default max commits and request override semantics (including explicit 0). |
| config.example.yaml | Updates example config to show the new default max_commits: 100. |
| ghclient/ghclient.go | Bounds page sizes and stops org/repo pagination early once the commit budget is satisfied. |
| ghclient/collect_test.go | Adds regression test ensuring org repo pagination stops once MaxCommits is reached. |
| gitlabclient/gitlabclient.go | Bounds page sizes and stops group/project pagination early once the commit budget is satisfied. |
| gitlabclient/gitlabclient_test.go | Adds regression test ensuring group project pagination stops once MaxCommits is reached. |
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
Why
Routine queries should avoid unnecessary provider requests, rate-limit pressure, and token-heavy MCP output without weakening the exact Truncated result contract.
Testing