Skip to content

armgit / E2B

Public Imported from GitHub
0

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

Fix passing agent instructions

Tomas Valenta31961715ca16
diff --git a/components/AgentInstructions.tsx b/components/AgentInstructions.tsx
index 369181b8b..fb39c03c3 100644
--- a/components/AgentInstructions.tsx
+++ b/components/AgentInstructions.tsx
@@ -7,7 +7,7 @@ import InstructionsEditor from 'components/Editor/Template/NodeJSExpressTemplate
export interface Props {
onBack: () => void
- onNext: () => void
+ onNext: (instructions: string) => void
}
function AgentInstructions({
@@ -26,7 +26,6 @@ function AgentInstructions({
onChange={setContent}
/>
</div>
-
<div className="w-full flex items-center justify-between">
<button
className="flex items-center justify-start space-x-1 text-gray-400 hover:text-gray-100 transition-all"
@@ -37,7 +36,7 @@ function AgentInstructions({
</button>
<button
className="px-2 py-1 font-medium rounded-md text-sm border border-transparent bg-indigo-600/30 text-indigo-500 hover:bg-transparent hover:border-indigo-600 transition-all"
- onClick={onNext}
+ onClick={() => onNext(content)}
>
Continue
</button>
diff --git a/pages/agent/smol-developer/setup.tsx b/pages/agent/smol-developer/setup.tsx
index c9a1a47c6..2fc424cf9 100644
--- a/pages/agent/smol-developer/setup.tsx
+++ b/pages/agent/smol-developer/setup.tsx
@@ -232,10 +232,11 @@ function Setup() {
)}
{currentStep === 1 && (
<AgentInstructions
- value={instructions}
- onChange={setInstructions}
onBack={() => previousStep()}
- onNext={() => nextStep()}
+ onNext={i => {
+ setInstructions(i)
+ nextStep()
+ }}
/>
)}
{currentStep === 2 && (