Conversation
cl0ud08
marked this pull request as ready for review
August 29, 2026 08:52
Member
|
Thank you for implementing stats() in both clients and adding focused tests. The Python and TypeScript suites pass, but DCO fails because commit 355f714 does not contain your Signed-off-by trailer. Please amend and sign off that commit yourself, rebase onto current main, and force-push the updated branch; we will rerun exact-head CI and review after that. |
This branch has not been deployed
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
Adds
stats()to the Python and TypeScript clients, wrappingGET /api/v1/stats. Returns a newStatsmodel/interface exposingtenant_count,memory_count,agent_count, plus the raw payload on.raw.Related Issue
Closes #552.
Type of Change
How Has This Been Tested?
pytestinclients/python: 138 passed. The 7 failures intest_interviewer_installer.py/test_interviewer_platform.pyare POSIX-only (fcntl, chmod semantics) and reproduce identically on unmodifiedmainon Windows.npm testinclients/typescript: 17/17 pass;tsccompiles clean.0, and a 503 raisingCauraAPIErrorwith the right status code.Checklist
ruff checkandruff format --checkpass — see tooling note belowmypypasses — see tooling note belowpytestpasses locallyCHANGELOG.mdunder theUnreleasedsection (if user-facing)Additional Notes
The issue describes query params (
scope,memory_type,status,fleet_id,include_deleted) that don't exist on the route —public_stats()incore-api/src/core_api/routes/stats.pyhas an empty signature. Implemented as a no-arg method matching the route as it stands; flagged this on the issue before starting.Two deliberate choices, both easy to reverse:
count_all(tenant_id="")), not scoped totenant_idlike every other client method. Called out explicitly in both docstrings and both READMEs so nobody misreadsmemory_countas their own tenant's count.stats()calls_raise_for_status()althoughhealth()deliberately doesn't. A wrongbase_urlor a deployment predating this route returns non-2xx, and a bare.json()would surface aValueErrorinstead of aCauraAPIError.Tests mock the exact response shape emitted by
stats.pyrather than an assumed one.CHANGELOG: not edited — it's release-please-generated with no
Unreleasedsection. The commit message is a conventional commit, so the entry should generate on release. Happy to add one manually if that's wrong.Tooling notes, both pre-existing and unrelated to this change:
ruff checkpasses clean.ruff format --checkreports 11 files, includingtests/test_client.py— all are already unformatted onmain, verified by checking out upstream's copy and re-running. Not reformatted here to keep the diff scoped; happy to do it as a separate PR.mypypasses on every file this PR touches. It reports 3 errors ininterviewer/cli.py(fcntl.flock/LOCK_EX/LOCK_NB), which are Windows-only — that file is untouched here and errors identically on upstream's version.