Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
ebfc315
fix(mcpl): contain inbound request handler failures
Oct 2, 2026
1a4fbd9
fix(mcpl): enforce a single response attempt inside handlers
Oct 2, 2026
c5b1217
fix(mcpl): distinguish response encoding failures from writes
Oct 2, 2026
b31b7fc
fix(mcpl): contain malformed inbound lines and sync dispatch faults
Oct 2, 2026
549018d
Merge remote-tracking branch 'origin/main' into fix/186-mcpl-request-…
Oct 2, 2026
1ad5576
test(mcpl): pin the containment pieces no test reached
Oct 9, 2026
03f043c
test(mcpl): pin the Object.hasOwn half of the method lookup
Oct 9, 2026
c4f1f1a
fix(mcpl): report a handler's own failure, never let a report end the…
Oct 11, 2026
be01bd4
fix(mcpl): a failed report still names the failure; log text replaces…
Oct 11, 2026
b6495cd
Merge main into fix/186-mcpl-request-rejections
Oct 16, 2026
f7652ed
fix(mcpl): #208's log lines print a server's and a handler's text thr…
Oct 15, 2026
d45f230
fix(mcpl): a failed internal-error reply is reported once, not also a…
Oct 15, 2026
b41fbf4
fix(mcpl): a handler failure's trace fields are bounded, and its log …
Oct 15, 2026
cc010f9
test(mcpl): the -32601 and dispatch-failure log lines are asserted
Oct 16, 2026
7a8c963
fix(mcpl): the request forms of manifestChanged and tools/list_change…
Oct 16, 2026
87bdf5c
fix(mcpl): the handler-failure trace keeps only a string or number re…
Oct 16, 2026
e368e4c
docs(changelog): #208's note describes the change from 0.22.x (R1-1)
Oct 16, 2026
129de6b
fix(mcpl): an initialize error whose message has no string form refus…
Oct 16, 2026
f26a450
fix(mcpl): the R1 round's texts say what the code does; an initialize…
Oct 16, 2026
3c7efa2
docs(changelog): the six handlers' reply text is a Changed entry
Oct 16, 2026
b838f09
Merge main (#384, #399) into #208's branch
Oct 16, 2026
8051b24
fix(mcpl): an error answer settles its request, and manifest re-runs …
Oct 17, 2026
d9560ab
test(mcpl): pin what a handler that answers its own failure sends
Oct 17, 2026
01ed39b
fix(mcpl): a reply counts once its write returns; drop the encoding-f…
Oct 17, 2026
5c04e14
test(mcpl): pin the report's fallback, for a trace listener whose thr…
Oct 17, 2026
f6675c4
fix(mcpl): a trace listener's error can't stop emitTrace, so the repo…
Oct 17, 2026
22b593f
test(mcpl): the failed-generation test's framework has its trace list…
Oct 17, 2026
224d9aa
fix(mcpl): the report converts a second answer's code; the tools/list…
Oct 17, 2026
b8c1ca4
fix(mcpl): a backstop logs a throw out of the async report on a line …
Oct 17, 2026
4773c63
fix(mcpl): the backstop's line is printed through log-value and can't…
Oct 17, 2026
30e6965
test(mcpl): the result-write test's fake inference returns the shared…
Oct 17, 2026
6298460
Merge main (3af13bf4) into #208's branch: #286's drained writes, #450…
Oct 17, 2026
d094e65
Merge main (e6703634) into fix/186-mcpl-request-rejections: trains fi…
Oct 18, 2026
ef682d0
docs(changelog): leave the awareness gate's failure out of the Fixed …
Oct 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/208-handler-failure-replies.changed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- **MCPL server authors:** when the host's handler for a server's request throws or rejects before it has answered, the server's answer no longer carries the handler's own message (#208). 0.22.x answered such a failure of a `push/event`, `inference/request`, `channels/register`, `channels/changed`, `channels/incoming` or `host/command` handler with `-32603` and the handler's message, or, once the host was stopping, with `-32000` and "the host stopped while handling this request" followed by the handler's message in parentheses. These requests now get `-32603` "Internal error", or, while the host is stopping, `-32000` "the host stopped while handling this request" alone. A handler's message can name the host's internal paths and errors, and the server may be a third party's. A server that shows or parses the handler's text from these replies no longer receives it: the host writes it to stderr and to its `mcpl:request-handler-error` trace instead. A handler that answers a failure itself still sends its own code and message, as before: `inference/request` when the inference fails, and `push/event` when a coalesced push fails.
11 changes: 11 additions & 0 deletions changelog.d/208-inbound-handler-containment.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
- MCPL's inbound handlers are contained at one boundary, the framework's wiring, for every request and notification it handles (#186). The `channels/list`, `tools/observe` and `model/info` requests and the `notifications/tools/list_changed` notification are newly contained: a throw or rejection of theirs is reported as the other handlers' are. `mcpl/manifestChanged` goes through the same boundary, and so does a refresh its handler schedules for later, after the fetch floor or behind a fetch in flight: a manifest fetch that fails is still caught and logged inside the handler, as in 0.22.x, and anything else the handler throws or rejects with is now reported as the others' are. 0.22.x logged that from an announcement's own run, and dropped it from a scheduled re-run. The six requests whose handler failures 0.22.0 already answered (`push/event`, `inference/request`, `channels/register`, `channels/changed`, `channels/incoming` and `host/command`) go through the same boundary now. On a connection the framework wires, no handler's throw or rejection ends the host, and a rejection reason that can't be printed is reported as one that can.
- **A request whose handler fails is answered `-32603` "Internal error",** or, while the host is stopping, `-32000` "the host stopped while handling this request". The handler's error stays in the trace and on stderr. For the six that 0.22.x answered with the handler's own message, that's a change, described under Changed. A request is answered this way when its handler fails without having written a reply, which includes a reply whose write threw, such as one that can't be encoded. A notification gets no reply.
- **Each failure emits a new trace, `mcpl:request-handler-error`, and a stderr line.** Its `error` is the handler's own error, or, for a handler that resolved, the reply write it swallowed, or a note that it tried to answer a second time. A reply write that failed before it is `responseFailure`, and a reply the handler tried to send after one was already attempted is `refusedResponse` (a result, or an error with its code and message): refused, never written. `responseError` is the internal-error reply's own failure, which the stderr line prints too. `requestId` is the request's id when that is a number, and a string id bounded as the trace's other texts are. A request form of `mcpl/manifestChanged` or `notifications/tools/list_changed` has none, since it's answered as it's admitted and then handled as the notification is.
- **A request whose method isn't a string,** or isn't one the host handles, or whose event nothing on the host listens for, is answered `-32601` "Method not found", with a stderr line. A notification nobody handles is ignored.
- **`mcpl/manifestChanged` and `notifications/tools/list_changed` sent as requests,** with an id, are answered with an empty result when the connection admits them, which waits while their plane is paused, if something on the host listens for them, as the framework's wiring always does, and are handled as the notification is.
- **Non-object JSON** (`null`, `42`, `"hi"`, `true`) is ignored before property access, in the handshake reader and in routing, as a non-JSON line already is. One such line from a server used to end the host (#217).
- **An `initialize` error whose `message` has no string form,** such as `{"toString":1}`, refuses the connect, with `initialize error: [object Object]`. 0.22.x converted that message after the handshake had stopped listening and cleared its timeout, so the conversion's throw escaped as an uncaught exception, which ends a host that doesn't catch them, and the connect never settled.
- **An error answer to a request the host sent,** such as its manifest fetch, settles that request whatever its `code` and `message` are. 0.22.x's conversion of them threw out of the transport's line listener in the same way.
- **A server's text in these errors is bounded:** in an `initialize` error's message and in an error answer's code and message, control, format and line-separator characters become `?`, and each is cut after 200 code points, with `…` marking the cut.
- **A synchronous failure while dispatching an inbound message**, buffered plane flushes and a server's stderr lines included, is reported without interrupting later messages. Its `mcpl:server-error` names the event or method, the request id, and the cause.
- A trace listener that throws a value `console.error` can't print, such as one whose `util.inspect.custom` throws, no longer keeps the listeners after it from getting the event, or throws out at the code that emitted it: its error is printed as text instead.
Loading
Loading