@webpresso/codex-plugin 3.1.7 → 3.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-kit",
3
- "version": "3.1.7",
3
+ "version": "3.1.8",
4
4
  "description": "Webpresso agent-kit: blueprints, skills, hooks, and MCP server",
5
5
  "author": {
6
6
  "name": "Webpresso",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webpresso/codex-plugin",
3
- "version": "3.1.7",
3
+ "version": "3.1.8",
4
4
  "private": false,
5
5
  "description": "Codex plugin adapter for Webpresso agent-kit skills, hooks, and MCP runtime.",
6
6
  "homepage": "https://github.com/webpresso/agent-kit#readme",
@@ -44,46 +44,56 @@ MODEL=$(echo "$CATALOG" | grep '^opencode-go/kimi' | grep -- '-code$' | sort -V
44
44
  [ -z "$MODEL" ] && MODEL=$(echo "$CATALOG" | grep '^opencode-go/mimo' | grep -- '-pro$' | sort -V | tail -1)
45
45
  [ -z "$MODEL" ] && MODEL=$(echo "$CATALOG" | sort -V | tail -1)
46
46
 
47
- # Fail fast on blocked quota before launching a long review.
47
+ # Fail fast on blocked quota before launching a long review. The probe uses
48
+ # an idle timeout, not a wall-clock timeout, so active output is allowed to continue.
49
+ # The probe succeeds as soon as it observes the expected success marker instead of
50
+ # waiting for the CLI to finish teardown after the reply has already arrived.
48
51
  [ -n "$MODEL" ] || { echo "No OpenCode Go model resolved for this reviewer." >&2; exit 2; }
49
52
  OPENCODE_GO_REVIEW_EFFORT=${OPENCODE_GO_REVIEW_EFFORT:-medium}
50
53
  [ "$OPENCODE_GO_REVIEW_EFFORT" = medium ] || [ "$OPENCODE_GO_REVIEW_EFFORT" = high ] || { echo "OPENCODE_GO_REVIEW_EFFORT must be one of: medium, high" >&2; exit 2; }
51
54
  OPENCODE_GO_PROBE_TIMEOUT=${OPENCODE_GO_PROBE_TIMEOUT:-20}
55
+ case "$OPENCODE_GO_PROBE_TIMEOUT" in
56
+ ""|*[!0-9]*) echo "OPENCODE_GO_PROBE_TIMEOUT must be a positive integer number of seconds" >&2; exit 2 ;;
57
+ esac
58
+ [ "$OPENCODE_GO_PROBE_TIMEOUT" -gt 0 ] || { echo "OPENCODE_GO_PROBE_TIMEOUT must be a positive integer number of seconds" >&2; exit 2; }
52
59
  PROBE_LOG=$(mktemp -t wp-opencode-go-probe.XXXXXX)
53
- PROBE_RC=0
54
- node - "$MODEL" "$OPENCODE_GO_PROBE_TIMEOUT" "$PROBE_LOG" "$OPENCODE_GO_REVIEW_EFFORT" <<'JS' || PROBE_RC=$?
55
- const { spawnSync } = require('node:child_process')
56
- const { writeFileSync } = require('node:fs')
57
-
58
- const [model, timeoutSecondsRaw, logPath, reviewEffort] = process.argv.slice(2)
59
- const timeoutSeconds = Number(timeoutSecondsRaw)
60
- if (!Number.isFinite(timeoutSeconds) || timeoutSeconds <= 0) {
61
- console.error('OPENCODE_GO_PROBE_TIMEOUT must be a positive number of seconds')
62
- process.exit(2)
63
- }
64
-
65
- const result = spawnSync(
66
- 'opencode',
67
- ['run', '--format', 'json', '--variant', reviewEffort, '--model', model, '--title', 'opencode-go-credit-probe', 'Reply exactly OPENCODE_GO_OK.'],
68
- { encoding: 'utf8', timeout: timeoutSeconds * 1000, maxBuffer: 1024 * 1024 },
69
- )
70
-
71
- let output = ''
72
- if (result.stdout) output += result.stdout
73
- if (result.stderr) output += result.stderr
74
- if (result.error?.code === 'ETIMEDOUT') {
75
- output += `\nOPENCODE_GO_PROBE_TIMEOUT after ${timeoutSeconds}s\n`
76
- writeFileSync(logPath, output)
77
- process.exit(124)
78
- }
79
- if (result.error) {
80
- output += `${result.error.message}\n`
81
- writeFileSync(logPath, output)
82
- process.exit(1)
83
- }
84
- writeFileSync(logPath, output)
85
- process.exit(typeof result.status === 'number' ? result.status : 1)
86
- JS
60
+ unset PROBE_RC
61
+ opencode run --format json --variant "$OPENCODE_GO_REVIEW_EFFORT" --model "$MODEL" --title opencode-go-credit-probe 'Reply exactly OPENCODE_GO_OK.' >"$PROBE_LOG" 2>&1 &
62
+ PROBE_PID=$!
63
+ LAST_PROBE_SIZE=$(wc -c <"$PROBE_LOG" | tr -d " ")
64
+ LAST_PROBE_PROGRESS_AT=$(date +%s)
65
+ while kill -0 "$PROBE_PID" 2>/dev/null; do
66
+ if grep -q "OPENCODE_GO_OK" "$PROBE_LOG"; then
67
+ kill "$PROBE_PID" 2>/dev/null || true
68
+ wait "$PROBE_PID" 2>/dev/null || true
69
+ PROBE_RC=0
70
+ break
71
+ fi
72
+ CURRENT_PROBE_SIZE=$(wc -c <"$PROBE_LOG" | tr -d " ")
73
+ NOW=$(date +%s)
74
+ if [ "$CURRENT_PROBE_SIZE" -gt "$LAST_PROBE_SIZE" ]; then
75
+ LAST_PROBE_SIZE=$CURRENT_PROBE_SIZE
76
+ LAST_PROBE_PROGRESS_AT=$NOW
77
+ elif [ $((NOW - LAST_PROBE_PROGRESS_AT)) -gt "$OPENCODE_GO_PROBE_TIMEOUT" ]; then
78
+ printf '\nOPENCODE_GO_PROBE_TIMEOUT after %ss without progress\n' "$OPENCODE_GO_PROBE_TIMEOUT" >>"$PROBE_LOG"
79
+ kill -KILL "$PROBE_PID" 2>/dev/null || true
80
+ wait "$PROBE_PID" 2>/dev/null || true
81
+ PROBE_RC=124
82
+ break
83
+ fi
84
+ sleep 1
85
+ done
86
+ if [ -z "${PROBE_RC+x}" ]; then
87
+ if grep -q "OPENCODE_GO_OK" "$PROBE_LOG"; then
88
+ PROBE_RC=0
89
+ else
90
+ wait "$PROBE_PID" || PROBE_RC=$?
91
+ fi
92
+ fi
93
+ if [ "$PROBE_RC" -eq 0 ] && ! grep -q "OPENCODE_GO_OK" "$PROBE_LOG"; then
94
+ echo "OpenCode Go probe finished without the expected success marker." >>"$PROBE_LOG"
95
+ PROBE_RC=1
96
+ fi
87
97
  if [ "$PROBE_RC" -ne 0 ]; then
88
98
  echo "OpenCode Go probe failed or timed out for $MODEL after ${OPENCODE_GO_PROBE_TIMEOUT}s; skipping this reviewer instead of starting the full review." >&2
89
99
  sed -n '1,80p' "$PROBE_LOG" >&2
@@ -162,7 +162,7 @@ user explicitly asked for a different approval count or reviewer mix.
162
162
 
163
163
  Default policy:
164
164
 
165
- - Require **two extra model approvals** by default.
165
+ - Require **two extra model approvals** by default, but at most **one OpenCode Go reviewer** is required unless the user explicitly asks for multiple OpenCode models.
166
166
  - If the user asks for more, fewer, zero, or specific reviewers, follow that
167
167
  explicit instruction and report the chosen requirement.
168
168
  - These approvals are model outside-voice approvals, not a substitute for
@@ -172,10 +172,10 @@ Reviewer preference:
172
172
 
173
173
  - When running from Codex, prefer **Claude + one OpenCode Go reviewer**.
174
174
  - When running from Claude, prefer **Codex + one OpenCode Go reviewer**.
175
- - When Codex/Claude outside voice is unavailable, use **two distinct OpenCode Go
176
- reviewers** if OpenCode is logged in.
175
+ - When Codex/Claude outside voice is unavailable, use **one OpenCode Go
176
+ reviewer** if OpenCode is logged in.
177
177
  - Prefer the repo's outside-voice skills instead of hand-rolled commands:
178
- `$agent-kit:claude`, `$agent-kit:codex`, and one or more OpenCode Go reviewer
178
+ `$agent-kit:claude`, `$agent-kit:codex`, and one OpenCode Go reviewer
179
179
  skills such as `$agent-kit:opencode-go`, `$agent-kit:qwen`,
180
180
  `$agent-kit:deepseek`, `$agent-kit:glm`, `$agent-kit:kimi`,
181
181
  `$agent-kit:minimax`, or `$agent-kit:mimo`.