opencode-thinking-fix 4.0.1 → 4.0.2
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.
- package/package.json +3 -3
- package/proxy/core.js +22 -0
- package/watchdog/watchdog.sh +16 -34
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-thinking-fix",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.2",
|
|
4
4
|
"description": "Restores reasoning content dropped from multi-turn OpenCode conversations (DeepSeek, Kimi, GLM, MiMo, MiniMax, InclusionAI/Ling, OpenCode Go, OpenRouter). V1 + V2 plugin, proxy, and watchdog.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -83,10 +83,10 @@
|
|
|
83
83
|
"typecheck": "tsc --noEmit"
|
|
84
84
|
},
|
|
85
85
|
"engines": {
|
|
86
|
-
"node": ">=
|
|
86
|
+
"node": ">=24"
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": {
|
|
89
|
-
"@types/node": "^
|
|
89
|
+
"@types/node": "^24",
|
|
90
90
|
"typescript": "^6.0.3"
|
|
91
91
|
}
|
|
92
92
|
}
|
package/proxy/core.js
CHANGED
|
@@ -47,6 +47,19 @@ export const ROUTES = {
|
|
|
47
47
|
'hy3-free': { base: 'https://opencode.ai/zen/v1', reasoningKey: 'reasoning_content' },
|
|
48
48
|
'mimo-v2.5-free': { base: 'https://opencode.ai/zen/v1', reasoningKey: 'reasoning_content' },
|
|
49
49
|
'muse-spark-1.2-contributor-free': { base: 'https://opencode.ai/zen/v1', reasoningKey: 'reasoning_content' },
|
|
50
|
+
// Step 5 Preview Free (StepFun): Zen free lane, chat/completions wire,
|
|
51
|
+
// reasoning model with interleaved reasoning_content (verified 2026-10-12
|
|
52
|
+
// against opencode.ai/docs/zen endpoints table + bundled model catalog).
|
|
53
|
+
'step-5-preview-free': { base: 'https://opencode.ai/zen/v1', reasoningKey: 'reasoning_content' },
|
|
54
|
+
'muse-spark-1.3-contributor-free': { base: 'https://opencode.ai/zen/v1', reasoningKey: 'reasoning_content' },
|
|
55
|
+
// 2026-10-18 models --refresh: newly published Zen free-tier models
|
|
56
|
+
'beam-free': { base: 'https://opencode.ai/zen/v1', reasoningKey: 'reasoning_content' },
|
|
57
|
+
'deepseek-v4.1-flash-free': { base: 'https://opencode.ai/zen/v1', reasoningKey: 'reasoning_content' },
|
|
58
|
+
'glm-5.3-flash-free': { base: 'https://opencode.ai/zen/v1', reasoningKey: 'reasoning_content' },
|
|
59
|
+
'longcat-2.5-preview-free': { base: 'https://opencode.ai/zen/v1', reasoningKey: 'reasoning_content' },
|
|
60
|
+
'mimo-v2.6-flash-free': { base: 'https://opencode.ai/zen/v1', reasoningKey: 'reasoning_content' },
|
|
61
|
+
'nemotron-3.5-super-vl-free': { base: 'https://opencode.ai/zen/v1', reasoningKey: 'reasoning_content' },
|
|
62
|
+
'space-bunny-free': { base: 'https://opencode.ai/zen/v1', reasoningKey: 'reasoning_content' },
|
|
50
63
|
'deepseek-v4-flash-free': { base: 'https://opencode.ai/zen/v1', reasoningKey: 'reasoning_content' },
|
|
51
64
|
'ling-3.0-flash-fin-free': { base: 'https://opencode.ai/zen/v1', reasoningKey: 'reasoning_content' },
|
|
52
65
|
'laguna-s-2.1-free': { base: 'https://opencode.ai/zen/v1', reasoningKey: 'reasoning_content' },
|
|
@@ -85,6 +98,15 @@ export const ROUTES = {
|
|
|
85
98
|
'opencode/hy3-free': { base: 'https://opencode.ai/zen/v1', reasoningKey: 'reasoning_content' },
|
|
86
99
|
'opencode/mimo-v2.5-free': { base: 'https://opencode.ai/zen/v1', reasoningKey: 'reasoning_content' },
|
|
87
100
|
'opencode/muse-spark-1.2-contributor-free': { base: 'https://opencode.ai/zen/v1', reasoningKey: 'reasoning_content' },
|
|
101
|
+
'opencode/muse-spark-1.3-contributor-free': { base: 'https://opencode.ai/zen/v1', reasoningKey: 'reasoning_content' },
|
|
102
|
+
'opencode/step-5-preview-free': { base: 'https://opencode.ai/zen/v1', reasoningKey: 'reasoning_content' },
|
|
103
|
+
'opencode/beam-free': { base: 'https://opencode.ai/zen/v1', reasoningKey: 'reasoning_content' },
|
|
104
|
+
'opencode/deepseek-v4.1-flash-free': { base: 'https://opencode.ai/zen/v1', reasoningKey: 'reasoning_content' },
|
|
105
|
+
'opencode/glm-5.3-flash-free': { base: 'https://opencode.ai/zen/v1', reasoningKey: 'reasoning_content' },
|
|
106
|
+
'opencode/longcat-2.5-preview-free': { base: 'https://opencode.ai/zen/v1', reasoningKey: 'reasoning_content' },
|
|
107
|
+
'opencode/mimo-v2.6-flash-free': { base: 'https://opencode.ai/zen/v1', reasoningKey: 'reasoning_content' },
|
|
108
|
+
'opencode/nemotron-3.5-super-vl-free': { base: 'https://opencode.ai/zen/v1', reasoningKey: 'reasoning_content' },
|
|
109
|
+
'opencode/space-bunny-free': { base: 'https://opencode.ai/zen/v1', reasoningKey: 'reasoning_content' },
|
|
88
110
|
'opencode/deepseek-v4-flash-free': { base: 'https://opencode.ai/zen/v1', reasoningKey: 'reasoning_content' },
|
|
89
111
|
'opencode/nemotron-3-ultra-free': { base: 'https://opencode.ai/zen/v1', reasoningKey: 'reasoning_content' },
|
|
90
112
|
'opencode/nemotron-3.5-lightning-free': { base: 'https://opencode.ai/zen/v1', reasoningKey: 'reasoning_content' },
|
package/watchdog/watchdog.sh
CHANGED
|
@@ -1,64 +1,46 @@
|
|
|
1
1
|
#!/usr/bin/env bash
|
|
2
2
|
# ─────────────────────────────────────────────────────────────────────────────
|
|
3
3
|
# OpenCode Reasoning Proxy Watchdog
|
|
4
|
-
# Checks
|
|
4
|
+
# Checks all 4 proxy instances every 4 minutes and restarts if down.
|
|
5
5
|
# ─────────────────────────────────────────────────────────────────────────────
|
|
6
6
|
|
|
7
|
-
PROXY_DIR="
|
|
8
|
-
LOG_FILE="
|
|
7
|
+
PROXY_DIR="/home/anini39/opencode-thinking-fix/proxy"
|
|
8
|
+
LOG_FILE="/home/anini39/opencode-thinking-fix/watchdog.log"
|
|
9
9
|
CHECK_INTERVAL=240 # 4 minutes in seconds
|
|
10
10
|
|
|
11
|
-
# Health-check endpoints
|
|
12
|
-
HEALTH_3457="http://127.0.0.1:3457/health"
|
|
13
|
-
HEALTH_3458="http://127.0.0.1:3458/health"
|
|
14
|
-
|
|
15
11
|
log() {
|
|
16
12
|
local msg="[$(date '+%Y-%m-%d %H:%M:%S')] $1"
|
|
17
13
|
echo "$msg" | tee -a "$LOG_FILE"
|
|
18
14
|
}
|
|
19
15
|
|
|
20
|
-
|
|
16
|
+
check_and_restart() {
|
|
21
17
|
local port="$1"
|
|
22
|
-
local health_url="
|
|
23
|
-
local
|
|
24
|
-
local pid
|
|
18
|
+
local health_url="http://127.0.0.1:${port}/health"
|
|
19
|
+
local unit="$2"
|
|
25
20
|
|
|
26
|
-
# Check if the port responds
|
|
21
|
+
# Check if the port responds
|
|
27
22
|
if curl -sf "$health_url" > /dev/null 2>&1; then
|
|
28
23
|
return 0
|
|
29
24
|
fi
|
|
30
25
|
|
|
31
|
-
log "Proxy on port $port is DOWN, restarting..."
|
|
32
|
-
|
|
33
|
-
# Kill any stale proxy process on this port
|
|
34
|
-
pid=$(lsof -ti :"$port" 2>/dev/null)
|
|
35
|
-
if [ -n "$pid" ]; then
|
|
36
|
-
kill "$pid" 2>/dev/null
|
|
37
|
-
sleep 1
|
|
38
|
-
fi
|
|
39
|
-
|
|
40
|
-
# Start proxy
|
|
41
|
-
if [ -n "$env_extra" ]; then
|
|
42
|
-
eval "nohup env $env_extra node $PROXY_DIR/proxy.js > /tmp/proxy-${port}.log 2>&1 </dev/null &"
|
|
43
|
-
else
|
|
44
|
-
nohup node "$PROXY_DIR/proxy.js" > "/tmp/proxy-${port}.log" 2>&1 </dev/null &
|
|
45
|
-
fi
|
|
46
|
-
|
|
26
|
+
log "Proxy on port $port is DOWN, restarting systemd unit $unit..."
|
|
27
|
+
systemctl restart "$unit"
|
|
47
28
|
sleep 2
|
|
48
29
|
|
|
49
|
-
# Verify it came up
|
|
50
30
|
if curl -sf "$health_url" > /dev/null 2>&1; then
|
|
51
|
-
log "Proxy on port $port restarted successfully"
|
|
31
|
+
log "Proxy on port $port restarted successfully via $unit"
|
|
52
32
|
else
|
|
53
|
-
log "ERROR: Proxy on port $port FAILED to restart"
|
|
33
|
+
log "ERROR: Proxy on port $port FAILED to restart via $unit"
|
|
54
34
|
fi
|
|
55
35
|
}
|
|
56
36
|
|
|
57
37
|
# ── Main loop ────────────────────────────────────────────────────────────────
|
|
58
|
-
log "Watchdog started, checking every ${CHECK_INTERVAL}s"
|
|
38
|
+
log "Watchdog started, checking ports 3457/3458/3459/3462 every ${CHECK_INTERVAL}s"
|
|
59
39
|
|
|
60
40
|
while true; do
|
|
61
|
-
|
|
62
|
-
|
|
41
|
+
check_and_restart 3457 "reasoning-cache.service"
|
|
42
|
+
check_and_restart 3458 "reasoning-cache-go.service"
|
|
43
|
+
check_and_restart 3459 "reasoning-cache-zen.service"
|
|
44
|
+
check_and_restart 3462 "reasoning-cache-openrouter.service"
|
|
63
45
|
sleep "$CHECK_INTERVAL"
|
|
64
46
|
done
|