From 49ea5c96e390c20e1a27a4a7f0a3210732a58bbd Mon Sep 17 00:00:00 2001 From: jochen Date: Wed, 28 Oct 2026 22:07:05 +0100 Subject: [PATCH] Assigner: serve the seat mesh-placement's verbs as ., the name the tool runner serves a seat's verb from (issue 1126) --- .../cmd/mesh-delivery-assigner/seat_tools.go | 5 +++-- .../cmd/mesh-delivery-assigner/seat_tools_test.go | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/mesh-delivery-assigner/cmd/mesh-delivery-assigner/seat_tools.go b/modules/mesh-delivery-assigner/cmd/mesh-delivery-assigner/seat_tools.go index 3c7e708..b599301 100644 --- a/modules/mesh-delivery-assigner/cmd/mesh-delivery-assigner/seat_tools.go +++ b/modules/mesh-delivery-assigner/cmd/mesh-delivery-assigner/seat_tools.go @@ -507,7 +507,8 @@ func (s *seatTools) doProposals(args map[string]any) (any, error) { return map[string]any{"proposals": out}, nil } -// tools are the seat's verbs as the runtime serves them, under the seat's verb names, with the seat's own schemas. +// tools are the seat's verbs as the runtime serves them, each named . (the tool runner serves a seat's verb +// only from a tool of that name), with the seat's own schemas. func (s *seatTools) tools() []stdio.Tool { seat, _ := catalogue.SeatNamed(catalogue.PlacementSeat) input := map[string]map[string]any{} @@ -526,7 +527,7 @@ func (s *seatTools) tools() []stdio.Tool { } var out []stdio.Tool for _, v := range seat.Serves { - out = append(out, stdio.Tool{Name: v.Name, Description: description[v.Name], Input: input[v.Name], Run: run[v.Name]}) + out = append(out, stdio.Tool{Name: catalogue.PlacementSeat + "." + v.Name, Description: description[v.Name], Input: input[v.Name], Run: run[v.Name]}) } return out } diff --git a/modules/mesh-delivery-assigner/cmd/mesh-delivery-assigner/seat_tools_test.go b/modules/mesh-delivery-assigner/cmd/mesh-delivery-assigner/seat_tools_test.go index 1594f62..fb22c73 100644 --- a/modules/mesh-delivery-assigner/cmd/mesh-delivery-assigner/seat_tools_test.go +++ b/modules/mesh-delivery-assigner/cmd/mesh-delivery-assigner/seat_tools_test.go @@ -142,7 +142,7 @@ func TestTheSeatsVerbs(t *testing.T) { if hb := got.(proposed).Proposal; err != nil || !hb.HandBack || hb.Base["anchor"] != uint64(len(raw)) || len(st[delivery.PlacementState].values) != 1 { t.Errorf("hand-back = %+v, %v", got, err) } - if tools := s.tools(); len(tools) != 7 || tools[2].Name != catalogue.PlacementVerbPropose || tools[2].Run == nil || tools[2].Input == nil { + if tools := s.tools(); len(tools) != 7 || tools[2].Name != "mesh-placement.propose" || tools[2].Run == nil || tools[2].Input == nil { t.Errorf("the seat's verbs as served: %+v", tools) } } -- 2.54.0