Keep a machine's discovery answer under the bus's message limit
Every tool's schema in one $SRV.INFO reply outgrew max_payload on machines serving 137-206 tools, and the refused reply was dropped silently, so search and a machine's view went empty. Module tools now announce without schema; describe and tools/list ask the module for it. An answer still too large has its descriptions cut to a line, and a failed reply is logged.
This commit is contained in:
@@ -74,9 +74,17 @@ func TestTheRuntimeAnnouncesWhatItServesInTheServicesProtocol(t *testing.T) {
|
||||
t.Errorf("announced:\n%s\nwant:\n%s", s, want)
|
||||
}
|
||||
for _, e := range got.Endpoints {
|
||||
if e.Metadata["node"] != "anchor" || e.Metadata["description"] == "" || !json.Valid([]byte(e.Metadata["schema"])) {
|
||||
if e.Metadata["node"] != "anchor" || e.Metadata["description"] == "" {
|
||||
t.Errorf("endpoint metadata: %+v", e)
|
||||
}
|
||||
// A seat's verb carries its schema; a module's tool does not — it outgrew the bus (2026-10-04).
|
||||
_, hasSchema := e.Metadata["schema"]
|
||||
if e.Metadata["kind"] == "seat" && !json.Valid([]byte(e.Metadata["schema"])) {
|
||||
t.Errorf("a seat's verb without a schema: %+v", e)
|
||||
}
|
||||
if e.Metadata["kind"] == "tool" && hasSchema {
|
||||
t.Errorf("a module's tool still announces its schema: %+v", e)
|
||||
}
|
||||
}
|
||||
|
||||
// Every subject announced is answered.
|
||||
|
||||
Reference in New Issue
Block a user