You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1523d57
Browse filesBrowse the repository at this point in the historyBrowse files
-`OPENCODE_CONFIG_DIR` is set for the opencode subprocess (default: `${plugin_dir}/opencode`).
35
-
- Default agent is `shell_cmd_generator` (loaded from `OPENCODE_CONFIG_DIR/agents/shell_cmd_generator.md`).
34
+
- In cold mode, the plugin ensures its bundled agents exist in `${Z_OC_TAB_OPENCODE_WORKDIR}/.opencode/agents/`.
36
35
37
36
### Cold Start vs Attach Mode
38
37
39
-
- Default (safe): do not attach; each TAB request starts opencode as needed and uses `OPENCODE_CONFIG_DIR=${plugin_dir}/opencode`, so the bundled agent works out of the box.
38
+
- Default (safe): do not attach; each TAB request starts opencode as needed.
40
39
- Optional (fast): attach to a running opencode server to avoid warmup overhead.
41
40
- Current upstream limitation: `opencode run --attach ... --agent ...` is broken upstream, so attach mode cannot reliably select an agent until that PR lands.
- Where this plugin looks for its agent/prompt files when it runs `opencode` in cold-start mode.
340
-
- This setting is ignored in warm-start mode, when you attach to a running opencode server.
341
-
- If on your system you already configured opencode official environment variable `OPENCODE_CONFIG_DIR`, a sensible configuration is `export Z_OC_TAB_OPENCODE_CONFIG_DIR=OPENCODE_CONFIG_DIR` to rely this variable. The name is kept separate so that you more flexibility in principle to choose different directories for each of them; though likely you will not want/need to.
342
339
-`Z_OC_TAB_OPENCODE_GNU` (`0` or `1`; default: `1`)
343
340
- Passed to the agent whether to prefer GNU tools over macOS/freeBSD.
344
341
@@ -354,15 +351,15 @@ This plugin bundles two agent definitions (prompt files) for opencode:
- Custom agents: set `Z_OC_TAB_OPENCODE_AGENT_GENERATOR` and/or `Z_OC_TAB_OPENCODE_AGENT_EXPLAINER`.
357
-
- Custom prompts (cold start): point `Z_OC_TAB_OPENCODE_CONFIG_DIR`at your own opencode config directory and provide `agents/<agent>.md`with your preferred instruction set.
354
+
- Custom prompts: copy the agent file under `${Z_OC_TAB_OPENCODE_WORKDIR}/.opencode/agents/` to a new filename and point the plugin at it using `Z_OC_TAB_OPENCODE_AGENT_GENERATOR` and `Z_OC_TAB_OPENCODE_AGENT_EXPLAINER`. Note that the plugin overwrites its own bundled filenames `shell_cmd_generator.md` and `shell_cmd_explainer.md`to keep upgrades deterministic; thus, avoid modifying the bundled agents.
358
355
359
356
Tip: when you are iterating on the agent prompt, use cold start (`Z_OC_TAB_OPENCODE_RUN_MODE=cold`). It's the least confusing setup: you edit a file, reload your shell, and the next TAB uses it.
360
357
361
358
## Cold Start vs Attach Mode
362
359
363
360
- Cold start (default): simplest and most reliable.
364
361
- You do not run/attach to any server.
365
-
- Each TAB request starts`opencode`with this plugin's bundled config (`OPENCODE_CONFIG_DIR=${plugin_dir}/opencode`).
362
+
- Each TAB request runs`opencode`from `Z_OC_TAB_OPENCODE_WORKDIR`, which keeps sessions in the global workspace.
366
363
367
364
- Attach mode (optional): faster if you already run an opencode backend server.
368
365
- Important mental model: the server decides which agents exist. This plugin cannot "upload" an agent to a running server.
0 commit comments