Merge branch 'v2/main' into v2/fix/1909-salvage-malformed-list-items
This commit is contained in:
commit
166e0a9444
2 changed files with 154 additions and 4 deletions
|
|
@ -1976,8 +1976,23 @@ export class InspectorClient extends InspectorClientEventTarget {
|
|||
// capabilities and wipe tools/prompts/resources to empty on every connect.
|
||||
await this.fetchServerInfo();
|
||||
|
||||
// Set initial logging level if configured and server supports it
|
||||
if (this.initialLoggingLevel && this.capabilities?.logging) {
|
||||
// Set initial logging level if configured and server supports it.
|
||||
//
|
||||
// Era-gated (#1990): `logging/setLevel` is a legacy-era method, and the
|
||||
// modern wire era rejects it outright — so an unconditional call here
|
||||
// failed the *connect* of every modern server advertising `logging`,
|
||||
// taking down commands that have nothing to do with logging. Modern has
|
||||
// no session-scoped level at all: the equivalent is the per-request
|
||||
// `io.modelcontextprotocol/logLevel` `_meta` opt-in, which
|
||||
// `modernLogLevel` already drives from the server settings (see
|
||||
// {@link setModernLogLevel}). So the right behavior on modern is to skip
|
||||
// this call rather than translate it — `initialLoggingLevel` names a
|
||||
// mechanism that era does not have.
|
||||
if (
|
||||
this.initialLoggingLevel &&
|
||||
this.capabilities?.logging &&
|
||||
this.protocolEra !== "modern"
|
||||
) {
|
||||
await this.client.setLoggingLevel(
|
||||
this.initialLoggingLevel,
|
||||
this.getRequestOptions(),
|
||||
|
|
|
|||
|
|
@ -919,8 +919,16 @@ export interface InspectorClientOptions {
|
|||
pipeStderr?: boolean;
|
||||
|
||||
/**
|
||||
* Initial logging level to set after connection (if server supports logging)
|
||||
* If not provided, logging level will not be set automatically
|
||||
* Initial logging level to set after connection, via `logging/setLevel`.
|
||||
* If not provided, the logging level will not be set automatically.
|
||||
*
|
||||
* **Legacy era only (#1990).** `logging/setLevel` is a legacy-era method, and
|
||||
* the modern (2026-07-28) era rejects it — so this option is ignored on a
|
||||
* modern connection even when the server advertises `logging`. Modern has no
|
||||
* session-scoped level at all: the equivalent is the per-request
|
||||
* `io.modelcontextprotocol/logLevel` `_meta` opt-in, configured through the
|
||||
* `modernLogLevel` server setting and applied via
|
||||
* `InspectorClient.setModernLogLevel()`.
|
||||
*/
|
||||
initialLoggingLevel?: LoggingLevel;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue