opencode-thinking-fix 1.1.6 → 1.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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,71 @@
1
+ # Changelog
2
+
3
+ All notable changes to `opencode-thinking-fix`.
4
+
5
+ ## [1.1.8] - 2026-06-23
6
+
7
+ ### Fixed
8
+ - **package.json aligned with project Documents**: description shortened, `homepage` added, `peerDependenciesMeta.optional` set to `false`, `repository.url` normalized, keywords added (`mimo`, `minimax`), duplicate keywords removed.
9
+ - **Stale `node_modules/` deleted** from repo (was committed accidentally).
10
+ - **Stale npm cache entry** (`npm i opencode-thinking-fix`) removed from `~/.cache/opencode/packages/`.
11
+
12
+ ## [1.1.7] - 2026-06-23
13
+
14
+ ### Fixed
15
+ - **TUI plugin loading error**: removed broken `opencode-thinking-fix-tui.ts`. OpenCode tried to load it as a TUI plugin at startup and failed because it didn't export `{ tui() }`. Package is now server-only.
16
+ - **Plugin default export**: switched from v1 format (`{ server: Plugin }`) to v0 legacy format (bare `export default Plugin`), matching the proven opencode-wakatime pattern.
17
+ - **package.json**: removed `oc-plugin` field, removed `dependencies`, moved `@opencode-ai/plugin` to optional `peerDependencies` (import is type-only, no runtime dep needed), whitelisted individual files instead of entire directories.
18
+
19
+ ## [1.1.6] - 2026-06-23
20
+
21
+ ### Fixed
22
+ - Exposed a no-op TUI plugin target so installation via `Ctrl+P` / `opencode plugin opencode-thinking-fix` completes without the "Package has no TUI target" warning.
23
+
24
+ ## [1.1.5] - 2026-06-23
25
+
26
+ ### Fixed
27
+ - **MiniMax-M3 JSON parse errors in OpenCode Go mode**: model name was not parsed in fixed-upstream mode, so `reasoning_split: true` was never injected for MiniMax models routed through port 3458. Now model name is parsed regardless of `UPSTREAM_URL`.
28
+ - **`<think>` tags leaked into `delta.content`**: added a fallback extractor that strips `<think>...</think>` blocks from content, moves them into the reasoning buffer, and forwards a sanitized SSE chunk.
29
+ - **Kimi K2.6/K2.7 parameter rejection**: strip all hardcoded sampling parameters (`temperature`, `top_p`, `top_k`, `presence_penalty`, `frequency_penalty`, `n`, and `thinking`/`reasoning_effort` for K2.7) before sending to Moonshot.
30
+
31
+ ### Changed
32
+ - SSE stream parser now re-serializes and forwards modified chunks instead of forwarding the raw upstream bytes unchanged.
33
+
34
+ ## [1.1.4] - 2026-06-23
35
+
36
+ ### Fixed
37
+ - Strip all Moonshot-hardcoded sampling parameters for Kimi K2.6/K2.7 thinking mode, not just `top_p`/`top_k`.
38
+
39
+ ## [1.1.3] - 2026-06-23
40
+
41
+ ### Fixed
42
+ - Strip `top_p` and `top_k` from request body for Kimi/Moonshot models.
43
+
44
+ ## [1.1.2] - 2026-06-23
45
+
46
+ ### Fixed
47
+ - Interleaved thinking support: reasoning can now appear after content in the same streaming turn (GLM-5+, MiniMax-M3). Removed premature flush on content appearance.
48
+ - Inject `reasoning_split: true` for MiniMax models to keep reasoning out of `content`.
49
+
50
+ ## [1.1.1] - 2026-06-23
51
+
52
+ ### Fixed
53
+ - Parse MiniMax-M3 `reasoning_details[]` array format and replay it on subsequent turns.
54
+
55
+ ## [1.1.0] - 2026-06-23
56
+
57
+ ### Fixed
58
+ - Restored OpenCode 1.3.x plugin loader compatibility by exporting `{ server: ThinkingFixPlugin }` and adding `oc-plugin: ["server"]`.
59
+
60
+ ## [1.0.1] - 2026-06-22
61
+
62
+ ### Added
63
+ - MIT LICENSE.
64
+ - `files` whitelist in `package.json`.
65
+
66
+ ## [1.0.0] - 2026-06-22
67
+
68
+ ### Added
69
+ - Initial release: plugin + proxy + watchdog.
70
+ - Support for DeepSeek, Kimi, GLM, and MiMo `reasoning_content` replay.
71
+ - Two-proxy architecture (direct providers on port 3457, OpenCode Go on port 3458).
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "opencode-thinking-fix",
3
- "version": "1.1.6",
4
- "description": "Fix DeepSeek/Kimi/GLM/MiMo reasoning_content 400 errors in OpenCode. Plugin + proxy + watchdog.",
3
+ "version": "1.1.8",
4
+ "description": "Fix reasoning_content 400 errors for DeepSeek/Kimi/GLM/MiMo/MiniMax in OpenCode",
5
+ "type": "module",
5
6
  "license": "MIT",
