opencode-resolve 0.1.11 → 0.1.13

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/README.ko.md CHANGED
@@ -156,8 +156,8 @@ npm install -g opencode-resolve
156
156
 
157
157
  1. `opencode-resolve`를 `~/.config/opencode/opencode.json`의 `plugin` 배열에 추가 (이미 없는 경우).
158
158
  2. 파일이 존재하지 않는 경우, 현재 모델 프로바이더에 맞게 적응된 `~/.config/opencode/resolve.json`을 생성:
159
- - **인터랙티브 터미널** → 항상 `mix` / `gpt` / `glm`을 묻고, `bronze` / `silver` / `gold` 3티어 모델을 고르게 합니다. `mix`에서는 전용 `codex`, `glm` primary 에이전트를 켤지도 묻습니다.
160
- - **비대화형 설치** → 모델 pinning을 추측하지 않습니다. `profile: "mix"`, `models: {}`를 쓰고 세 primary 경로(`resolver`, `codex`, `glm`)를 활성화하므로 이후 명시적으로 모델을 고르면 됩니다.
159
+ - **인터랙티브 터미널** → 항상 `mix` / `gpt` / `glm`을 묻고, `bronze` / `silver` / `gold` 3티어 모델을 고르게 합니다. `mix`에서는 전용 `gpt`, `glm` primary 에이전트를 켤지도 묻습니다.
160
+ - **비대화형 설치** → opencode.json에서 프로바이더를 자동 감지하여 모델 적응 프리셋을 작성합니다. `resolver`, `gpt`, `glm` primary 경로를 활성화합니다.
161
161
  - **GLM/ZAI 모델 감지** → 비밀값 없는 로컬 ZAI MCP 부트스트랩은 계속 추가합니다.
162
162
 
163
163
  기존 `resolve.json` 파일은 **동의 없이 덮어쓰지 않습니다**. 재설치 시 인터랙티브 환경이면 기존 파일을 업데이트할지, 백업 후 fresh setup을 다시 돌릴지 묻습니다. 비대화형 자동화에서는 `OPENCODE_RESOLVE_REINSTALL=fresh` 또는 `OPENCODE_RESOLVE_REINSTALL=update`를 설정하세요.
@@ -679,8 +679,8 @@ opencode-resolve는 전체 저장소를 프롬프트에 밀어 넣지 않고도
679
679
 
680
680
  | 감지된 프로바이더 | 프리셋 |
681
681
  |---|---|
682
- | 인터랙티브 터미널 | 항상 `mix` / `gpt` / `glm`을 묻고 3티어 모델을 고르게 하며, `mix`에서는 `codex`와 `glm` primary 에이전트 활성화도 묻습니다 |
683
- | 비대화형 설치 | 모델 pinning을 추측하지 않음; `profile: "mix"`, `models: {}`를 쓰고 `resolver`, `codex`, `glm` primary 경로를 활성화 |
682
+ | 인터랙티브 터미널 | 항상 `mix` / `gpt` / `glm`을 묻고 3티어 모델을 고르게 하며, `mix`에서는 `gpt`와 `glm` primary 에이전트 활성화도 묻습니다 |
683
+ | 비대화형 설치 | opencode.json에서 프로바이더를 자동 감지하여 모델 적응 프리셋 작성. `resolver`, `gpt`, `glm` primary 경로 활성화 |
684
684
  | 레거시 opt-in | `OPENCODE_RESOLVE_AUTO_PRESET=1`을 설정하면 비대화형 provider-adapted 프리셋 허용 |
685
685
  | GLM/ZAI 감지 | API 키를 복사하지 않고 ZAI MCP 부트스트랩 추가 |
686
686
 
@@ -772,7 +772,7 @@ OPENCODE_RESOLVE_SKIP_POSTINSTALL=1 npm install -g opencode-resolve
772
772
  | `fast` | 빠른/저렴한 모델의 프로바이더 중립적 별칭 |
773
773
  | `strong` | 강력한/비싼 모델의 프로바이더 중립적 별칭 |
774
774
  | `mini` | 미니/효율적 모델의 프로바이더 중립적 별칭 |
775
- | `codex` | 코덱스 스타일 코딩 모델의 프로바이더 중립적 별칭 |
775
+ | `codex` | 코덱스 스타일 코딩 모델의 프로바이더 중립적 별칭 (레거시) |
776
776
  | `bronze` / `silver` / `gold` | scout / coder / reasoner 3티어 별칭 |
777
777
  | `gpt-bronze` / `gpt-silver` / `gpt-gold` | mixed 설정의 GPT/Codex 전용 3티어 별칭 |
