Merge pull request #1445 from trheyi/main
Fix real_e2e_test max_tokens limit
This commit is contained in:
commit
60b0eda70c
2 changed files with 8 additions and 8 deletions
|
|
@ -64,6 +64,9 @@ func TestRealClaudeCLIExecution(t *testing.T) {
|
||||||
Model: model,
|
Model: model,
|
||||||
SystemPrompt: "You are a helpful assistant. Reply concisely.",
|
SystemPrompt: "You are a helpful assistant. Reply concisely.",
|
||||||
Timeout: 3 * time.Minute,
|
Timeout: 3 * time.Minute,
|
||||||
|
ConnectorOptions: map[string]interface{}{
|
||||||
|
"max_tokens": 4096, // Limit max_tokens to avoid backend API limits
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
t.Logf("Creating executor with options:")
|
t.Logf("Creating executor with options:")
|
||||||
|
|
@ -227,6 +230,9 @@ func TestClaudeCLIDirectExecution(t *testing.T) {
|
||||||
ConnectorKey: apiKey,
|
ConnectorKey: apiKey,
|
||||||
Model: model,
|
Model: model,
|
||||||
Timeout: 3 * time.Minute,
|
Timeout: 3 * time.Minute,
|
||||||
|
ConnectorOptions: map[string]interface{}{
|
||||||
|
"max_tokens": 4096, // Limit max_tokens to avoid backend API limits
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
exec, err := NewExecutor(manager, opts)
|
exec, err := NewExecutor(manager, opts)
|
||||||
|
|
|
||||||
|
|
@ -62,15 +62,9 @@ func newDemuxReadCloser(src io.Reader, closer io.Closer) *demuxReadCloser {
|
||||||
defer close(d.done)
|
defer close(d.done)
|
||||||
defer pw.Close()
|
defer pw.Close()
|
||||||
|
|
||||||
fmt.Printf("[DEBUG demux] Starting stdcopy.StdCopy\n")
|
|
||||||
startTime := time.Now()
|
|
||||||
|
|
||||||
// Use stdcopy to demux stdout and stderr
|
// Use stdcopy to demux stdout and stderr
|
||||||
// We only care about stdout here, stderr goes to a discard writer
|
// We only care about stdout here, stderr goes to a discard writer
|
||||||
n, err := stdcopy.StdCopy(pw, io.Discard, src)
|
_, err := stdcopy.StdCopy(pw, io.Discard, src)
|
||||||
elapsed := time.Since(startTime)
|
|
||||||
|
|
||||||
fmt.Printf("[DEBUG demux] stdcopy.StdCopy returned: bytes=%d, err=%v, elapsed=%v\n", n, err, elapsed)
|
|
||||||
|
|
||||||
if err != nil && err != io.EOF {
|
if err != nil && err != io.EOF {
|
||||||
d.mu.Lock()
|
d.mu.Lock()
|
||||||
|
|
@ -113,7 +107,7 @@ func (d *demuxReadCloser) Close() error {
|
||||||
case <-d.done:
|
case <-d.done:
|
||||||
// Normal completion
|
// Normal completion
|
||||||
case <-time.After(5 * time.Second):
|
case <-time.After(5 * time.Second):
|
||||||
fmt.Printf("[DEBUG demux] Timeout waiting for demux goroutine to finish\n")
|
// Timeout - goroutine may be stuck, but we've done cleanup
|
||||||
}
|
}
|
||||||
|
|
||||||
d.mu.Lock()
|
d.mu.Lock()
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue