This commit is contained in:
2026-09-23 17:26:13 +05:30
parent 8e1549764b
commit 697b77f8c1
54 changed files with 5750 additions and 69 deletions

View File

@@ -93,15 +93,6 @@ func StuckOrders(deliveries DeliveryReader, now func() time.Time) Tool {
Default: StuckLookMinutes,
}}},
Handler: func(_ context.Context, req Request) (Result, error) {
// The tenant comes from the verified session, never from an
// argument. There is deliberately no `tenantid` field on the schema
// above: a tool that accepted one would let the model be talked into
// reading somebody else's shop, and the model is the one part of
// this system that can be argued with.
if req.Caller.Tenantid <= 0 {
return Result{}, fmt.Errorf("stuck_orders needs a tenant; staff must pick one first")
}
threshold := req.Int("minutes_waiting")
if threshold <= 0 {
threshold = StuckLookMinutes