File tree Expand file tree Collapse file tree
packages/opencode/src/session Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ export namespace SessionProcessor {
4646 log . info ( "process" )
4747 needsCompaction = false
4848 const shouldBreak = ( await Config . get ( ) ) . experimental ?. continue_loop_on_deny !== true
49+ const retryLimit = streamInput . user . format ?. type === "json_schema" ? streamInput . user . format . retryCount : 2
4950 while ( true ) {
5051 try {
5152 let currentText : MessageV2 . TextPart | undefined
@@ -346,7 +347,7 @@ export namespace SessionProcessor {
346347 // TODO: Handle context overflow error
347348 }
348349 const retry = SessionRetry . retryable ( error )
349- if ( retry !== undefined ) {
350+ if ( retry !== undefined && attempt < retryLimit ) {
350351 attempt ++
351352 const delay = SessionRetry . delay ( attempt , error . name === "APIError" ? error : undefined )
352353 SessionStatus . set ( input . sessionID , {
You can’t perform that action at this time.
0 commit comments