mirror of
https://github.com/cexll/myclaude.git
synced 2026-02-07 02:44:08 +08:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a9c1e8178f | ||
|
|
1afeca88ae |
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -74,7 +74,7 @@ jobs:
|
||||
if [ "${{ matrix.goos }}" = "windows" ]; then
|
||||
OUTPUT_NAME="${OUTPUT_NAME}.exe"
|
||||
fi
|
||||
go build -ldflags="-s -w -X main.version=${VERSION}" -o ${OUTPUT_NAME} ./cmd/codeagent
|
||||
go build -ldflags="-s -w -X main.version=${VERSION}" -o ${OUTPUT_NAME} ./cmd/codeagent-wrapper
|
||||
chmod +x ${OUTPUT_NAME}
|
||||
echo "artifact_path=codeagent-wrapper/${OUTPUT_NAME}" >> $GITHUB_OUTPUT
|
||||
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
package main
|
||||
|
||||
import app "codeagent-wrapper/internal/app"
|
||||
|
||||
func main() {
|
||||
app.Run()
|
||||
}
|
||||
@@ -24,7 +24,7 @@ const (
|
||||
stdoutCloseReasonWait = "wait-done"
|
||||
stdoutCloseReasonDrain = "drain-timeout"
|
||||
stdoutCloseReasonCtx = "context-cancel"
|
||||
stdoutDrainTimeout = 100 * time.Millisecond
|
||||
stdoutDrainTimeout = 500 * time.Millisecond
|
||||
)
|
||||
|
||||
// Test hooks for dependency injection
|
||||
|
||||
@@ -40,7 +40,7 @@ const (
|
||||
stdoutCloseReasonWait = "wait-done"
|
||||
stdoutCloseReasonDrain = "drain-timeout"
|
||||
stdoutCloseReasonCtx = "context-cancel"
|
||||
stdoutDrainTimeout = 100 * time.Millisecond
|
||||
stdoutDrainTimeout = 500 * time.Millisecond
|
||||
)
|
||||
|
||||
// Hook points (tests can override inside this package).
|
||||
|
||||
43
codeagent-wrapper/scripts/benchmark_claude.sh
Executable file
43
codeagent-wrapper/scripts/benchmark_claude.sh
Executable file
@@ -0,0 +1,43 @@
|
||||
#!/bin/bash
|
||||
# Benchmark script for Claude CLI stability test
|
||||
# Tests if the stdoutDrainTimeout fix resolves intermittent failures
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
RUNS=${1:-100}
|
||||
FAIL_COUNT=0
|
||||
SUCCESS_COUNT=0
|
||||
TIMEOUT_COUNT=0
|
||||
|
||||
echo "Running $RUNS iterations..."
|
||||
echo "---"
|
||||
|
||||
for i in $(seq 1 $RUNS); do
|
||||
result=$(timeout 30 codeagent --backend claude --skip-permissions 'say OK' 2>&1) || true
|
||||
|
||||
if echo "$result" | grep -q 'without agent_message'; then
|
||||
((FAIL_COUNT++))
|
||||
echo "[$i] FAIL: without agent_message"
|
||||
elif echo "$result" | grep -q 'timeout'; then
|
||||
((TIMEOUT_COUNT++))
|
||||
echo "[$i] TIMEOUT"
|
||||
elif echo "$result" | grep -q 'OK\|ok'; then
|
||||
((SUCCESS_COUNT++))
|
||||
printf "\r[$i] OK "
|
||||
else
|
||||
((FAIL_COUNT++))
|
||||
echo "[$i] FAIL: unexpected output"
|
||||
echo "$result" | head -3
|
||||
fi
|
||||
done
|
||||
|
||||
echo ""
|
||||
echo "---"
|
||||
echo "Results ($RUNS runs):"
|
||||
echo " Success: $SUCCESS_COUNT ($(echo "scale=1; $SUCCESS_COUNT * 100 / $RUNS" | bc)%)"
|
||||
echo " Fail: $FAIL_COUNT ($(echo "scale=1; $FAIL_COUNT * 100 / $RUNS" | bc)%)"
|
||||
echo " Timeout: $TIMEOUT_COUNT ($(echo "scale=1; $TIMEOUT_COUNT * 100 / $RUNS" | bc)%)"
|
||||
|
||||
if [ $FAIL_COUNT -gt 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user