Skip to content

feat(mcp): keep a local tool latency log and show p50/p90 in status - #5022

Merged
RaghavChamadiya merged 1 commit into
repowise-dev:mainfrom
Asymtode712:feat/latency-log-for-local-tool
Nov 8, 2026
Merged

RaghavChamadiya merged 1 commit into
repowise-dev:mainfrom
Asymtode712:feat/latency-log-for-local-tool

Conversation

@Asymtode712

Copy link
Copy Markdown
Contributor

Summary

  • Each MCP tool call appends {"tool", "ms", "cold"} to <repo>/.repowise/mcp_calls.jsonl (skipped when .repowise/ is absent). The file is trimmed to the last 2500 lines once it passes 5000, and a write failure never fails the tool call.
  • repowise status prints p50 and p90 per tool from the log, and nothing when the file is absent.
  • Tool results and the anonymous telemetry payload are unchanged. The log stays on the machine.

Related Issues

Fixes #5000

Test Plan

  • Tests pass (pytest tests/unit/server/mcp/test_mcp_latency_log.py tests/unit/cli/test_status_storage.py tests/unit/server/mcp/test_tool_telemetry.py)
  • Lint passes (ruff check .)
  • Web build passes (npm run build) (if frontend changes) — N/A

Checklist

  • My code follows the project's code style
  • I have added tests for new functionality
  • All existing tests still pass
  • I have updated documentation if needed — N/A

@repowise-bot

repowise-bot Bot commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Looks safe to merge: no open points, no breaking contract change found, a test imports every changed code file.

Reviewed the whole diff: nothing to fix.

The wrapper's documented role is savings measurement (inv_01), and this change also makes it append a latency record to a file on each call.

✅ Health of changed files: 3.5 → 4.1 (+0.6; structure +0.5) Average full file score (structure and history) of 5 changed code files, weighted by size before this PR; not the repository score.

👀 Suggested reviewers RaghavChamadiya


View on Repowise
Plain markdown for agents · Reviews (1) · Last reviewed commit: feat(mcp): keep a local tool latency log and show p50/p90 in status

Settings and updates

Blast radius, every caller of the contracts it changes, and health before and after. No sign-in.
Updated 2026-10-30 11:26 UTC
Silence one PR with [skip repowise] in the title · Bot settings
/repowise recheck reviews the current head again
/repowise review deep runs the deep review on it
/repowise help lists the commands
⭐ Star Repowise · 📥 Install on another repo

@Asymtode712

Copy link
Copy Markdown
Contributor Author

@RaghavChamadiya It's being a while since this PR is opened, could you please review this one

@RaghavChamadiya RaghavChamadiya left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @Asymtode712. The trim keeps the log bounded, a write failure never reaches the tool call, and nothing is written without a .repowise/ directory.

@RaghavChamadiya
RaghavChamadiya merged commit 64a029d into repowise-dev:main Nov 8, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Keep a local log of MCP tool latency and show p50 and p90 per tool in repowise status

2 participants