File tree Expand file tree Collapse file tree 2 files changed +16
-5
lines changed
packages/service/core/workflow/dispatch/tools Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,8 @@ type RunCodeResponse = DispatchNodeResultType<
2222 }
2323> ;
2424
25+ const token = process . env . SANDBOX_TOKEN ;
26+
2527export const runCode = async ( {
2628 codeType,
2729 code,
@@ -48,10 +50,18 @@ export const runCode = async ({
4850 codeReturn : Record < string , any > ;
4951 log : string ;
5052 } ;
51- } > ( url , {
52- code,
53- variables
54- } ) ;
53+ } > (
54+ url ,
55+ {
56+ code,
57+ variables
58+ } ,
59+ {
60+ headers : {
61+ Authorization : token ? `Bearer ${ token } ` : undefined
62+ }
63+ }
64+ ) ;
5565
5666 if ( ! runResult . success ) {
5767 return Promise . reject ( 'Run code failed' ) ;
Original file line number Diff line number Diff line change @@ -24,8 +24,9 @@ HIDE_CHAT_COPYRIGHT_SETTING=
2424# Plugin
2525PLUGIN_BASE_URL = http://localhost:3003
2626PLUGIN_TOKEN = token
27- # code sandbox url
27+ # Code sandbox server
2828SANDBOX_URL = http://localhost:3002
29+ SANDBOX_TOKEN =
2930# ai proxy api
3031AIPROXY_API_ENDPOINT = https://localhost:3010
3132AIPROXY_API_TOKEN = aiproxy
You can’t perform that action at this time.
0 commit comments