✨ feat(agent-management): paginate searchAgent with real totals + wire 8 packages into CI#15448
Merged
Merged
Conversation
…ap notice The searchAgent tool silently clamped limit to 20 with no pagination and reported totalCount as the returned page size, so models (and users) could never discover agents beyond the 20 most recently updated ones. - AgentModel: extract shared where builder, add countAgents (same conditions as queryAgents) - lambda router + client agent service: expose countAgents - server tool runtime & AgentManagerRuntime: pass offset through, report real totals (workspace + marketplace), emit explicit notes when the requested limit is capped and when more pages exist, explain out-of-range offsets instead of claiming no matches - manifest: add offset param, document pagination - agent-manager-runtime: add vitest config + test scripts (suite was previously unrunnable), repair stale store mocks
An audit found 8 packages carrying test:coverage scripts that were never added to the CI PACKAGES allowlist, so their suites never ran: - agent-gateway-client, device-gateway-client, device-identity, eval-dataset-parser: already green, added as-is - eval-rubric, fetch-sse: had no package-level vitest config, so vitest fell back to the root config whose setup/aliases break outside src/ — added minimal configs - heterogeneous-agents: one assertion drifted (labels registry gained amp/hermes/openclaw/opencode) with nobody noticing — updated - agent-manager-runtime: wired in the previous commit All 8 verified locally with the exact CI command (bun run --filter <pkg> test:coverage).
Contributor
There was a problem hiding this comment.
Sorry @AmAzing129, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## canary #15448 +/- ##
=========================================
Coverage 70.87% 70.88%
=========================================
Files 3223 3252 +29
Lines 319680 321863 +2183
Branches 33835 35150 +1315
=========================================
+ Hits 226589 228163 +1574
- Misses 92915 93520 +605
- Partials 176 180 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
…alCount fallback Codecov flagged 3 uncovered lines in the patch: the searchAgents catch block (2 misses) and the totalCount ?? items.length fallback (1 partial). Add the missing failure-path and fallback tests on both execution paths (client AgentManagerRuntime + server tool runtime).
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.
💻 Change Type
🔗 Related Issue
None — driven by a production conversation analysis (
tpc_99aDrZmGT4ln): a user with 281 agents (137 non-virtual) asked the assistant to clean up their agents, and thesearchAgenttool could never see beyond 20 of them while claiming the list was complete.🔀 Description of Change
Commit 1 — searchAgent pagination & honest totals (
lobe-agent-management)The tool silently clamped
limitto 20 (alimit: 50request returned 20 with no signal), had no pagination despite the DB layer supportingoffset, and reportedtotalCountas the returned page length — so the model concluded "20 is the API max" and proposed an incomplete cleanup (7 of the user's actual 19 untitled agents).AgentModel: extract shared where-builder, addcountAgents(same conditions asqueryAgents); newcountAgentsTRPC procedure + client service methodAgentManagerRuntime(both execution paths): passoffsetthrough, report real totals, and append explicit notes:Found 137 agents in your workspace, showing 1-20:instead ofFound 20 agents:call searchAgent with offset=20) when more workspace agents existNo agents at offset 200; only 37 agents match) instead of a false "No agents found"offsetparam (workspace agents only; marketplace stays first-page), pagination documentedSearchAgentState:totalCountnow means the real total; newhasMore/offsetfields (render layer unaffected — it only readsagents)Commit 2 — CI wiring for 8 orphaned package suites
An audit found 8 packages with
test:coveragescripts that were never added to the CIPACKAGESallowlist, so their suites never ran:src/The codecov upload step reuses the same
PACKAGESvariable and probes for lcov files, so no further workflow changes are needed.🧪 How to Test
Tested locally
Added/updated tests
No tests needed
packages/databaseagent model: 114 passed (4 newcountAgentscases)agent-manager-runtime: 29 passed (8 searchAgents cases incl. pagination/cap/out-of-range)New server runtime suite
serverRuntimes/__tests__/agentManagement.test.ts: 9 passedlambda agent router: 12 passed
All 8 CI-wired packages verified with the exact CI command:
bun run --filter <pkg> test:coveragebun run type-check: 53 pre-existing errors on clean canary, 53 on this branch (zero introduced)📝 Additional Information
source: "all"next-page hint directs the model tosource: "user"for pagination.