Skip to content

armgit / E2B

Public Imported from GitHub
0

Open-source, secure environment with real-world tools for enterprise-grade agents.

Fix human response backend waiting

Tomas Valenta0b3640a7bec1
diff --git a/api-service/playground/src/data/humanResponse.ts b/api-service/playground/src/data/humanResponse.ts
index bcce2741f..03fde8765 100644
--- a/api-service/playground/src/data/humanResponse.ts
+++ b/api-service/playground/src/data/humanResponse.ts
@@ -16,17 +16,6 @@ export const projectsTable = 'projects'
export const deploymentsTable = 'deployments'
export const routesTable = 'routes'
-
-// # {
-// # "id": "52b2b157-132f-47c6-be1e-3c203034fdfb",
-// # "name": "InstallNPMDependencies",
-// # "type": "tool",
-// # "input": "\nexpress\n",
-// # "output": "All dependencies installed",
-// # "start_at": "2023-03-19 23:49:23.079327",
-// # "finish_at": "2023-03-19 23:49:26.002323"
-// # },
-
function checkForResponse(payloadList: any[]): string | null {
const payload = payloadList.length > 0 ? payloadList[payloadList.length - 1] : undefined
@@ -34,8 +23,8 @@ function checkForResponse(payloadList: any[]): string | null {
return null
}
- if (payload.type === 'tool' && payload.tool_name === 'AskHuman' && payload.output) {
- return payload.output
+ if (payload.type === 'tool' && payload.tool_name === 'AskHuman' && payload.tool_output) {
+ return payload.tool_output
}
return null
}
diff --git a/components/Editor/RightSidebar/Logs/Tool/AskHuman.tsx b/components/Editor/RightSidebar/Logs/Tool/AskHuman.tsx
index ec5278ae4..dbd091dda 100644
--- a/components/Editor/RightSidebar/Logs/Tool/AskHuman.tsx
+++ b/components/Editor/RightSidebar/Logs/Tool/AskHuman.tsx
@@ -52,6 +52,7 @@ function AskHuman({
space-x-2
">
<Input
+ isDisabled={!!log.tool_output}
placeholder="What do you think the AI should do?"
onChange={val => setAnswer(val)}
value={answer}
diff --git a/components/Input.tsx b/components/Input.tsx
index 31181ff74..0cf14a7b6 100644
--- a/components/Input.tsx
+++ b/components/Input.tsx
@@ -16,10 +16,12 @@ export interface Props {
pattern?: string
title?: string
required?: boolean
+ isDisabled?: boolean
}
function Input({
value,
+ isDisabled,
required,
pattern,
title,
@@ -60,6 +62,7 @@ function Input({
onChange={e => onChange(e.target.value)}
placeholder={placeholder}
ref={ref}
+ disabled={isDisabled}
pattern={pattern}
type="text"
className={clsx(