diff --git a/README.md b/README.md index 95623d2..96c4ece 100644 --- a/README.md +++ b/README.md @@ -125,7 +125,7 @@ Requirements → Architecture → Sprint Plan → Development → Review → QA ## Enterprise Workflow Features - **Multi-backend execution:** `codeagent-wrapper --backend codex|claude|gemini` (default `codex`) so you can match the model to the task without changing workflows. -- **GitHub workflow commands:** `/gh-create-issue "short need"` creates structured issues; `/gh-implement 123` pulls issue #123, drives development, and prepares the PR. +- **GitHub workflow commands:** `/gh-create-issue "short need"` creates structured issues; `/gh-issue-implement 123` pulls issue #123, drives development, and prepares the PR. - **Skills + hooks activation:** .claude/hooks run automation (tests, reviews), while `.claude/skills/skill-rules.json` auto-suggests the right skills. Keep hooks enabled in `.claude/settings.json` to activate the enterprise workflow helpers. --- @@ -242,8 +242,6 @@ python3 install.py --module dev # Manual bash install.sh -# Create legacy codex-wrapper alias (uses $INSTALL_DIR or ~/bin) -bash scripts/install.sh ``` #### Windows diff --git a/README_CN.md b/README_CN.md index 5516011..9dabf86 100644 --- a/README_CN.md +++ b/README_CN.md @@ -233,8 +233,6 @@ python3 install.py --module dev # 手动 bash install.sh -# 创建 codex-wrapper 兼容别名(使用 $INSTALL_DIR 或 ~/bin) -bash scripts/install.sh ``` #### Windows 系统 diff --git a/codeagent-wrapper/config.go b/codeagent-wrapper/config.go index 3a3abfc..bee3a2a 100644 --- a/codeagent-wrapper/config.go +++ b/codeagent-wrapper/config.go @@ -249,6 +249,8 @@ func parseArgs() (*Config, error) { return cfg, nil } +const maxParallelWorkersLimit = 100 + func resolveMaxParallelWorkers() int { raw := strings.TrimSpace(os.Getenv("CODEAGENT_MAX_PARALLEL_WORKERS")) if raw == "" { @@ -261,5 +263,10 @@ func resolveMaxParallelWorkers() int { return 0 } + if value > maxParallelWorkersLimit { + logWarn(fmt.Sprintf("CODEAGENT_MAX_PARALLEL_WORKERS=%d exceeds limit, capping at %d", value, maxParallelWorkersLimit)) + return maxParallelWorkersLimit + } + return value } diff --git a/codeagent-wrapper/main_test.go b/codeagent-wrapper/main_test.go index 508d89e..99bfc4a 100644 --- a/codeagent-wrapper/main_test.go +++ b/codeagent-wrapper/main_test.go @@ -3881,3 +3881,35 @@ func TestRun_CLI_Success(t *testing.T) { t.Fatalf("unexpected output: %q", output) } } + +func TestResolveMaxParallelWorkers(t *testing.T) { + tests := []struct { + name string + envValue string + want int + }{ + {"empty env returns unlimited", "", 0}, + {"valid value", "4", 4}, + {"zero value", "0", 0}, + {"at limit", "100", 100}, + {"exceeds limit capped", "150", 100}, + {"negative falls back to unlimited", "-1", 0}, + {"invalid string falls back to unlimited", "abc", 0}, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + if tt.envValue != "" { + os.Setenv("CODEAGENT_MAX_PARALLEL_WORKERS", tt.envValue) + } else { + os.Unsetenv("CODEAGENT_MAX_PARALLEL_WORKERS") + } + defer os.Unsetenv("CODEAGENT_MAX_PARALLEL_WORKERS") + + got := resolveMaxParallelWorkers() + if got != tt.want { + t.Errorf("resolveMaxParallelWorkers() = %d, want %d", got, tt.want) + } + }) + } +} diff --git a/scripts/install.sh b/scripts/install.sh deleted file mode 100755 index ca40b24..0000000 --- a/scripts/install.sh +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -# Legacy alias installer: create codex-wrapper -> codeagent-wrapper symlink -# in the configured install directory (defaults to ~/bin). - -BIN_DIR="${INSTALL_DIR:-"$HOME/bin"}" -TARGET_NAME="codeagent-wrapper" -LEGACY_NAME="codex-wrapper" - -mkdir -p "$BIN_DIR" -cd "$BIN_DIR" - -if [[ ! -x "$TARGET_NAME" ]]; then - echo "ERROR: $BIN_DIR/$TARGET_NAME not found or not executable; install the wrapper first." >&2 - exit 1 -fi - -if [[ -L "$LEGACY_NAME" ]]; then - echo "Legacy alias already present: $BIN_DIR/$LEGACY_NAME -> $(readlink "$LEGACY_NAME")" - exit 0 -fi - -if [[ -e "$LEGACY_NAME" ]]; then - echo "INFO: $BIN_DIR/$LEGACY_NAME exists and is not a symlink; leaving user-managed binary untouched." >&2 - exit 0 -fi - -ln -s "$TARGET_NAME" "$LEGACY_NAME" -echo "Created legacy alias $BIN_DIR/$LEGACY_NAME -> $TARGET_NAME"