From 1f3595b35d0ae3d722ee17eb1c633af3f5dceb93 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 29 Jul 2026 15:24:42 +0800 Subject: [PATCH] cabi: parse ChannelDef from a3 in CORE_REGISTER_OUTPUT_CH; embed sdk example/qq fix --- internal/plugin/cabi/loader.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/internal/plugin/cabi/loader.go b/internal/plugin/cabi/loader.go index c08b943..7a44e07 100644 --- a/internal/plugin/cabi/loader.go +++ b/internal/plugin/cabi/loader.go @@ -320,7 +320,14 @@ func go_core_dispatch(methodID C.int, ctx unsafe.Pointer, s1, s2, s3 *C.char, i1 case 3: // CORE_REGISTER_OUTPUT_CH pid := pluginID chName := a1 - s.RegisterOutputChannel(chName, n1, a2, sdk.ChannelDef{}, func(args map[string]interface{}) (interface{}, error) { + chDef := sdk.ChannelDef{} + if a3 != "" { + var def sdk.ChannelDef + if err := json.Unmarshal([]byte(a3), &def); err == nil { + chDef = def + } + } + s.RegisterOutputChannel(chName, n1, a2, chDef, func(args map[string]interface{}) (interface{}, error) { // Output is async: return immediately, send in background // to avoid nested cgo calls (cgo within cgo can crash) go func() {