778
778
  | `glm-bronze` / `glm-silver` / `glm-gold` | mixed 설정의 GLM 전용 3티어 별칭 |
@@ -790,7 +790,8 @@ OPENCODE_RESOLVE_SKIP_POSTINSTALL=1 npm install -g opencode-resolve
790
790
  | 에이전트 | 기본 | 모드 | Edit | Bash | WebFetch | 용도 |
791
791
  |---|:---:|---|---|---|---|---|
792
792
  | `resolver` | 예 (핵심) | `all` | allow | ask (분류기 라우팅) | allow | 컨텍스트 효율적 오케스트레이터. 작업을 검증된 체크포인트로 분해, coder 디스패치, 각각 검증, 반복 회복 실패 시 차단 사항 보고. |
793
- | `codex` | 아니오 | `all` | allow | ask (분류기 라우팅) | allow | `resolver`와 같은 검증 resolve-loop 스타일의 Codex 최적화 primary. 최초 설치 GPT/mix 프리셋 또는 명시 설정으로 활성화. |
793
+ | `codex` | 아니오 | `all` | allow | ask (분류기 라우팅) | allow | `resolver`와 같은 검증 resolve-loop 스타일의 Codex 최적화 primary. 레거시 GPT 설정에서는 `gpt` 권장. |
794
+ | `gpt` | 아니오 | `all` | allow | ask (분류기 라우팅) | allow | `resolver`와 같은 검증 resolve-loop 스타일의 GPT 최적화 primary. 최초 설치 GPT/mix 프리셋 또는 명시 설정으로 활성화. |
794
795
  | `glm` | 아니오 | `all` | allow | ask (분류기 라우팅) | allow | `resolver`와 같은 검증 resolve-loop 스타일의 GLM 최적화 primary. 최초 설치 GLM/mix 프리셋 또는 명시 설정으로 활성화. |
795
796
  | `coder` | 예 (핵심) | `subagent` | allow | ask (분류기 라우팅) | allow | 집중된 구현자. 가장 작은 올바른 패치. 필요한 파일만 읽음. |
796
797
  | `explorer` | 예 (서브에이전트) | `subagent` | **deny** | **deny** | allow | 내부 빠른 코드베이스 스카우트. Resolver가 범위가 불명확할 때만 디스패치; 좁은 범위는 로컬 read/grep/glob 선호. |
package/README.md CHANGED
@@ -156,8 +156,8 @@ The `postinstall` script automatically:
156
156
 
157
157
  1. Adds `opencode-resolve` to `~/.config/opencode/opencode.json` `plugin` array (if not already present).
158
158
  2. Creates `~/.config/opencode/resolve.json` adapted to your current model provider when the file does not exist:
159
- - **Interactive terminal** → always asks for `mix` / `gpt` / `glm`, then lets you pick three-tier `bronze` / `silver` / `gold` models. In `mix`, it also asks whether to enable dedicated `codex` and `glm` primary agents.
160
- - **Non-interactive install** → does not guess model pinning. It writes `profile: "mix"`, leaves `models: {}`, and enables the three primary routes (`resolver`, `codex`, `glm`) so you can pin models explicitly afterward.
159
+ - **Interactive terminal** → always asks for `mix` / `gpt` / `glm`, then lets you pick three-tier `bronze` / `silver` / `gold` models. In `mix`, it also asks whether to enable dedicated `gpt` and `glm` primary agents.
160
+ - **Non-interactive install** → auto-detects providers from opencode.json and writes a model-adapted preset. Enables `resolver`, `gpt`, and `glm` as primary routes.
161
161
  - **GLM/ZAI model detected** → still adds the non-secret local ZAI MCP bootstrap.
162
162
 
163
163
  Existing `resolve.json` files are **never overwritten without consent**. On reinstall, interactive setup asks whether to update the existing file or back it up and run fresh setup. For non-interactive automation, set `OPENCODE_RESOLVE_REINSTALL=fresh` or `OPENCODE_RESOLVE_REINSTALL=update`.
@@ -679,8 +679,8 @@ When `resolve.json` does **not** exist, postinstall inspects your OpenCode model
679
679
 
680
680
  | Detected provider | Preset |
681
681
  |---|---|
682
- | Interactive terminal | Always prompts for `mix` / `gpt` / `glm`, asks for three-tier model picks, and in `mix` asks whether to enable `codex` and `glm` primary agents |
683
- | Non-interactive install | Does not guess model pinning; writes `profile: "mix"`, `models: {}`, and enables `resolver`, `codex`, and `glm` as primary routes |
682
+ | Interactive terminal | Always prompts for `mix` / `gpt` / `glm`, asks for three-tier model picks, and in `mix` asks whether to enable `gpt` and `glm` primary agents |
683
+ | Non-interactive install | Auto-detects providers from opencode.json and writes a model-adapted preset with `resolver`, `gpt`, and `glm` enabled |
684
684
  | Legacy opt-in | Set `OPENCODE_RESOLVE_AUTO_PRESET=1` to allow non-interactive provider-adapted presets |
