coze-dev / coze-dev/coze-studio
插件调用时,数组为空会报错
- Dominant language
- TypeScript
- Stars
- 21.6k
- Forks
- 3.1k
- PR merge metrics
- No merged PRs in 30d
Description
调用插件时,如果有参数为数组,已经设置了允许为空,但是输入为空时依然会报错
```
coze-server | cause=[TryCorrectValueType] value 'images' is not array
coze-server | stack=/app/pkg/errorx/internal/stack.go:84 withStackTraceIfNotExists
coze-server | /app/pkg/errorx/internal/msg.go:49 Wrapf
coze-server | /app/domain/plugin/service/exec_tool.go:65 (*pluginServiceImpl).ExecuteTool
coze-server | /app/domain/plugin/service/exec_tool.go:65 (*pluginServiceImpl).ExecuteTool
coze-server | /app/crossdomain/impl/plugin/plugin.go:92 (*impl).ExecuteTool
coze-server | /app/domain/agent/singleagent/internal/agentflow/node_tool_plugin.go:139 (*pluginInvokableTool).InvokableRun
coze-server | /go/pkg/mod/github.com/cloudwego/eino@v0.4.8/compose/utils.go:107 newRunnablePacker[...].func21
coze-server | /go/pkg/mod/github.com/cloudwego/eino@v0.4.8/compose/runnable.go:236 newRunnablePacker[...].func13
coze-server | /go/pkg/mod/github.com/cloudwego/eino@v0.4.8/compose/tool_node.go:300 runToolCallTaskByStream
coze-server | /go/pkg/mod/github.com/cloudwego/eino@v0.4.8/compose/tool_node.go:300 runToolCallTaskByStream
coze-server | /go/pkg/mod/github.com/cloudwego/eino@v0.4.8/compose/tool_node.go:320 parallelRunToolCall
coze-server | /go/pkg/mod/github.com/cloudwego/eino@v0.4.8/compose/tool_node.go:427 (*ToolsNode).Stream
coze-server | /go/pkg/mod/github.com/cloudwego/eino@v0.4.8/compose/utils.go:107 newRunnablePacker[...].func22
coze-server | /go/pkg/mod/github.com/cloudwego/eino@v0.4.8/compose/runnable.go:303 newRunnablePacker[...].func18
coze-server | /go/pkg/mod/github.com/cloudwego/eino@v0.4.8/compose/runnable.go:144 (*runnablePacker[...]).toComposableRunnable.func2
coze-server | /go/pkg/mod/github.com/cloudwego/eino@v0.4.8/compose/runnable.go:179 (*runnablePacker[...]).Transform
coze-server | /go/pkg/mod/github.com/cloudwego/eino@v0.4.8/compose/graph_run.go:104 runnableTransform
coze-server | /go/pkg/mod/github.com/cloudwego/eino@v0.4.8/compose/graph_manager.go:279 (*taskManager).execute
coze-server | /go/pkg/mod/github.com/cloudwego/eino@v0.4.8/compose/graph_manager.go:311 (*taskManager).submit
coze-server | /go/pkg/mod/github.com/cloudwego/eino@v0.4.8/compose/graph_run.go:293 (*runner).run
coze-server | /go/pkg/mod/github.com/cloudwego/eino@v0.4.8/compose/graph_run.go:90 (*runner).transform
coze-server | /go/pkg/mod/github.com/cloudwego/eino@v0.4.8/compose/graph_run.go:879 (*graph).compile.(*runner).toComposableRunnable.func4
coze-server | /go/pkg/mod/github.com/cloudwego/eino@v0.4.8/compose/graph_run.go:104 runnableTransform
coze-server | /go/pkg/mod/github.com/cloudwego/eino@v0.4.8/compose/graph_manager.go:279 (*taskManager).execute
coze-server | /go/pkg/mod/github.com/cloudwego/eino@v0.4.8/compose/graph_manager.go:311 (*taskManager).submit
coze-server | /go/pkg/mod/github.com/cloudwego/eino@v0.4.8/compose/graph_run.go:293 (*runner).run
coze-server | /go/pkg/mod/github.com/cloudwego/eino@v0.4.8/compose/graph_run.go:90 (*runner).transform
coze-server | /go/pkg/mod/github.com/cloudwego/eino@v0.4.8/compose/graph_run.go:879 (*graph).compile.(*runner).toComposableRunnable.func4
coze-server | /go/pkg/mod/github.com/cloudwego/eino@v0.4.8/compose/runnable.go:428 toGenericRunnable[...].func2
coze-server | /go/pkg/mod/github.com/cloudwego/eino@v0.4.8/compose/runnable.go:230 newRunnablePacker[...].func12
coze-server | /go/pkg/mod/github.com/cloudwego/eino@v0.4.8/compose/runnable.go:87 (*runnablePacker[...]).wrapRunnableCtx.func2
coze-server | /go/pkg/mod/github.com/cloudwego/eino@v0.4.8/compose/runnable.go:164 (*runnablePacker[...]).Stream
coze-server |
coze-server | ------------------------
coze-server | node path: [react_agent, tools]
```
Contributor guide
Research direction
Start in pkg/errorx/internal and domain/plugin/service/exec_tool.go at the reported ExecuteTool failure, then trace how the empty array parameter is passed into plugin execution. Reproduce the call with an array parameter configured to allow empty input. Done means the empty array is accepted without the reported type error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100