File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ export class StagehandAgentHandler {
46
46
? { instruction : instructionOrOptions }
47
47
: instructionOrOptions ;
48
48
49
- const maxSteps = options . maxSteps || 10 ;
49
+ const maxSteps = options . maxSteps || 20 ;
50
50
const actions : AgentAction [ ] = [ ] ;
51
51
let finalMessage = "" ;
52
52
let completed = false ;
@@ -88,6 +88,8 @@ export class StagehandAgentHandler {
88
88
} ,
89
89
} ) ;
90
90
91
+ let stepNumber = 0 ;
92
+
91
93
const result = await this . llmClient . generateText ( {
92
94
model : wrappedModel ,
93
95
system : systemPrompt ,
@@ -99,8 +101,8 @@ export class StagehandAgentHandler {
99
101
onStepFinish : async ( event ) => {
100
102
this . logger ( {
101
103
category : "agent" ,
102
- message : `Step finished: ${ event . finishReason } ` ,
103
- level : 2 ,
104
+ message : `Taking step ${ ++ stepNumber } / ${ maxSteps } ` ,
105
+ level : 1 ,
104
106
} ) ;
105
107
106
108
if ( event . toolCalls && event . toolCalls . length > 0 ) {
@@ -114,6 +116,12 @@ export class StagehandAgentHandler {
114
116
category : "agent" ,
115
117
message : `reasoning: ${ event . text } ` ,
116
118
level : 1 ,
119
+ auxiliary : {
120
+ toolCalls : {
121
+ value : JSON . stringify ( event . toolCalls ) ,
122
+ type : "object" ,
123
+ } ,
124
+ } ,
117
125
} ) ;
118
126
}
119
127
You can’t perform that action at this time.
0 commit comments