Files
DeepSeek-Reasonix/internal/plugin/server_status.go
T
SivanColaanddadgrand 47ecb44df5 fix(doctor): adopt registry regressions and scope MCP aliases
Problem: Skill diagnostics could accept local MCP aliases that runtime
preparation does not bind, or report another plugin's tools as ambiguous.

Root cause: Diagnostic discovery omitted plugin ownership and reconstructed
bindings from display names instead of preserving adapter identities.

Fix: Share the runtime ownership filter, retain canonical adapter bindings,
and preserve plugin discovery metadata. Adapt PR #9686's registered-builtin
and unknown-name regressions with isolated registration. Remove dead code
and use the standard HTTP status constant to satisfy lint.

Verification: Root tests, affected-package race tests, full golangci-lint,
repolint, and whitespace checks pass. Tests exercise real skill preparation,
subagent tool scope, plugin ownership, and prefix-transformed metadata.

Refs #9686

Co-authored-by: dadgrand <[email protected]>
2026-09-08 22:32:26 +08:00

44 lines
1.5 KiB
Go

package plugin
import "reasonix/internal/tool"
// ToolInfo is the human-facing metadata returned by MCP tools/list for one tool.
type ToolInfo struct {
Name string
Description string
ReadOnlyHint bool
DestructiveHint bool
SchemaError string
}
// ServerStatus summarises one connected server for the /mcp command.
type ServerStatus struct {
Name string
Transport string
// ConfigSource is the config plane that registered this server
// (user_config, project_config, workspace, built-in, …). Empty when unknown.
// Surfaced in /mcp status so operators can tell where a tool came from (#6578).
ConfigSource string
Tools int
Prompts int
Resources int
HasTools bool
ToolList []ToolInfo
ToolBindings []tool.MCPBinding `json:"-"`
ProtocolVersion string
SessionState SessionState
SessionIDPresent bool
ReconnectAttempts int
LastErrorKind SessionErrorKind
LastError string
// HostProfile is the client-capability profile this host declares
// ("core-v1", "interactive-v1", "desktop-apps-2026-01-26-v1").
HostProfile string
// ElicitationNegotiated reports that the client declared elicitation and
// the session runs a protocol revision where the server can use it.
ElicitationNegotiated bool
// AppsNegotiated reports two-way MCP Apps agreement: the client declared
// io.modelcontextprotocol/ui and the server answered with the extension.
AppsNegotiated bool
}