6
7
  "author": "tbosancheros39",
7
8
  "keywords": [
@@ -9,45 +10,47 @@
9
10
  "deepseek",
10
11
  "kimi",
11
12
  "glm",
13
+ "mimo",
14
+ "minimax",
12
15
  "reasoning",
13
16
  "reasoning_content",
14
- "thinking",
15
- "proxy",
16
17
  "plugin"
17
18
  ],
18
19
  "repository": {
19
20
  "type": "git",
20
- "url": "git+https://github.com/tbosancheros39/opencode-thinking-fix.git"
21
+ "url": "https://github.com/tbosancheros39/opencode-thinking-fix"
21
22
  },
22
- "oc-plugin": [
23
- "server",
24
- "tui"
25
- ],
23
+ "homepage": "https://github.com/tbosancheros39/opencode-thinking-fix#readme",
26
24
  "main": "./plugins/opencode-thinking-fix-universal.ts",
27
25
  "exports": {
28
- "./server": {
29
- "import": "./plugins/opencode-thinking-fix-universal.ts",
30
- "types": "./plugins/opencode-thinking-fix-universal.ts"
31
- },
32
- "./tui": {
33
- "import": "./plugins/opencode-thinking-fix-tui.ts",
34
- "types": "./plugins/opencode-thinking-fix-tui.ts"
35
- }
26
+ ".": "./plugins/opencode-thinking-fix-universal.ts",
27
+ "./server": "./plugins/opencode-thinking-fix-universal.ts"
36
28
  },
37
29
  "files": [
38
- "plugins/",
39
- "proxy/",
40
- "tests/",
41
- "watchdog/",
42
- "systemd/",
30
+ "plugins/opencode-thinking-fix-universal.ts",
31
+ "proxy/proxy.js",
32
+ "systemd/reasoning-cache.service",
33
+ "systemd/reasoning-cache-go.service",
34
+ "systemd/reasoning-proxy-watchdog.service",
35
+ "watchdog/watchdog.sh",
36
+ "tests/test-plugin.js",
37
+ "tests/test-proxy.js",
43
38
  "README.md",
44
- "LICENSE.md",
45
- ".gitignore"
39
+ "CHANGELOG.md",
40
+ "LICENSE.md"
46
41
  ],
47
42
  "scripts": {
48
43
  "test": "node tests/test-plugin.js && node tests/test-proxy.js"
49
44
  },
50
- "dependencies": {
51
- "@opencode-ai/plugin": "^1.3.0"
45
+ "peerDependencies": {
46
+ "@opencode-ai/plugin": ">=1.3.0"
47
+ },
48
+ "peerDependenciesMeta": {
49
+ "@opencode-ai/plugin": {
50
+ "optional": false
51
+ }
52
+ },
53
+ "devDependencies": {
54
+ "typescript": "^6.0.3"
52
55
  }
53
56
  }
@@ -1,4 +1,4 @@
1
- import type { Plugin, PluginModule } from '@opencode-ai/plugin'
1
+ import type { Plugin } from '@opencode-ai/plugin'
2
2
 
3
3
  // ─────────────────────────────────────────────────────────────────────────────
4
4
  // CONFIRMED FACTS (cross-validated across DeepSeek V4 Pro, Claude MAX, Kimi
@@ -103,4 +103,4 @@ export const ThinkingFixPlugin: Plugin = async ({ client }) => {
103
103
  }
104
104
  }
105
105
 
106
- export default { server: ThinkingFixPlugin } satisfies PluginModule
106
+ export default ThinkingFixPlugin
package/.gitignore DELETED
@@ -1,5 +0,0 @@
1
- node_modules/
2
- .env
3
- *.log
4
- .DS_Store
5
- Thumbs.db
@@ -1,20 +0,0 @@
1
- import type { TUIPlugin } from '@opencode-ai/plugin'
2
-
3
- /**
4
- * No-op TUI plugin entry point.
5
- *
6
- * opencode-thinking-fix is a server-side plugin: it patches outgoing chat
7
- * messages via experimental.chat.messages.transform. OpenCode's plugin
8
- * installer, however, validates that a package exposes either a server or a
9
- * TUI target. By exposing an empty TUI target we make installation via
10
- * Ctrl+P / `opencode plugin opencode-thinking-fix` work without warnings.
11
- */
12
- const tuiPlugin: TUIPlugin = {
13
- name: 'opencode-thinking-fix-tui',
14
- version: '1.1.6',
15
- activate() {
16
- // nothing to do at TUI level
17
- },
18
- }
19
-
20
- export default tuiPlugin