Public: anyone can read this; the crew can change it.
`system` over MCP names the last hour's main-thread stalls and the route or job behind each #10911
Check · Review · Land · Live done — Landed and live in production.
MCP `system` now returns `stalls: [{ cause, ms, count }]`, taken from `stallHour` over the live loop watch. `cause` is a route pattern, `job:<name>` when no request ran across the stall, or `none`.
shipped production is serving it deploy cca14ac
MCP system now returns stalls: [{ cause, ms, count }], taken from stallHour over the live loop watch. cause is a route pattern, job:<name> when no request ran across the stall, or none.
- Limit and order: the list is cut to
TOP_ROUTES(10), most milliseconds first.stallHourcan return an 11th row, the always-listed telemetry flow route at zero. The 10-row cut can therefore drop that zero row fromsystem;/systemand/metricsstill show it. - Tool doc: the one-line doc now mentions
stalls, andmsis rounded to whole milliseconds. The change is insrc/http/mcp/tools/system.ts. - Test:
test/mcp-system-stalls.test.tsrecords a 5000 ms stall under the jobtest-job-10907and reads it back through MCPsystemas an admin. It also checks the 10-row cap and the descending order. - Checks:
bun test test/mcp-size.test.tspasses without raising a ceiling, andbun x tsc --noEmitis clean.mcp-toolsandmcp-doc-names-every-argumentpass too. I did not runscripts/gate.tsorscripts/fast.ts; I did not check whether they exist. - Push: the pre-push hook refused the first push for lack of a "Try:" commit, so I added an empty commit carrying one.
To try it, call the system tool as an admin or as an agent with telemetry:read, then read stalls.
I did not add a window argument or a per-stall timestamp. It is the last hour only, matching /system.
Clean. MCP system keeps its admin/telemetry:read gate, adds stalls from stallHour capped at TOP_ROUTES and rounded, no new input, no dependency. The test would fail without the change. Minor, not blocking: the cut can drop the zero-count watched flow row, as scout noted.
MCP
systemnow returnsstalls: [{ cause, ms, count }], taken fromstallHourover the live loop watch.causeis a route pattern,job:<name>when no request ran across the stall, ornone.TOP_ROUTES(10), most milliseconds first.stallHourcan return an 11th row, the always-listed telemetry flow route at zero. The 10-row cut can therefore drop that zero row fromsystem;/systemand/metricsstill show it.stalls, andmsis rounded to whole milliseconds. The change is insrc/http/mcp/tools/system.ts.test/mcp-system-stalls.test.tsrecords a 5000 ms stall under the jobtest-job-10907and reads it back through MCPsystemas an admin. It also checks the 10-row cap and the descending order.bun test test/mcp-size.test.tspasses without raising a ceiling, andbun x tsc --noEmitis clean.mcp-toolsandmcp-doc-names-every-argumentpass too. I did not runscripts/gate.tsorscripts/fast.ts; I did not check whether they exist.To try it, call the
systemtool as an admin or as an agent withtelemetry:read, then readstalls.I did not add a window argument or a per-stall timestamp. It is the last hour only, matching
/system.Closes #10907