Repository navigation
Conversation
Signed-off-by: lorenzozanee <wyz0707@proton.me>
DeusData
left a comment
There was a problem hiding this comment.
Thank you, @lorenzozanee. Splitting handler time from serialization time is exactly the visibility #965 needs. We also appreciate you being upfront that the 180 s Windows delay itself wasn't reproduced, and that this wasn't run on Windows or CI.
Could you split this into two PRs?
-
Timing and transport fields (
handler_duration_ms,response_serialization_ms,cancelled,timed_out): an easy yes. -
Behaviour changes that clients depend on need a separate maintainer decision:
- rejecting requests without
"jsonrpc": this inverts the existing contract testjsonrpc_parse_missing_jsonrpc_field, which pinned the lenient default; - rejecting
nullor float ids; - dropping
"result":null; - exiting the stdio server on a missing response or on poll/fcntl errors, including the removed blocking-poll fallback;
- the new HTTP 500 path.
A handler that returns NULL currently ends the whole session instead of producing an error reply, and that alone is a big change in how failures behave.
- rejecting requests without
A few mechanical items for the timing PR:
- Memory-core ratchet:
src/ui/http_server.cgoes from 31 to 32 raw allocator calls (the newfree(error_response)), and its baseline is 31, solint-memory-corewill fail. Please use themem_corewrappers. - Log coverage: the
cbm_log_mcp_requestassertions were removed fromtests/test_log.c. Please keep them, or name the test that now covers the same contract. - macOS skip:
mcp_server_run_reports_input_failureis skipped on macOS as "Unix-specific", but macOS is Unix. Could it run there, or could the skip say what actually fails?
Thanks again. The timing half will help a lot with diagnosing slow sessions.
|
Thanks for opening this — it has been seen, and it is queued. This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence. Current review status: working through a backlog. What that means for this PR, concretely:
Things that will genuinely speed it up whenever review does happen:
If this fixes a bug, a reproduction we can run is worth more than a description of the symptom. Thanks for contributing, and sorry in advance for the wait. |
|
Thanks again for the request-timing diagnostics. The earlier split request still stands: timing/transport fields can be reviewed separately from the JSON-RPC and session behavior changes. The latter require a maintainer decision; please let us know if that boundary needs clarification. |
|
Thanks again for the timing diagnostics. The requested split still separates timing/transport reporting from JSON-RPC and session behavior changes. The latter need our decision; sorry for the delay on that, and I’ll follow up soon. |
Split the PR along the line the review asked for. The request timing and transport fields stay: every mcp.request log line carries handler_duration_ms, response_serialization_ms, cancelled and timed_out, and a search that reaches its deadline logs status=timeout. The behaviour changes go back to the base text and need a separate maintainer decision: stricter jsonrpc/id parsing, dropping "result":null, NULL returns from the response formatters, leaving the stdio loop on a missing response or an input/output failure, the removed blocking-poll fallback, the HTTP 500 path, the daemon session end on a missing response, and the update-notice warning. Their tests go with them. The list_projects sort guard is dropped as well (main has the same fix). cbm_mcp_server_handle formats its three responses with cbm_jsonrpc_format_response directly; a NULL reply still marks the request as an error. The cbm_log_mcp_request checks in tests/test_log.c are back with the new signature, plus checks for the new fields and for status=timeout. clang-format on the new lines. Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com> # Conflicts: # src/mcp/mcp.c
|
Thank you so much, @lorenzozanee, for this work and for your patience while it waited on us. Splitting handler time from serialization time, and flagging cancelled and timed-out requests, is exactly the visibility #965 asked for. Your tests that keep tool arguments and project names out of the log lines are a really nice touch. Since the branch allows maintainer edits, we did the split from the earlier review ourselves so the timing half can land now. On top of your commit we:
Please pull before pushing again, since the branch now has our commits on top. Thanks again: the timing half will make slow sessions much easier to diagnose. |
|
Merged as 69b26df - thank you so much, @lorenzozanee! Every mcp.request log line now carries handler_duration_ms, response_serialization_ms, cancelled and timed_out, so a slow call shows right away whether the time went to the handler or to the reply. Your tests that keep tool arguments and project names out of those lines are a great touch. The protocol-behaviour half stays in your original commit 6f17caa for its own decision, as explained above. Thank you for your patience. |
What does this PR do?
MCP request logs now separate handler and response serialization time and report cancellation or timeout. Malformed responses and failed input or output paths are surfaced as errors; this does not claim to resolve the reported 180-second Windows delay, which was not reproduced.
Focused validation:
make -f Makefile.cbm test-focused TEST_SUITES="mcp log daemon_application httpd"(462 passed, 5 skipped).scripts/lint.sh --cistopped becausecppcheckis unavailable; Windows and upstream CI remain unverified.Prepared with AI assistance for the submitting account owner.
Fixes #965