Add explicit LLM concurrency controls
This commit is contained in:
@@ -296,8 +296,8 @@ func collectSectionProposals(ctx context.Context, input collectSectionProposalsI
|
||||
}
|
||||
|
||||
maxWorkers := 1
|
||||
if input.Config != nil && input.Config.PrimaryLLM.Concurrency > 1 {
|
||||
maxWorkers = input.Config.PrimaryLLM.Concurrency
|
||||
if input.Config != nil && input.Config.EffectiveProposalLLMConcurrency() > 1 {
|
||||
maxWorkers = input.Config.EffectiveProposalLLMConcurrency()
|
||||
}
|
||||
if maxWorkers > len(input.Sections) {
|
||||
maxWorkers = len(input.Sections)
|
||||
|
||||
@@ -163,11 +163,12 @@ func TestRunnerProposalsExecutePerChunkSection(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestRunnerProposalSectionConcurrencyBoundedByPrimaryLLMConcurrency(t *testing.T) {
|
||||
func TestRunnerProposalSectionConcurrencyBoundedByProposalLLMConcurrency(t *testing.T) {
|
||||
cfg := config.Default()
|
||||
cfg.MaxSectionTokens = 3
|
||||
cfg.MinSectionTokens = 0
|
||||
cfg.PrimaryLLM.Concurrency = 2
|
||||
cfg.TotalLLMConcurrency = 2
|
||||
cfg.ProposalLLMConcurrency = 2
|
||||
|
||||
transcript := &schema.Transcript{Segments: []schema.Segment{
|
||||
{ID: 1, Text: "one two"},
|
||||
@@ -215,7 +216,8 @@ func TestRunnerProposalIndexOrderingIsDeterministicAcrossParallelSections(t *tes
|
||||
cfg := config.Default()
|
||||
cfg.MaxSectionTokens = 3
|
||||
cfg.MinSectionTokens = 0
|
||||
cfg.PrimaryLLM.Concurrency = 3
|
||||
cfg.TotalLLMConcurrency = 3
|
||||
cfg.ProposalLLMConcurrency = 3
|
||||
|
||||
transcript := &schema.Transcript{Segments: []schema.Segment{
|
||||
{ID: 1, Text: "alpha one"},
|
||||
@@ -259,6 +261,12 @@ func TestRunnerProposalIndexOrderingIsDeterministicAcrossParallelSections(t *tes
|
||||
t.Fatalf("expected deterministic applied-change order by section/segment, got %+v", out.ModuleResults[0].AppliedChanges)
|
||||
}
|
||||
}
|
||||
wantFinal := []string{"ALPHA ONE", "BRAVO TWO", "CHARLIE THREE"}
|
||||
for i, seg := range out.FinalTranscript.Segments {
|
||||
if seg.Text != wantFinal[i] {
|
||||
t.Fatalf("expected deterministic final transcript regardless of section completion order; got %+v", out.FinalTranscript.Segments)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestRunnerSkippedRecorded(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user