File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Core/Sources/SuggestionWidget/FeatureReducers Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -131,8 +131,13 @@ public struct PromptToCodePanel {
131131 let context = await contextInputController. resolveContext ( )
132132 let agentFactory = context. agent ?? { SimpleModificationAgent ( ) }
133133 _ = try await withThrowingTaskGroup ( of: Void . self) { group in
134- for snippet in snippets {
134+ for (index, snippet) in snippets. enumerated ( ) {
135+ if index > 3 { // at most 3 at a time
136+ _ = try await group. next ( )
137+ }
135138 group. addTask {
139+ try await Task
140+ . sleep ( nanoseconds: UInt64 . random ( in: 0 ... 1_000_000_000 ) )
136141 let agent = agentFactory ( )
137142 let stream = agent. send ( . init(
138143 code: snippet. originalCode,
@@ -153,7 +158,7 @@ public struct PromptToCodePanel {
153158 range: snippet. attachedRange,
154159 references: context. references,
155160 topics: context. topics
156- ) ) . timedDebounce ( for: 0.5 )
161+ ) ) . timedDebounce ( for: 0.4 )
157162
158163 do {
159164 for try await response in stream {
You can’t perform that action at this time.
0 commit comments