685
685
  | GLM/ZAI detected | Adds the ZAI MCP bootstrap without copying API keys |
686
686
 
@@ -772,9 +772,9 @@ In this setup, `plan` uses `openai/gpt-5.3-codex`; native `build`, resolve `code
772
772
  | `fast` | Provider-neutral alias for a fast/cheap model |
773
773
  | `strong` | Provider-neutral alias for a strong/expensive model |
774
774
  | `mini` | Provider-neutral alias for a mini/efficient model |
775
- | `codex` | Provider-neutral alias for a codex-style coding model |
775
+ | `codex` | Provider-neutral alias for a codex-style coding model (legacy) |
776
776
  | `bronze` / `silver` / `gold` | Three-tier scout / coder / reasoner aliases |
777
- | `gpt-bronze` / `gpt-silver` / `gpt-gold` | GPT/Codex-specific three-tier aliases for mixed setups |
777
+ | `gpt-bronze` / `gpt-silver` / `gpt-gold` | GPT-specific three-tier aliases for mixed setups |
778
778
  | `glm-bronze` / `glm-silver` / `glm-gold` | GLM-specific three-tier aliases for mixed setups |
779
779
  | `quick` | Legacy alias (equivalent to `fast`) |
780
780
  | `deep` | Legacy alias (equivalent to `strong`) |
@@ -790,7 +790,8 @@ Aliases only resolve when defined in `models`. Agent names (`coder`, `resolver`,
790
790
  | Agent | Default | Mode | Edit | Bash | WebFetch | Purpose |
791
791
  |---|:---:|---|---|---|---|---|
792
792
  | `resolver` | Yes (core) | `all` | allow | ask (classifier-routed) | allow | Context-efficient orchestrator. Decomposes work into verified checkpoints, dispatches coder, verifies each, and reports blockers when repeated recovery fails. |
793
- | `codex` | No | `all` | allow | ask (classifier-routed) | allow | Codex-optimized primary resolver with the same verified resolve-loop style as `resolver`. Enabled by first-install GPT/mix presets or explicitly. |
793
+ | `codex` | No | `all` | allow | ask (classifier-routed) | allow | Codex-optimized primary resolver. Legacy prefer `gpt` for new GPT setups. |
794
+ | `gpt` | No | `all` | allow | ask (classifier-routed) | allow | GPT-optimized primary resolver with the same verified resolve-loop style as `resolver`. Enabled by first-install GPT/mix presets or explicitly. |
794
795
  | `glm` | No | `all` | allow | ask (classifier-routed) | allow | GLM-optimized primary resolver with the same verified resolve-loop style as `resolver`. Enabled by first-install GLM/mix presets or explicitly. |
795
796
  | `coder` | Yes (core) | `subagent` | allow | ask (classifier-routed) | allow | Focused implementer. Smallest correct patch. Reads only needed files. |
796
797
  | `explorer` | Yes (subagent) | `subagent` | **deny** | **deny** | allow | Internal fast codebase scout. Resolver dispatches when scope is genuinely unknown; prefers local read/grep/glob for narrow scope. |
package/dist/agents.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ResolveAgentName, ResolveAgentConfig, ModelAlias, TierName } from "./types.js";
2
2
  export declare const DEFAULT_MODELS: Partial<Record<ModelAlias, string>>;
3
3
  export declare const DEFAULT_ENABLED: ResolveAgentName[];
4
- export declare const VALID_AGENT_NAMES: readonly ["coder", "reviewer", "resolver", "codex", "glm", "architect", "gpt-coder", "debugger", "researcher", "explorer", "deep-reviewer", "planner"];
4
+ export declare const VALID_AGENT_NAMES: readonly ["coder", "reviewer", "resolver", "codex", "gpt", "glm", "architect", "gpt-coder", "debugger", "researcher", "explorer", "deep-reviewer", "planner"];
5
5
  export declare const VALID_AGENT_NAME_SET: Set<string>;
6
6
  export declare const DEFAULT_AGENT_CONFIG: Record<ResolveAgentName, Required<Pick<ResolveAgentConfig, "mode" | "description" | "prompt" | "color">> & ResolveAgentConfig>;
7
7
  export declare const GLM_CODER_PROMPT: string;
@@ -10,7 +10,7 @@ export declare function buildGLMResolverPrompt(maxParallelSubagents: number | un
10
10
  export declare function buildGPTResolverPrompt(): string;
11
11
  export declare function buildCodexResolverPrompt(): string;
12
12
  export declare function buildResolverPrompt(maxParallelSubagents: number | undefined): string;
13
- export declare const VALID_MODEL_ALIASES: readonly ["coder", "reviewer", "resolver", "codex", "glm", "architect", "gpt-coder", "debugger", "researcher", "explorer", "deep-reviewer", "planner", "glm", "gpt", "quick", "deep", "fast", "strong", "mini", "codex", "bronze", "silver", "gold", "gpt-bronze", "gpt-silver", "gpt-gold", "glm-bronze", "glm-silver", "glm-gold"];
13
+ export declare const VALID_MODEL_ALIASES: readonly ["coder", "reviewer", "resolver", "codex", "gpt", "glm", "architect", "gpt-coder", "debugger", "researcher", "explorer", "deep-reviewer", "planner", "glm", "gpt", "quick", "deep", "fast", "strong", "mini", "codex", "bronze", "silver", "gold", "gpt-bronze", "gpt-silver", "gpt-gold", "glm-bronze", "glm-silver", "glm-gold"];
14
14
  export declare const VALID_MODEL_ALIAS_SET: Set<string>;
15
15
  export declare const VALID_PROFILES: Set<string>;
16
16
  export declare const VALID_TIERS: Set<string>;
package/dist/agents.js CHANGED
@@ -5,6 +5,7 @@ export const VALID_AGENT_NAMES = [
5
5
  "reviewer",
6
6
  "resolver",
7
7
  "codex",
8
+ "gpt",
8
9
  "glm",
9
10
  "architect",
10
11
  "gpt-coder",
@@ -85,6 +86,18 @@ export const DEFAULT_AGENT_CONFIG = {
85
86
  webfetch: "allow",
86
87
  },
87
88
  },
89
+ gpt: {
90
+ mode: "all",
91
+ color: "#FFB347",
92
+ maxSteps: 35,
93
+ description: "GPT-optimized primary resolver for agentic coding work. Use when a GPT/OpenAI coding model is pinned and you want a dedicated user-facing route separate from the neutral resolver.",
94
+ prompt: buildGPTResolverPrompt(),
95
+ permission: {
96
+ edit: "allow",
97
+ bash: "ask",
98
+ webfetch: "allow",
99
+ },
100
+ },
88
101
  architect: {
89
102
  mode: "subagent",
90
103
  color: "#00BFFF",
@@ -270,6 +283,8 @@ export function buildGLMResolverPrompt(maxParallelSubagents) {
270
283
  "NEVER: as any / @ts-ignore / leave code broken / delete failing tests / commit without request.",
271
284
  "",
272
285
  "Specialists: explorer (scope unknown), reviewer (verification gap), debugger (verify failure diagnosis), planner (user asks for plan). No deep-reviewer.",
286
+ "",
287
+ "CONTINUATION: After context compression or any intermediate step, immediately continue the current task. Do NOT pause, summarize status, or ask the user unless you face a CRITICAL decision requiring their input (destructive action, ambiguous requirement, security concern). Keep moving.",
273
288
  ].join("\n");
274
289
  }
275
290
  export function buildGPTResolverPrompt() {
@@ -293,6 +308,8 @@ export function buildGPTResolverPrompt() {
293
308
  "NEVER: as any / @ts-ignore / leave code broken / delete failing tests / commit without request.",
294
309
  "",
295
310
  "Specialists: explorer (scope unknown), reviewer (verification gap), deep-reviewer (risky/security/architectural), debugger (verify failure diagnosis), planner (user asks for plan).",
311
+ "",
312
+ "CONTINUATION: After context compression or any intermediate step, immediately continue the current task. Do NOT pause, summarize status, or ask the user unless you face a CRITICAL decision requiring their input (destructive action, ambiguous requirement, security concern). Keep moving.",
296
313
  ].join("\n");
297
314
  }
298
315
  export function buildCodexResolverPrompt() {
@@ -310,6 +327,8 @@ export function buildCodexResolverPrompt() {
310
327
  "Verify: type check or lint MUST pass on changed files. Check LSP diagnostics when available. NO EVIDENCE = NOT COMPLETE.",
311
328
  "",
312
329
  "NEVER: as any / @ts-ignore / leave code broken / delete failing tests / commit without request.",
330
+ "",
331
+ "CONTINUATION: After context compression or any intermediate step, immediately continue the current task. Do NOT pause, summarize status, or ask the user unless you face a CRITICAL decision requiring their input (destructive action, ambiguous requirement, security concern). Keep moving.",
313
332
  ].join("\n");
314
333
  }
315
334
  export function buildResolverPrompt(maxParallelSubagents) {
@@ -342,6 +361,8 @@ export function buildResolverPrompt(maxParallelSubagents) {
342
361
  "NEVER: as any / @ts-ignore / leave code broken / delete failing tests / commit without request.",
343
362
  "",
344
363
  "Specialists: explorer (scope unknown), reviewer (verification gap), deep-reviewer (risky/security/architectural), debugger (verify failure diagnosis), planner (user asks for plan).",
364
+ "",
365
+ "CONTINUATION: After context compression or any intermediate step, immediately continue the current task. Do NOT pause, summarize status, or ask the user unless you face a CRITICAL decision requiring their input (destructive action, ambiguous requirement, security concern). Keep moving.",
345
366
  ].join("\n");
346
367
  }
347
368
  export const VALID_MODEL_ALIASES = [
@@ -368,11 +389,11 @@ export const VALID_MODEL_ALIAS_SET = new Set(VALID_MODEL_ALIASES);
368
389
  export const VALID_PROFILES = new Set(["mix", "glm", "gpt"]);
369
390
  export const VALID_TIERS = new Set(["bronze", "silver", "gold"]);
370
391
  export const GLM_ENABLED = ["coder", "resolver", "glm", "explorer", "reviewer", "planner"];
371
- export const GPT_ENABLED = ["coder", "resolver", "codex", "explorer", "reviewer", "deep-reviewer", "planner"];
392
+ export const GPT_ENABLED = ["coder", "resolver", "gpt", "explorer", "reviewer", "deep-reviewer", "planner"];
372
393
  export const TIER_ENABLED = {
373
394
  bronze: ["coder", "resolver"],
374
395
  silver: ["coder", "resolver", "explorer", "reviewer", "planner"],
375
- gold: ["coder", "resolver", "codex", "glm", "explorer", "reviewer", "deep-reviewer", "planner", "debugger", "researcher"],
396
+ gold: ["coder", "resolver", "codex", "gpt", "glm", "explorer", "reviewer", "deep-reviewer", "planner", "debugger", "researcher"],
376
397
  };
377
398
  export const GLM_AGENT_OVERRIDES = {
378
399
  coder: { maxSteps: 15 },
@@ -384,7 +405,7 @@ export const GLM_AGENT_OVERRIDES = {
384
405
  export const GPT_AGENT_OVERRIDES = {
385
406
  coder: { maxSteps: 25 },
386
407
  resolver: { maxSteps: 40 },
387
- codex: { maxSteps: 40 },
408
+ gpt: { maxSteps: 40 },
388
409
  explorer: { maxSteps: 8 },
389
410
  reviewer: { maxSteps: 10 },
390
411
  "deep-reviewer": { maxSteps: 15 },
package/dist/types.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  export type PermissionValue = "ask" | "allow" | "deny";
2
- export type ResolveAgentName = "coder" | "reviewer" | "resolver" | "codex" | "glm" | "architect" | "gpt-coder" | "debugger" | "researcher" | "explorer" | "deep-reviewer" | "planner";
2
+ export type ResolveAgentName = "coder" | "reviewer" | "resolver" | "codex" | "gpt" | "glm" | "architect" | "gpt-coder" | "debugger" | "researcher" | "explorer" | "deep-reviewer" | "planner";
3
3
  export type ModelAlias = ResolveAgentName | "glm" | "gpt" | "quick" | "deep" | "fast" | "strong" | "mini" | "codex" | "bronze" | "silver" | "gold" | "gpt-bronze" | "gpt-silver" | "gpt-gold" | "glm-bronze" | "glm-silver" | "glm-gold";
4
4
  export type AgentMode = "subagent" | "primary" | "all";
5
5
  export type ResolveAgentConfig = {
@@ -17,6 +17,9 @@
17
17
  "codex": {
18
18
  "enabled": false
19
19
  },
20
+ "gpt": {
21
+ "enabled": false
22
+ },
20
23
  "explorer": {
21
24
  "enabled": true,
22
25
  "mode": "subagent"
@@ -118,9 +118,9 @@
118
118
 
119
119
  // -----------------------------------------------------------------------
120
120
  // models (object)
121
- // Alias map. Keys are either an agent name (coder, reviewer, resolver,
122
- // codex, glm, architect, gpt-coder, debugger, researcher, explorer,
123
- // deep-reviewer, planner)
121
+ // Alias map. Keys are either an agent name (coder, reviewer, resolver,
122
+ // codex, gpt, glm, architect, gpt-coder, debugger, researcher, explorer,
123
+ // deep-reviewer, planner)
124
124
  // OR one of the well-known aliases (`glm`, `gpt`, `quick`, `deep`,
125
125
  // `fast`, `strong`, `mini`, `codex`, `bronze`, `silver`, `gold`,
126
126
  // `gpt-bronze`, `gpt-silver`, `gpt-gold`, `glm-bronze`, `glm-silver`,
@@ -168,12 +168,12 @@
168
168
  // third-party providers never blocks agent execution.
169
169
  // "models": {
170
170
  // "glm": "zai-coding-plan/glm-5.1",
171
- // "bronze": "zai-coding-plan/glm-5.1",
172
- // "silver": "zai-coding-plan/glm-5.1",
171
+ // "bronze": "zai-coding-plan/glm-4.7-flash",
172
+ // "silver": "zai-coding-plan/glm-5",
173
173
  // "gold": "zai-coding-plan/glm-5.1",
174
174
  // "fast": "bronze",
175
175
  // "strong": "gold",
176
- // "coder": "silver",
176
+ // "coder": "gold",
177
177
  // "resolver": "gold",
178
178
  // "reviewer": "gold",
179
179
  // "deep-reviewer": "gold",
@@ -223,13 +223,26 @@
223
223
 
224
224
  // codex — Codex-optimized primary resolver (selectable in agent picker)
225
225
  // Same verified resolve-loop style as resolver, with a Codex-specific
226
- // system prompt. Enabled by GPT/mix first-install presets when selected.
226
+ // system prompt. Legacy kept for backward compatibility. New GPT
227
+ // installs should prefer the "gpt" agent instead.
227
228
  "codex": {
228
229
  "enabled": false,
229
230
  "mode": "all",
230
231
  "maxSteps": 35
231
232
  },
232
233
 
234
+ // -----------------------------------------------------------------
235
+ // gpt — GPT-optimized primary resolver (selectable in agent picker)
236
+ // GPT-specific verified resolve-loop with parallel coder dispatch,
237
+ // full agent roster, and higher maxSteps. Enabled automatically when
238
+ // GPT profile is selected during install. Uses buildGPTResolverPrompt().
239
+ // -----------------------------------------------------------------
240
+ "gpt": {
241
+ "enabled": false,
242
+ "mode": "all",
243
+ "maxSteps": 35
244
+ },
245
+
233
246
  // Internal specialist subagents — enabled by default as subagents only.
234
247
  // Core path is resolver→coder. These are dispatched only when justified.
235
248
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "opencode-resolve",
3
- "version": "0.1.11",
3
+ "version": "0.1.13",
4
4
  "description": "OpenCode plugin that adds a lightweight resolver/coder harness for continuous agentic coding.",
5
5
  "type": "module",
6
6
  "homepage": "https://github.com/jshsakura/opencode-resolve#readme",
@@ -100,7 +100,7 @@ async function createAdaptiveResolveConfig() {
100
100
  resolveConfig.models = {}
101
101
  resolveConfig.agents = {
102
102
  ...resolveConfig.agents,
103
- codex: { ...(resolveConfig.agents?.codex ?? {}), enabled: true },
103
+ gpt: { ...(resolveConfig.agents?.gpt ?? {}), enabled: true },
104
104
  glm: { ...(resolveConfig.agents?.glm ?? {}), enabled: true },
105
105
  }
106
106
  }
@@ -53,9 +53,13 @@ const OPENAI_MODEL_HINTS = [
53
53
 
54
54
  const GLM_MODEL_HINTS = [
55
55
  "zai-coding-plan/glm-5.1",
56
+ "zai-coding-plan/glm-5",
57
+ "zai-coding-plan/glm-4.7-flash",
58
+ "zai-coding-plan/glm-4.5-flash",
56
59
  "zai/glm-5.1",
57
60
  "zai/glm-5",
58
61
  "zai/glm-4.7-flash",
62
+ "zai/glm-4.7",
59
63
  "zai/glm-4.5-flash",
60
64
  "zai/glm-4.5",
61
65
  "zai/glm-4.5-air",
@@ -221,29 +225,11 @@ async function createAdaptiveResolveConfig(opencodeConfig, scriptedAnswers) {
221
225
  return
222
226
  }
223
227
 
224
- if (process.env.OPENCODE_RESOLVE_AUTO_PRESET !== "1") {
225
- resolveConfig.profile = "mix"
226
- delete resolveConfig.tier
227
- resolveConfig.models = {}
228
- resolveConfig.agents = {
229
- ...resolveConfig.agents,
230
- codex: { ...(resolveConfig.agents?.codex ?? {}), enabled: true },
231
- glm: { ...(resolveConfig.agents?.glm ?? {}), enabled: true },
232
- }
233
- await writeFile(resolveConfigPath, `${JSON.stringify(resolveConfig, null, 2)}\n`)
234
- console.log(`[${packageName}] created ${resolveConfigPath} (preset: prompt-required)`)
235
- console.log(`[${packageName}] model pinning was not guessed because no interactive prompt was available.`)
236
- console.log(`[${packageName}] rerun setup in a TTY or edit ${resolveConfigPath} to choose GPT/GLM three-tier models.`)
237
- return
238
- }
239
-
240
- // Profile selection based on detected providers
241
228
  const hasGLM = allModels.some((m) => isGLMModel(m))
242
229
  const hasGPT = allModels.some((m) => isGPTModel(m))
243
230
  const preset = buildModelPreset(currentModel, allModels)
244
231
 
245
232
  if (hasGLM && !hasGPT) {
246
- // GLM only → GLM profile, silver tier (token-efficient, no deep-reviewer)
247
233
  resolveConfig.profile = "glm"
248
234
  resolveConfig.tier = "silver"
249
235
  resolveConfig.agents = {
@@ -251,20 +237,18 @@ async function createAdaptiveResolveConfig(opencodeConfig, scriptedAnswers) {
251
237
  glm: { ...(resolveConfig.agents?.glm ?? {}), enabled: true },
252
238
  }
253
239
  } else if (hasGPT && !hasGLM) {
254
- // GPT only → GPT profile, gold tier (full power)
255
240
  resolveConfig.profile = "gpt"
256
241
  resolveConfig.tier = "gold"
257
242
  resolveConfig.agents = {
258
243
  ...resolveConfig.agents,
259
- codex: { ...(resolveConfig.agents?.codex ?? {}), enabled: true },
244
+ gpt: { ...(resolveConfig.agents?.gpt ?? {}), enabled: true },
260
245
  }
261
246
  } else {
262
- // Mixed or unknown provider → explicit mix profile. No tier: use DEFAULT_ENABLED.
263
247
  resolveConfig.profile = "mix"
264
248
  if (hasGLM && hasGPT) {
265
249
  resolveConfig.agents = {
266
250
  ...resolveConfig.agents,
267
- codex: { ...(resolveConfig.agents?.codex ?? {}), enabled: true },
251
+ gpt: { ...(resolveConfig.agents?.gpt ?? {}), enabled: true },
268
252
  glm: { ...(resolveConfig.agents?.glm ?? {}), enabled: true },
269
253
  }
270
254
  }
@@ -272,6 +256,9 @@ async function createAdaptiveResolveConfig(opencodeConfig, scriptedAnswers) {
272
256
 
273
257
  if (preset && Object.keys(preset).length > 0) {
274
258
  resolveConfig.models = preset
259
+ } else {
260
+ console.log(`[${packageName}] no GPT/GLM models detected in opencode.json — agents inherit the top-level model`)
261
+ console.log(`[${packageName}] to configure model pinning, rerun setup in a TTY or edit ${resolveConfigPath}`)
275
262
  }
276
263
 
277
264
  await writeFile(resolveConfigPath, `${JSON.stringify(resolveConfig, null, 2)}\n`)
@@ -352,7 +339,11 @@ function buildModelPreset(currentModel, allModels = []) {
352
339
 
353
340
  // GLM / ZAI — GLM-only preset (no GPT dependency, avoids token-exhaustion errors)
354
341
  if (lower.includes("glm") || lower.includes("zai")) {
355
- return buildGLMOnlyPreset(currentModel)
342
+ return buildGLMOnlyPreset(currentModel, glmModels)
343
+ }
344
+
345
+ if (lower.includes("openai/") || lower.includes("gpt")) {
346
+ return buildGPTOnlyPreset(currentModel, gptModels)
356
347
  }
357
348
 
358
349
  // OpenAI / GPT single-provider preset
@@ -364,8 +355,9 @@ function buildModelPreset(currentModel, allModels = []) {
364
355
  return {}
365
356
  }
366
357
 
367
- function buildGLMOnlyPreset(model) {
368
- const tiers = chooseThreeTier(collectModelChoices([model], isGLMModel, GLM_MODEL_HINTS, false), "glm", false)
358
+ function buildGLMOnlyPreset(model, glmModels) {
359
+ const models = glmModels && glmModels.length > 0 ? glmModels : [model]
360
+ const tiers = chooseThreeTier(models, "glm", false)
369
361
  return {
370
362
  glm: tiers.gold,
371
363
  bronze: tiers.bronze,
@@ -374,7 +366,7 @@ function buildGLMOnlyPreset(model) {
374
366
  fast: "bronze",
375
367
  strong: "gold",
376
368
  mini: "bronze",
377
- coder: "silver",
369
+ coder: "gold",
378
370
  resolver: "gold",
379
371
  reviewer: "gold",
380
372
  "deep-reviewer": "gold",
@@ -383,8 +375,9 @@ function buildGLMOnlyPreset(model) {
383
375
  }
384
376
  }
385
377
 
386
- function buildGPTOnlyPreset(model) {
387
- const tiers = chooseThreeTier(collectModelChoices([model], isGPTModel, OPENAI_MODEL_HINTS, false), "gpt", false)
378
+ function buildGPTOnlyPreset(model, gptModels) {
379
+ const models = gptModels && gptModels.length > 0 ? gptModels : [model]
380
+ const tiers = chooseThreeTier(models, "gpt", false)
388
381
  return {
389
382
  gpt: tiers.gold,
390
383
  bronze: tiers.bronze,
@@ -429,12 +422,17 @@ async function buildInteractivePreset(currentModel, allModels, scriptedAnswers)
429
422
  profile: "gpt",
430
423
  tier: "gold",
431
424
  models: buildGPTThreeTierModels(tiers),
432
- agents: { codex: { enabled: true } },
425
+ agents: { gpt: { enabled: true } },
433
426
  }
434
427
  }
435
428
 
436
429
  if (profile === "glm") {
437
- const tiers = await askThreeTier(rl, "GLM", choices.glm)
430
+ const useCodingPlan = await askYesNo(rl, "Use coding-plan (zai-coding-plan) instead of standard (zai)? [y/N]: ", false)
431
+ const glmChoices = useCodingPlan
432
+ ? choices.glm.map((m) => m.replace(/^zai\//, "zai-coding-plan/"))
433
+ : choices.glm.map((m) => m.replace(/^zai-coding-plan\//, "zai/"))
434
+ const deduped = unique([...glmChoices.filter((m) => isGLMModel(m)), ...GLM_MODEL_HINTS])
435
+ const tiers = await askThreeTier(rl, "GLM", deduped)
438
436
  return {
439
437
  label: "glm-three-tier",
440
438
  profile: "glm",
@@ -444,16 +442,16 @@ async function buildInteractivePreset(currentModel, allModels, scriptedAnswers)
444
442
  }
445
443
  }
446
444
 
447
- const useCodex = await askYesNo(rl, "Enable dedicated Codex primary agent too? [Y/n]: ", true)
445
+ const useGPT = await askYesNo(rl, "Enable dedicated GPT primary agent too? [Y/n]: ", true)
448
446
  const useGLM = await askYesNo(rl, "Enable dedicated GLM primary agent too? [Y/n]: ", true)
449
- const gptTiers = await askThreeTier(rl, "Codex/GPT", choices.gpt)
447
+ const gptTiers = await askThreeTier(rl, "GPT", choices.gpt)
450
448
  const glmTiers = await askThreeTier(rl, "GLM", choices.glm)
451
449
  return {
452
450
  label: "mix-three-tier",
453
451
  profile: "mix",
454
452
  models: buildMixedThreeTierModels(gptTiers, glmTiers),
455
453
  agents: {
456
- codex: { enabled: useCodex },
454
+ gpt: { enabled: useGPT },
457
455
  glm: { enabled: useGLM },
458
456
  },
459
457
  }
@@ -564,7 +562,7 @@ function buildGLMThreeTierModels(tiers) {
564
562
  strong: "gold",
565
563
  mini: "bronze",
566
564
  explorer: "bronze",
567
- coder: "silver",
565
+ coder: "gold",
568
566
  resolver: "gold",
569
567
  reviewer: "gold",
570
568
  "deep-reviewer": "gold",
@@ -586,7 +584,7 @@ function chooseThreeTier(models, family, includeFallbackHints = true) {
586
584
  const choices = unique(includeFallbackHints ? [...models, ...fallback] : models)
587
585
  return {
588
586
  bronze: preferModel(choices, family === "glm" ? ["flash", "air", "mini"] : ["spark", "mini", "4o-mini"], choices[0]),
589
- silver: preferModel(choices, family === "glm" ? ["5.1", "4.5"] : ["codex", "5.3", "5.2"], choices[1] ?? choices[0]),
587
+ silver: preferModel(choices, family === "glm" ? ["4.7", "4.5", "5"] : ["codex", "5.3", "5.2"], choices[1] ?? choices[0]),
590
588
  gold: preferModel(choices, family === "glm" ? ["5.1", "5", "4.5"] : ["5.5", "5.4", "gpt-5.3-codex"], choices[2] ?? choices[1] ?? choices[0]),
591
589
  }
592
590
  }