habithive-code 0.2.4 → 0.3.0
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 +94 -0
- package/README.md +88 -117
- package/bin/habithive.mjs +132 -10
- package/docs/COMPATIBILITY.md +158 -0
- package/docs/guide/01-getting-started.md +135 -0
- package/docs/guide/02-modes.md +105 -0
- package/docs/guide/03-model-tree.md +100 -0
- package/docs/guide/04-omniroute.md +98 -0
- package/docs/guide/05-spec-workflow.md +159 -0
- package/docs/guide/06-agents-skills-tools.md +97 -0
- package/docs/guide/07-updates-and-versions.md +115 -0
- package/docs/guide/08-files-and-safety.md +83 -0
- package/docs/guide/09-troubleshooting.md +117 -0
- package/docs/guide/README.md +32 -0
- package/openspec-schemas/intent-driven/schema.yaml +278 -0
- package/openspec-schemas/intent-driven/templates/adr.md +23 -0
- package/openspec-schemas/intent-driven/templates/design.md +19 -0
- package/openspec-schemas/intent-driven/templates/proposal.md +23 -0
- package/openspec-schemas/intent-driven/templates/spec.md +10 -0
- package/openspec-schemas/intent-driven/templates/tasks.md +9 -0
- package/package.json +8 -4
- package/src/config.js +211 -65
- package/src/core.js +70 -37
- package/src/jsonc.js +128 -0
- package/src/omniroute.js +119 -0
- package/src/openspec.js +87 -0
- package/src/plugin.js +214 -78
- package/src/setup.js +173 -37
- package/src/spec.js +45 -0
- package/src/update.js +62 -0
- package/src/versions.js +71 -0
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
# habithive-code compatibility record: dependency refresh
|
|
2
|
+
|
|
3
|
+
Date: 2026-10-23
|
|
4
|
+
Change: `hive-dependency-refresh` (design D7, tasks group 1)
|
|
5
|
+
|
|
6
|
+
## Decision
|
|
7
|
+
|
|
8
|
+
| Pin | Value | Reason |
|
|
9
|
+
|-----|-------|--------|
|
|
10
|
+
| `OPENCODE_PIN` | **1.19.4** (moved from 1.19.0 on 2026-10-28) | Every opencode internal Hive relies on is unchanged from 1.18.34 → 1.19.0 (findings 1 to 6) and from 1.19.0 → 1.19.4 (see "Recheck: opencode 1.19.4"). No blocking difference. |
|
|
11
|
+
| `OMO_SPEC` | **`oh-my-openagent@4.19.1`** (fallback; 5.1.33 is blocked) | oh-my-openagent 5.1.33 moves Hive's model-tree file out of the way on first plugin load and discards its `agents` and `categories` (finding 9). Hive reads and writes that file today (`OMO_CONFIG` in `src/core.js`), so 5.x needs a code change (target `~/.omo/omo.jsonc`), which is a separate change. The combination opencode 1.19.0 + oh-my-openagent 4.19.1 was verified headless (finding 9). |
|
|
12
|
+
|
|
13
|
+
Consequence for this change: set `OMO_SPEC = "oh-my-openagent@4.19.1"` in `src/versions.js` (it currently reads 5.1.33). Design D8 (baseline refresh after an oh-my-openagent migration) and task 3.4 do not apply while the pin stays on 4.19.1.
|
|
14
|
+
|
|
15
|
+
## Tested versions
|
|
16
|
+
|
|
17
|
+
| Component | Previous | Tested | Status |
|
|
18
|
+
|-----------|----------|--------|--------|
|
|
19
|
+
| opencode | 1.18.34 | 1.19.0 | Compatible (binary inspection and headless run). Live TUI checks pending. |
|
|
20
|
+
| opencode | 1.19.0 | 1.19.4 | Compatible (binary inspection, headless OMO 4.19.1 and OmniRoute runs). Pinned. Live TUI checks pending. |
|
|
21
|
+
| @opencode-ai/plugin (SDK) | 1.18.34 | 1.19.0 | `dist/tui.d.ts` identical to 1.18.34. |
|
|
22
|
+
| oh-my-openagent | 4.19.1 | 5.1.33 | **Blocked** for Hive as built (finding 9). Not pinned. |
|
|
23
|
+
| oh-my-openagent | 4.19.1 | 4.19.1 on opencode 1.19.0 | Compatible (headless): overrides in `oh-my-openagent.json` applied, file byte-identical after load. |
|
|
24
|
+
| openspec | 1.5.0 | 1.14.1 | Compatible. Every command the repo workflow uses exists. |
|
|
25
|
+
| graphify (graphifyy) | 0.9.88 | 0.9.90 | Compatible. Every subcommand and flag used by the bundled skill exists. |
|
|
26
|
+
| @playwright/mcp | unpinned (`@latest`) | 0.0.83 | Informational: 0.0.83 is the current `latest` dist-tag (node >= 18). Hive keeps `@latest`. |
|
|
27
|
+
|
|
28
|
+
## Method
|
|
29
|
+
|
|
30
|
+
- Everything ran under a fresh temp directory with `HOME` pointed into it; `opencode-ai@1.19.0` and `opencode-ai@1.18.34` were installed with `npm i --prefix <temp>`, never globally. Nothing under the real `~/.config/opencode`, `~/.habithive`, `~/.local/state/opencode` or `~/.local/bin` was touched.
|
|
31
|
+
- opencode: `strings -n 12` on both binaries; for each internal, a window around a string literal was extracted from both builds and compared after replacing minified identifiers with a placeholder. "Identical" below means the normalized windows are equal (windows of 400 to 9,200 characters).
|
|
32
|
+
- oh-my-openagent: `npm pack` of 4.19.1 and 5.1.33 (`dist/index.js`, `dist/oh-my-opencode.schema.json`), plus live runs of `opencode debug config` (loads the plugin and runs its startup migration) in isolated homes with sample data only.
|
|
33
|
+
- openspec and graphify: run via `npx -y` and `uvx` with temp `HOME` and caches.
|
|
34
|
+
|
|
35
|
+
## Findings
|
|
36
|
+
|
|
37
|
+
### Recheck: opencode 1.19.4 (2026-10-28)
|
|
38
|
+
|
|
39
|
+
Same method as below (isolated HOME, binary literal/normalised-window comparison, headless runs). Full notes: `orchestrate-agents/review/opencode-1.19.4/recheck.md`.
|
|
40
|
+
|
|
41
|
+
- **Same as 1.19.0:** on-screen model order; session restore of agent + model; the four `app.exit` registrations; `model.list` / `model.cycle_recent` / `model.cycle_favorite`; config merge order, `autoupdate`, CLI flags and `--version` format; plugin SDK `dist/` byte-identical; TUI plugin loader literals.
|
|
42
|
+
- **Headless:** oh-my-openagent 4.19.1 loads, an `oracle` override applies, `oh-my-openagent.json` is byte-identical afterwards; a custom `omniroute` provider with no `apiKey` sends the `/connect` key.
|
|
43
|
+
- **Changed, no Hive impact:** the update check is semver-aware and still returns early with `autoupdate: false`; `opencode upgrade` without a target prints "Couldn't check for updates" when the lookup fails (an explicit target is unaffected); `import` help text.
|
|
44
|
+
- **Changelog 1.19.1–1.19.4:** 1.19.1 removes session sharing; 1.19.2 stops offering OpenCode 2.x to 1.x installs; 1.19.3 reasoning variants; 1.19.4 Bun 1.4.4. 1.19.5 (released 2026-10-28) was not tested.
|
|
45
|
+
|
|
46
|
+
### opencode 1.18.34 → 1.19.0
|
|
47
|
+
|
|
48
|
+
| # | Component | Old → new | Difference | Hive impact | Action |
|
|
49
|
+
|---|-----------|-----------|------------|-------------|--------|
|
|
50
|
+
| 1 | TUI on-screen model order (a) | 1.18.34 → 1.19.0 | **Same.** One read of `model.json`. Current model = per-agent in-memory pick (`<store>.model[agent.name]`), else the agent's configured `.model`, else fallback (`--model` arg, config `model`, first valid `recent` entry, provider default). | None. | None. |
|
|
51
|
+
| 2 | Session open restores agent and model (b) | 1.18.34 → 1.19.0 | **Same.** An effect keyed on `sessionID` calls `agent.set(<msg>.agent)` (only when no `--agent` arg) then `model.set(<msg>.model)` and `model.variant.set(...)`. The `--model` arg is applied earlier in `onMount` with `{recent:true}`. | None. | None. |
|
|
52
|
+
| 3 | `app.exit` registrations (c) | 1.18.34 → 1.19.0 | **Same.** Four registrations: "Exit the app" (slash `exit`, `quit`, `q`), "Cancel permission rejection", "Reject permission", "Reject question". | None. | None. |
|
|
53
|
+
| 4 | Built-in model commands (d) | 1.18.34 → 1.19.0 | **Same.** `model.list` (slash `models`, alias `mo`), `model.cycle_recent` (`cycle(1)`: finds the current model in in-memory `recent`, no-op if absent, else sets the agent's pick to the next entry, does not save), `model.cycle_favorite`, plus the two reverse variants. | None. | None. |
|
|
54
|
+
| 5 | Config and update handling (e) | 1.18.34 → 1.19.0 | Global merge order is **the same** (`config.json`, then `opencode.json`, then `opencode.jsonc`; observed in the 1.19.0 run log). `autoupdate` still accepts `true`, `false` or `"notify"`, and `false` (or `OPENCODE_DISABLE_AUTOUPDATE`) still stops the update check entirely. `opencode upgrade [target]` is unchanged. **New in 1.19.0:** `upgrade --major` (moves to OpenCode 2), a skip message pointing at it, and a TUI update dialog with a `/update` command (Update, Skip, Upgrade, Restart). | Pin and `autoupdate:false` (D3) still work. The `/update` dialog is only fed by the update check, which `autoupdate:false` short-circuits, but this needs a live look. | Keep D2 and D3 as designed. Use `opencode upgrade <pin>` (explicit target, never `--major`). |
|
|
55
|
+
| 6 | Plugin SDK (f) | 1.18.34 → 1.19.0 | `dist/tui.d.ts` is **byte-identical**. Present: `api.keymap` (typed `Keymap` from `@opentui/keymap`; the 1.19.0 binary calls `keymap.dispatchCommand`), `api.command.trigger` (deprecated, still works: logs a one-time deprecation then calls `keymap.dispatchCommand`), `api.state.session.messages/permission/question`, `api.app.version`, `api.lifecycle.signal`. Peer dependencies `@opentui/core|keymap|solid >= 0.4.5`, all optional. | None. | None. |
|
|
56
|
+
|
|
57
|
+
### oh-my-openagent 4.19.1 → 5.1.33
|
|
58
|
+
|
|
59
|
+
| # | Component | Old → new | Difference | Hive impact | Action |
|
|
60
|
+
|---|-----------|-----------|------------|-------------|--------|
|
|
61
|
+
| 7 | Schema: agents, categories, top-level keys | 4.19.1 → 5.1.33 | The same 14 agent keys (`OpenCode-Builder`, `atlas`, `build`, `explore`, `hephaestus`, `librarian`, `metis`, `momus`, `multimodal-looker`, `oracle`, `plan`, `prometheus`, `sisyphus`, `sisyphus-junior`); `categories` is still open (any string key). Top-level keys 46 → 46: **`codegraph` removed**, **`ulw_execute` added**. `start_work` was **already in 4.19.1** (not new); in 5.x it is deprecated in favour of `ulw_execute`. Agent entries gain `models` and `reasoning`; category entries gain `models`, `reasoning`, `max_tokens`, `provider_options`, `warn_unavailable`. `reasoningEffort`, `variant` and `fallback_models` remain accepted. Builtin category enum unchanged (8 names), but see finding 11. | Hive's 4 main and 7 sub agents are all present. | None for the schema itself. |
|
|
62
|
+
| 8 | Unknown keys | 4.19.1 → 5.1.33 | The published JSON schema has `additionalProperties:false` at the top level (editor validation only). At runtime unknown keys are reported and ignored: with `bogus_key`, `codegraph`, `start_work` and an unknown agent in `~/.omo/omo.jsonc` the plugin still loaded and applied the `oracle` override. `codegraph` is actively stripped. **The startup migration validates strictly**: the same file produced `[config-migration] legacy configuration changes were not applied ... Unrecognized keys: "bogus_key", "start_work"`, and the migration was skipped (file untouched). | An existing `codegraph` key is harmless. A stray key can silently disable the migration. | Relevant only if 5.x is adopted later. |
|
|
63
|
+
| 9 | **First-run config migration (blocking)** | 4.19.1 → 5.1.33 | 4.19.1 reads `~/.config/opencode/oh-my-openagent.json` in place; in the test it was byte-identical after load (its `migrateConfigFile` rewrites only when one of its migrations applies; applied ids are tracked in `_migrations` or a `.migrations.json` sidecar). **5.1.33 runs `runOpenCodeStartupMigration` on every plugin load.** It discovers `oh-my-openagent.{jsonc,json}` and `oh-my-opencode.{jsonc,json}` in the opencode config dir (and in `.opencode/` from the working directory up to `$HOME`), **moves** them to `~/.omo/migration-backup-<timestamp>-opencode-config/`, and writes `~/.omo/omo.jsonc`. Only `disabled_providers`, `model_fallback`, `models` and `sisyphus_agent` are carried over; **`agents` and `categories` are deleted**. Observed: after one `opencode debug config`, the source file was gone, `omo.jsonc` held only `_migrations`, and Sisyphus fell back to the default model instead of the sample override. User settings are read from `~/.omo/omo.jsonc` (top-level `agents` and `categories`, or an `[opencode]` block); verified that sample overrides there are applied. | **Breaks the model tree.** Hive writes `oh-my-openagent.json` and snapshots it as the baseline; on 5.x the next launch moves the file away and drops every override, and Reset would restore a file OMO no longer reads. | Do not pin 5.x in this change. Follow-up change: point `OMO_CONFIG` at `~/.omo/omo.jsonc`, re-capture the baseline from it, keep the legacy path as a migration source (D8). |
|
|
64
|
+
| 10 | In-place rewrite of `omo.jsonc` | 4.19.1 → 5.1.33 | On first load 5.x rewrites an existing `omo.jsonc` (keeping `omo.jsonc.bak.<timestamp>`): `variant` and `reasoningEffort` become `reasoning`; an agent with `fallback_models` becomes a `models` array (primary first) and **loses its `model` key**; `codegraph` is dropped; `_migrations` is stamped. | Hive reads `agents.<name>.model` back from the file; after the rewrite that field can be absent. | Follow-up change must read `models[0]` as well as `model`. |
|
|
65
|
+
| 11 | Category rename | 4.19.1 → 5.1.33 | `categories.deep` is renamed to `deep-low` (migration `2026-09-category-deep-split`; `deep-high` is a new category). Verified: a `deep` override in `omo.jsonc` came back as `deep-low`. | `KNOWN_CATEGORIES` in `src/core.js` lists `deep`, not `deep-low`/`deep-high`. | Follow-up change: update the category list. |
|
|
66
|
+
| 12 | GPT guard hooks | 4.19.1 → 5.1.33 | Both hooks **still exist** under the same names, enabled by default, disabled via `disabled_hooks`. Both act on `chat.message`; the model id is the part after the last `/`, lowercased. `no-sisyphus-gpt`: agent `sisyphus` and id contains `gpt` and does not match `/gpt-5[.-](?:(?:3[.-])?codex\|[4-9]\|\d{2,})/i` (5.x also exempts ids containing `gpt-6`) switches the session to `hephaestus`. 5.x does this only if Hephaestus is registered; otherwise it shows a toast and keeps Sisyphus. `no-hephaestus-non-gpt`: agent `hephaestus` and id does not contain `gpt` shows an error toast, then **4.19.1 switches the session to `sisyphus`; 5.1.33 throws `HephaestusRequiresGptError` and aborts the message**. Opt-out for both: `agents.hephaestus.allow_non_gpt_model: true` (warning toast only). In both versions Hephaestus is absent from the agent list when its configured model is not a GPT model (observed). | A non-GPT model on Hephaestus (or a non-native GPT on Sisyphus) is rerouted or rejected by OMO, not by Hive. 5.x turns the reroute into a hard error. | Keep Hive's "Hephaestus is GPT-only" label. Consider surfacing the rule in the model tree. |
|
|
67
|
+
| 13 | Package metadata | 4.19.1 → 5.1.33 | Neither version declares `peerDependencies` or `engines`. 4.19.1 depends on `@opencode-ai/plugin` and `@opencode-ai/sdk` 1.15.13; 5.1.33 no longer depends on them (dependencies are `@opentui/solid ^0.5.11`, `detect-libc`, `zod`). `dist/tui.js` has no static `@opentui` imports in either version. | No version constraint ties OMO to a specific opencode release. | Live check that the OMO TUI plugin loads on 1.19.0 (only matters for 5.x). |
|
|
68
|
+
| 14 | `tui.json` and telemetry (informational) | 4.19.1 → 5.1.33 | Both versions contain `ensureTuiPluginEntry`, which writes the plugin entry into `tui.json` when absent (observed on both). Anonymous telemetry is enabled by default in both; opt out with `telemetry: false` or `OMO_DISABLE_POSTHOG`. | Hive already manages `tui.json` per mode. Telemetry default may matter in a healthcare setting. | Informational. |
|
|
69
|
+
|
|
70
|
+
### openspec 1.5.0 → 1.14.1
|
|
71
|
+
|
|
72
|
+
| # | Component | Old → new | Difference | Hive impact | Action |
|
|
73
|
+
|---|-----------|-----------|------------|-------------|--------|
|
|
74
|
+
| 15 | `init --tools opencode .` and CLI | 1.5.0 → 1.14.1 | Generated: 5 skills and 5 commands → **6 and 6** (adds `.opencode/commands/opsx-update.md` and `.opencode/skills/openspec-update-change/SKILL.md`); also creates `openspec/specs/.gitkeep` and `openspec/changes/archive/.gitkeep`. Common files: `opsx-apply`, `opsx-archive`, `opsx-explore`, `opsx-propose`, `opsx-sync` and the five matching skills. The propose command gains a "Planning boundary" paragraph. Six more workflows (`new`, `continue`, `ff`, `bulk-archive`, `verify`, `onboard`) are available through `openspec config profile`. CLI: new `version` command; `validate` adds `--archived --report`; `status` adds `--all`; `list` adds `--archived --all`. Everything the repo's commands call (`list --json`, `status --change/--json`, `instructions [apply] --change`, `new change`, `store list --json`, `validate --type change --strict`) exists, and `openspec validate hive-dependency-refresh --type change --strict` passes on 1.14.1. | None for Hive (it does not bundle openspec). | None. |
|
|
75
|
+
|
|
76
|
+
### graphify (graphifyy) 0.9.88 → 0.9.90
|
|
77
|
+
|
|
78
|
+
| # | Component | Old → new | Difference | Hive impact | Action |
|
|
79
|
+
|---|-----------|-----------|------------|-------------|--------|
|
|
80
|
+
| 16 | CLI and skill | 0.9.88 → 0.9.90 | `graphify --help` differs in three places: `hook install` now also installs a `post-merge` hook; new `pi guard install`, `pi guard uninstall` and `pi guard path`. No top-level command removed. The 24 real CLI invocations in `skills/graphify/SKILL.md` (`add`, `query`, `path`, `explain`, `update`, `cluster-only`, `merge-graphs`, `clone`, `export <fmt>`, `extract`, `hook`, `save-result`, `benchmark`, `claude`) all resolve, and every flag on them is in the 0.9.90 help. The `/graphify <path> --html`-style flags are slash-command syntax handled by the skill, not CLI flags. The skill file packaged inside the wheel is byte-identical between 0.9.88 and 0.9.90. | None. The bundled `SKILL.md` already differs from the packaged one (frontmatter, `--falkordb` flags, `references/`); that predates this change. | None. Optionally refresh the bundled skill separately (it is byte-identical across both repos). |
|
|
81
|
+
|
|
82
|
+
### Reference machine (informational, read-only)
|
|
83
|
+
|
|
84
|
+
| # | Item | Observation |
|
|
85
|
+
|---|------|-------------|
|
|
86
|
+
| 17 | Stale oh-my-openagent copies | `~/.cache/opencode/packages/node_modules/oh-my-openagent` is 4.13.0 and `~/.cache/opencode/packages/oh-my-openagent@latest` is 4.15.0 (`oh-my-openagent@4.19.1` is also cached). `~/.config/opencode/package.json` still depends on `oh-my-openagent ^4.15.0` and `@opencode-ai/plugin 1.3.17`. None is loaded while the config names an exact version. Not modified. |
|
|
87
|
+
|
|
88
|
+
## Needs live verification
|
|
89
|
+
|
|
90
|
+
These cannot be checked headlessly. Run them in a real TUI, in an isolated `HOME`, after `habithive setup --yes` with the final pins.
|
|
91
|
+
|
|
92
|
+
- [ ] Hive TUI plugin loads on opencode 1.19.0 (no "import-but-skip", factory runs on first chat).
|
|
93
|
+
- [ ] `/habithive` opens and lists the dialogs.
|
|
94
|
+
- [ ] Mode switch complex to simple and simple to complex relaunches and keeps the session (`--session <id>`).
|
|
95
|
+
- [ ] Model tree writes (all, category, agent) reach the file oh-my-openagent 4.19.1 reads, and apply after relaunch.
|
|
96
|
+
- [ ] Reset restores the captured baseline.
|
|
97
|
+
- [ ] Home-screen wordmark renders.
|
|
98
|
+
- [ ] `model.cycle_recent` after a session restore: the restored model is found in `recent` (otherwise the command is a no-op, as in 1.18.34).
|
|
99
|
+
- [ ] The `/update` dialog does not appear with `autoupdate: false`.
|
|
100
|
+
- [ ] Hephaestus set to a non-GPT model in the model tree: confirm the 4.19.1 behaviour (error toast, then the session switches to Sisyphus).
|
|
101
|
+
- [ ] (Only for the follow-up that adopts oh-my-openagent 5.x) OMO TUI plugin loads on 1.19.0, and the `~/.omo/omo.jsonc` path round-trips through Hive's model tree.
|
|
102
|
+
|
|
103
|
+
## OmniRoute key source (opencode 1.19.0)
|
|
104
|
+
|
|
105
|
+
Headless experiment: opencode-ai 1.19.0 in an isolated `HOME`, a local OpenAI-compatible stub logging the `Authorization` header, custom provider `omniroute` (`@ai-sdk/openai-compatible`, `options.baseURL` only unless stated), run with `opencode run -m omniroute/auto/fast "say ok"`. Only fake keys were used.
|
|
106
|
+
|
|
107
|
+
| Case | Config (`options`) | Env `OMNIROUTE_API_KEY` | auth.json (`/connect`) | Authorization sent | Conclusion |
|
|
108
|
+
|------|--------------------|-------------------------|------------------------|--------------------|------------|
|
|
109
|
+
| A | no `apiKey` | unset | `connect-key-123` | `Bearer connect-key-123` | The `/connect` key is used. |
|
|
110
|
+
| B | `apiKey: "{env:OMNIROUTE_API_KEY}"` | unset | `connect-key-123` | none (no header) | The empty `{env:}` result shadows the `/connect` key. |
|
|
111
|
+
| C | `apiKey: "{env:OMNIROUTE_API_KEY}"` | `env-key-456` | `connect-key-123` | `Bearer env-key-456` | The config `apiKey` wins over auth.json. |
|
|
112
|
+
| D | no `apiKey` | unset | none | none (no header) | The provider is still allowed (defined in config) and the request is sent unauthenticated. |
|
|
113
|
+
|
|
114
|
+
Conclusion: a provider block with no `apiKey` line plus a key saved through `/connect` is sufficient. A leftover `apiKey: "{env:OMNIROUTE_API_KEY}"` line breaks `/connect` unless that variable is exported.
|
|
115
|
+
|
|
116
|
+
Guidance: if your `opencode.jsonc` still has `"apiKey": "{env:OMNIROUTE_API_KEY}"` under `provider.omniroute.options`, delete that line (or export the variable) so the `/connect` key is sent.
|
|
117
|
+
|
|
118
|
+
## OpenCode 2
|
|
119
|
+
|
|
120
|
+
Date: 2026-10-23
|
|
121
|
+
Change: `hive-opencode-v2-guard` (ADR-0010; research: `review/opencode-2/SUMMARY.md`)
|
|
122
|
+
|
|
123
|
+
### Status
|
|
124
|
+
|
|
125
|
+
- OpenCode 2 is stable: 2.0.0 shipped 2026-09-11, current 2.1.3 (npm `@opencode/cli`, Homebrew `anomalyco/tap/opencode-v2`).
|
|
126
|
+
- OpenCode 1 is still patched (`opencode-ai` 1.19.4, 2026-10-22), no end-of-life date announced.
|
|
127
|
+
- `opencode upgrade --major` (from 1.19) moves an install to OpenCode 2: npm-family installs swap `opencode-ai` for `@opencode/cli`, brew swaps the formula, curl replaces the binary; data is migrated in place.
|
|
128
|
+
|
|
129
|
+
### What breaks
|
|
130
|
+
|
|
131
|
+
| Area | On OpenCode 2 |
|
|
132
|
+
|------|---------------|
|
|
133
|
+
| oh-my-openagent | 4.19.1 fails to load; 5.x loads only a stub that toasts a redirect to a separate product (OmO Native). Agents, tools and hooks do not run. **Complex mode and the model tree have no engine.** |
|
|
134
|
+
| Plugin module | The v1 `{ id, tui }` shape is gone (new `{ id, setup(context) }`); the Hive plugin does not load (non-fatal). TUI plugin wiring moves to `cli.json`; no `home_logo` slot. |
|
|
135
|
+
| CLI | `--version` prints `opencode v2.x`; `--model`, `--agent`, `--fork`, `--pure` are rejected; `opencode upgrade 1.19.0` fails (404), so Hive cannot downgrade through OpenCode 2. |
|
|
136
|
+
| Credentials, process model | `/connect` keys move to SQLite; the TUI is a client of a shared background service. |
|
|
137
|
+
| Unchanged | Config files and merge order, `autoupdate`, `provider` blocks, `model.json`. |
|
|
138
|
+
|
|
139
|
+
### Decision
|
|
140
|
+
|
|
141
|
+
ADR-0010: Hive stays on OpenCode 1 (pinned, ADR-0003). OpenCode 2 is unsupported until a complex-mode engine exists on it (OmO Native is evaluated separately).
|
|
142
|
+
|
|
143
|
+
Behaviour:
|
|
144
|
+
|
|
145
|
+
- The launcher replaces the "not the tested version" line with a notice (OpenCode 2 detected, Hive needs OpenCode 1, recovery steps for the detected install method) and still starts opencode.
|
|
146
|
+
- `habithive status` adds a line saying OpenCode 2 is not supported.
|
|
147
|
+
- `habithive setup` and `habithive reconcile` (so `habithive update`) never run `opencode upgrade` against OpenCode 2; they print the recovery steps and continue.
|
|
148
|
+
- Install method comes from the resolved path of `opencode` on PATH (npm, brew, curl, else unknown, which lists all three). Hive never uninstalls or reinstalls opencode for you.
|
|
149
|
+
|
|
150
|
+
- npm: `npm rm -g @opencode/cli`, then `habithive setup`
|
|
151
|
+
- Homebrew: `brew uninstall opencode-v2`, then `habithive setup`
|
|
152
|
+
- curl installer: `curl -fsSL https://opencode.ai/install | bash -s -- --version 1.19.0`
|
|
153
|
+
|
|
154
|
+
Sessions created under OpenCode 2 may not open in OpenCode 1 (OpenCode 2 migrates data in place; the reverse is not verified).
|
|
155
|
+
|
|
156
|
+
## OpenSpec 1.5.0 pin
|
|
157
|
+
|
|
158
|
+
Hive pins `@fission-ai/openspec` at 1.5.0. OpenSpec 1.14.x rejects `generates` paths containing `..`, and the intent-driven schema's ADR step writes outside the change folder (`../../adr/`), so the schema fails validation there. 1.5.0 accepts it. `habithive setup` installs the pin and copies the bundled intent-driven schema to the user-level OpenSpec schemas folder; OpenSpec 1.5.0 needs Node 20.19 or newer. See ADR-0011.
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# 1. Getting started
|
|
2
|
+
|
|
3
|
+
## What it is
|
|
4
|
+
|
|
5
|
+
Hive installs and wires opencode, oh-my-openagent, the Hive plugin, extra tools and skills with one command, then launches opencode in complex mode. This chapter takes you from nothing to a verified install. The command is `habithive`; `hive` is the same command.
|
|
6
|
+
|
|
7
|
+
## Prerequisites
|
|
8
|
+
|
|
9
|
+
| Need | Why |
|
|
10
|
+
|------|-----|
|
|
11
|
+
| Node.js 20.19 or newer | OpenSpec 1.5.0 requires it. Hive checks at start and exits with a message if Node is older. |
|
|
12
|
+
| Internet access | First setup fetches opencode, oh-my-openagent, OpenSpec and graphify. |
|
|
13
|
+
| `uv` or `pip` (Python) | Installs the graphify CLI. If neither exists, setup warns and continues. |
|
|
14
|
+
|
|
15
|
+
Upgrade Node with a version manager, for example:
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
nvm install 22
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Install
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
npm i -g habithive-code
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
If npm fails with `EACCES`, its global prefix is not writable. Do not use `sudo`. Use a user-owned prefix or a Node version manager:
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
mkdir -p ~/.npm-global && npm config set prefix ~/.npm-global
|
|
31
|
+
export PATH="$HOME/.npm-global/bin:$PATH" # add to your shell profile
|
|
32
|
+
npm i -g habithive-code
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
On version 0.2.4 or earlier `habithive update` does not exist. Upgrade once with `npm i -g habithive-code@latest && habithive setup`. Setup leaves you in complex mode; if you used simple mode, run `habithive simple` once afterwards. Setup also removes comments from the config files it changes; the original is kept as a `.habithive-bak-<timestamp>` file next to each one (see [Files and safety](08-files-and-safety.md)).
|
|
36
|
+
|
|
37
|
+
## Run setup
|
|
38
|
+
|
|
39
|
+
```sh
|
|
40
|
+
habithive setup
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Setup asks before installing opencode if it is missing (`--yes` or `-y` skips the question). It is always a full install; `--minimal` is ignored with a message. Steps, in order:
|
|
44
|
+
|
|
45
|
+
| Step | What it does |
|
|
46
|
+
|------|--------------|
|
|
47
|
+
| opencode | Installs `opencode-ai` at the pinned version, or runs `opencode upgrade <pin>` if another 1.x is present. OpenCode 2 is never touched; setup prints how to go back. |
|
|
48
|
+
| oh-my-openagent | Adds `oh-my-openagent@4.19.1` to the complex mode config. |
|
|
49
|
+
| Hive plugin | Adds the Hive plugin `file://` entry to `tui.json` in both modes. |
|
|
50
|
+
| autoupdate | Sets `"autoupdate": false` in `opencode.jsonc`. |
|
|
51
|
+
| OmniRoute | Adds or refreshes the OmniRoute provider (38 models) with a placeholder address. |
|
|
52
|
+
| Playwright MCP | Adds the `playwright` MCP server if absent. |
|
|
53
|
+
| OpenSpec | Installs `@fission-ai/openspec@1.5.0` if the installed version differs. |
|
|
54
|
+
| intent-driven schema | Copies the schema to `~/.local/share/openspec/schemas/intent-driven`. |
|
|
55
|
+
| graphify | Installs or upgrades `graphifyy` via `uv` or `pip`. |
|
|
56
|
+
| Skills | Copies bundled skills to `~/.config/opencode/skills/`. |
|
|
57
|
+
|
|
58
|
+
On the first setup Hive records complex mode in `~/.habithive/mode`. Running setup again is safe: it changes only what differs and writes nothing when everything is current. If a config file cannot be parsed, setup stops and prints `file:line:column`. If `hive` on your PATH is another program, setup warns; use `habithive`.
|
|
59
|
+
|
|
60
|
+
## First launch
|
|
61
|
+
|
|
62
|
+
```sh
|
|
63
|
+
habithive
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
This starts a new session in complex mode. Other forms:
|
|
67
|
+
|
|
68
|
+
```sh
|
|
69
|
+
habithive simple # vanilla opencode
|
|
70
|
+
habithive -c # continue the last session
|
|
71
|
+
habithive -s <id> # continue a specific session
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Enable OmniRoute
|
|
75
|
+
|
|
76
|
+
Every install includes the OmniRoute provider pointing at `http://localhost:20128/v1`. If you are eligible, point it at your team's gateway, then add your key in opencode:
|
|
77
|
+
|
|
78
|
+
```sh
|
|
79
|
+
habithive --gateway <ip>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Pass the IP only; Hive adds `http://` and port 20128. Then run `/connect` in opencode, pick OmniRoute and paste your key. Hive never writes a key. See [OmniRoute](04-omniroute.md).
|
|
83
|
+
|
|
84
|
+
## Verify
|
|
85
|
+
|
|
86
|
+
```sh
|
|
87
|
+
habithive status # prints "habithive: complex mode"
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
In opencode: `/habithive` opens the Hive menu and `/hive-models` opens the model tree. The home screen shows the HABITHIVE wordmark.
|
|
91
|
+
|
|
92
|
+
## Install from a source checkout
|
|
93
|
+
|
|
94
|
+
```sh
|
|
95
|
+
git clone https://repository.hclhealthcare.in/hive/habit-hive-code.git
|
|
96
|
+
cd habit-hive-code
|
|
97
|
+
npm test # every suite should report 0 failed
|
|
98
|
+
node bin/habithive.mjs status # smoke test, nothing installed globally
|
|
99
|
+
npm i -g .
|
|
100
|
+
habithive setup
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
You need a GitLab account with access to the `hive` group. From a checkout, `habithive update` never reinstalls from npm; it prints `git -C <checkout> pull && habithive update`.
|
|
104
|
+
|
|
105
|
+
## Migrating from the previous package name
|
|
106
|
+
|
|
107
|
+
`habithive-code` replaces an earlier package with a different name and plugin entry. If the old one is still wired into any opencode config, both load and two wordmarks stack on the home screen. opencode reads plugins from the global config and from per-project configs (`opencode.json`, `opencode.jsonc`, `.opencode/opencode.json`), so clean both:
|
|
108
|
+
|
|
109
|
+
```sh
|
|
110
|
+
npm rm -g maliv-code
|
|
111
|
+
rm -rf ~/.maliv
|
|
112
|
+
find ~ -not -path "*/node_modules/*" -not -path "*/.git/*" -not -path "*/Library/*" \( -name "tui.json" -o -name "opencode.json" -o -name "opencode.jsonc" \) -print0 2>/dev/null \
|
|
113
|
+
| xargs -0 grep -l "maliv" 2>/dev/null \
|
|
114
|
+
| while read -r f; do
|
|
115
|
+
echo "cleaning: $f"
|
|
116
|
+
node -e '
|
|
117
|
+
const fs = require("fs");
|
|
118
|
+
const p = process.argv[1];
|
|
119
|
+
const raw = fs.readFileSync(p, "utf8");
|
|
120
|
+
const c = JSON.parse(raw.replace(/\/\*[\s\S]*?\*\//g, "").replace(/^\s*\/\/.*$/gm, ""));
|
|
121
|
+
if (Array.isArray(c.plugin)) c.plugin = c.plugin.filter(e => !String(e).includes("maliv"));
|
|
122
|
+
fs.writeFileSync(p, JSON.stringify(c, null, 2) + "\n");
|
|
123
|
+
' "$f"
|
|
124
|
+
done
|
|
125
|
+
habithive setup
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
The script rewrites each file as plain JSON, so comments in those files are lost. If a cleaned file is tracked by git in a shared project, commit that fix, or teammates will bring the old entry back. Skip this section if you never had the old package.
|
|
129
|
+
|
|
130
|
+
## Related
|
|
131
|
+
|
|
132
|
+
- [Modes](02-modes.md)
|
|
133
|
+
- [OmniRoute](04-omniroute.md)
|
|
134
|
+
- [Files and safety](08-files-and-safety.md)
|
|
135
|
+
- [Troubleshooting](09-troubleshooting.md)
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# Modes: simple and complex
|
|
2
|
+
|
|
3
|
+
## What it is
|
|
4
|
+
|
|
5
|
+
Hive runs opencode in one of two modes. **Complex** mode loads oh-my-openagent (the multi-agent layer) plus Hive's plugin. **Simple** mode is vanilla opencode plus Hive's plugin, with oh-my-openagent off. You can start in either mode and switch at any time, from the shell or from inside opencode, without losing your session.
|
|
6
|
+
|
|
7
|
+
| | Simple | Complex |
|
|
8
|
+
|---|--------|---------|
|
|
9
|
+
| oh-my-openagent | off | on (pinned `oh-my-openagent@4.19.1`) |
|
|
10
|
+
| Hive plugin (`tui.json`) | on | on |
|
|
11
|
+
| Agents, categories, model tree | not used | available |
|
|
12
|
+
| Startup | fastest | loads the agent layer |
|
|
13
|
+
|
|
14
|
+
Complex is the default.
|
|
15
|
+
|
|
16
|
+
## Launching
|
|
17
|
+
|
|
18
|
+
`hive` is the same command as `habithive`.
|
|
19
|
+
|
|
20
|
+
| Command | Result |
|
|
21
|
+
|---------|--------|
|
|
22
|
+
| `habithive` | Complex mode, new session |
|
|
23
|
+
| `habithive simple` | Simple mode, new session |
|
|
24
|
+
| `habithive complex` | Complex mode, new session |
|
|
25
|
+
| `habithive -c` | Continue the last session (also `--continue`) |
|
|
26
|
+
| `habithive -s <id>` | Continue a specific session (also `--session <id>`) |
|
|
27
|
+
| `habithive new` | New session (the default; also `-n`, `--new`) |
|
|
28
|
+
| `habithive status` | Print the current mode and any queued switch |
|
|
29
|
+
|
|
30
|
+
Flags combine with a mode and any other arguments opencode accepts:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
habithive simple -c
|
|
34
|
+
habithive complex -s <id>
|
|
35
|
+
habithive status
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Output of `status` looks like `habithive: complex mode`, with ` · queued → simple` appended if an in-app switch is waiting.
|
|
39
|
+
|
|
40
|
+
On exit, Hive prints the resume commands (`habithive -c` and `habithive -s <id>`). Use those rather than opencode's own `opencode -s` hint so the right mode and plugin load.
|
|
41
|
+
|
|
42
|
+
## Switching inside opencode
|
|
43
|
+
|
|
44
|
+
| Command | What it does |
|
|
45
|
+
|---------|--------------|
|
|
46
|
+
| `/habithive-mode` | Opens the mode menu: switch to Simple or Complex |
|
|
47
|
+
| `/habithive` | Umbrella menu: model tree, switch mode, reset model overrides |
|
|
48
|
+
|
|
49
|
+
Choosing a mode queues the switch and quits opencode. The `habithive` launcher, which is still running, reopens opencode in the new mode and returns to **the same session** (`--session <id>`).
|
|
50
|
+
|
|
51
|
+
Details worth knowing:
|
|
52
|
+
|
|
53
|
+
- A brand-new session with no messages has no saved ID yet, so the relaunch opens a fresh session. Hive never uses `--continue` here, because that would reopen an older conversation.
|
|
54
|
+
- Switching only works when opencode was started by `habithive`. Otherwise Hive shows a toast with the command to run, for example `restart with habithive simple to switch mode`, and does not quit.
|
|
55
|
+
- If a permission or question prompt is open, Hive waits until you answer it before quitting.
|
|
56
|
+
- If opencode ignores the quit, a warning appears after 3 seconds: type `/exit` so Hive can reopen the session.
|
|
57
|
+
|
|
58
|
+
## How a switch works
|
|
59
|
+
|
|
60
|
+
Each mode owns **one complete set of config files**.
|
|
61
|
+
|
|
62
|
+
| Set | Location while active | Location while inactive |
|
|
63
|
+
|-----|-----------------------|-------------------------|
|
|
64
|
+
| Active mode | `~/.config/opencode/` (`opencode.jsonc`, `tui.json`) | n/a |
|
|
65
|
+
| Inactive mode | n/a | `~/.habithive/modes/<mode>/` |
|
|
66
|
+
|
|
67
|
+
Hive also manages `opencode.json` if it lists oh-my-openagent. The list of managed files is recorded in `~/.habithive/modes/files.json`.
|
|
68
|
+
|
|
69
|
+
- **A switch only renames files.** The active set moves to the store and the other set moves into `~/.config/opencode/`. File contents are not edited.
|
|
70
|
+
- **The first switch creates the other set, once,** by copying your active files and adding or removing the oh-my-openagent plugin entry. If either file cannot be parsed, the switch stops and names the file and line. Nothing is changed.
|
|
71
|
+
- **A normal launch writes no config.** Launching in the mode you are already in touches nothing.
|
|
72
|
+
- **Hive's record of the active mode** is `~/.habithive/mode`.
|
|
73
|
+
|
|
74
|
+
### Additions stay in one mode
|
|
75
|
+
|
|
76
|
+
Because the sets are independent, a change you make in one mode is not in the other. Add an MCP server, plugin or provider while in complex mode and it is absent in simple mode. Hive prints this reminder after each switch.
|
|
77
|
+
|
|
78
|
+
To carry a change across, copy it by hand into the other set's file. While in complex mode, the simple set sits in `~/.habithive/modes/simple/`:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
# edit the stored file directly (this is the inactive mode's copy)
|
|
82
|
+
$EDITOR ~/.habithive/modes/simple/opencode.jsonc
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Edit stored files only for the inactive mode. Do not edit them while that mode is active, because the active copy lives in `~/.config/opencode/`. Keep the oh-my-openagent entry out of the simple set.
|
|
86
|
+
|
|
87
|
+
`habithive setup` and `habithive update` apply Hive's own entries (plugin, pins, OmniRoute block) to both sets, so those stay aligned without manual work. See [07-updates-and-versions.md](07-updates-and-versions.md).
|
|
88
|
+
|
|
89
|
+
## Recovering from an interrupted switch
|
|
90
|
+
|
|
91
|
+
A switch writes a journal (`~/.habithive/switch.journal`) before renaming anything. If Hive is killed mid-switch, the next `habithive` launch finishes the switch, or rolls it back if it cannot, and prints one of:
|
|
92
|
+
|
|
93
|
+
- `completed interrupted switch to <mode> mode`
|
|
94
|
+
- `rolled back interrupted switch to <mode> mode (...); still <mode> mode`
|
|
95
|
+
- `could not recover interrupted switch (...); see ~/.habithive/switch.journal`
|
|
96
|
+
|
|
97
|
+
In the last case, compare `~/.habithive/modes/` with `~/.config/opencode/`, restore the files by hand, then delete the journal. An unreadable journal produces a similar message. See [09-troubleshooting.md](09-troubleshooting.md).
|
|
98
|
+
|
|
99
|
+
## Related
|
|
100
|
+
|
|
101
|
+
- [01-getting-started.md](01-getting-started.md): install and first launch
|
|
102
|
+
- [03-model-tree.md](03-model-tree.md): the model tree (complex mode)
|
|
103
|
+
- [08-files-and-safety.md](08-files-and-safety.md): every file Hive touches
|
|
104
|
+
- [09-troubleshooting.md](09-troubleshooting.md)
|
|
105
|
+
- [Guide index](README.md)
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# Model tree
|
|
2
|
+
|
|
3
|
+
## What it is
|
|
4
|
+
|
|
5
|
+
The model tree is a menu inside opencode for choosing which model each oh-my-openagent agent and task tier uses. Open it with `/hive-models` (alias `/hivemodels`) or from the `/habithive` umbrella menu. It is meant for complex mode, where oh-my-openagent is loaded. The on-screen model is changed live through opencode's own picker; everything else is saved to a config file and takes effect after a relaunch, which Hive performs for you.
|
|
6
|
+
|
|
7
|
+
## The rows
|
|
8
|
+
|
|
9
|
+
Rows appear in this order. Each row shows the configured model, such as `→ provider/model`, or `→ (default)` when nothing is set.
|
|
10
|
+
|
|
11
|
+
| Group | Row | Sets |
|
|
12
|
+
|-------|-----|------|
|
|
13
|
+
| Live | **This screen (live)** | Opens opencode's own model picker. Instant, no relaunch. |
|
|
14
|
+
| Everything | **★ Everything (agents + tiers)** | One model for every agent and every tier |
|
|
15
|
+
| Main agents (primary) | **★ All main agents** | The four main agents below |
|
|
16
|
+
| | Sisyphus — ultraworker | `sisyphus` |
|
|
17
|
+
| | Prometheus — plan builder | `prometheus` |
|
|
18
|
+
| | Atlas — plan executor | `atlas` |
|
|
19
|
+
| | Hephaestus — deep (GPT-only) | `hephaestus` |
|
|
20
|
+
| Subagents | **★ All sub agents** | The seven subagents below |
|
|
21
|
+
| | Oracle — deep reasoning / debugging | `oracle` |
|
|
22
|
+
| | Explore — codebase search | `explore` |
|
|
23
|
+
| | Librarian — external docs | `librarian` |
|
|
24
|
+
| | Multimodal-looker — images / visual | `multimodal-looker` |
|
|
25
|
+
| | Metis — plan consultant | `metis` |
|
|
26
|
+
| | Momus — plan critic | `momus` |
|
|
27
|
+
| | Sisyphus-Junior — worker | `sisyphus-junior` |
|
|
28
|
+
| Categories (tiers) | `ultrabrain`, `deep`, `quick`, `visual-engineering`, `artistry`, `writing`, `unspecified-low`, `unspecified-high` | One tier each |
|
|
29
|
+
|
|
30
|
+
Picking a row opens a filterable list of every model from your connected providers. Choose one, or choose **Clear override (use default)** to remove the override for that row. Group rows show `→ all: <model>` when every member agrees and `→ (mixed)` when they differ.
|
|
31
|
+
|
|
32
|
+
## Precedence
|
|
33
|
+
|
|
34
|
+
The most specific setting wins:
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
agent > category > all > default
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
- **agent**: an override on one agent.
|
|
41
|
+
- **category**: an override on a tier.
|
|
42
|
+
- **all**: the "Everything" row.
|
|
43
|
+
- **default**: your original `oh-my-openagent.json`, saved as the baseline (see below).
|
|
44
|
+
|
|
45
|
+
Two behaviors follow from how Hive compiles the settings:
|
|
46
|
+
|
|
47
|
+
- Choosing a model on **Everything** replaces any agent and category overrides, so one model really applies everywhere.
|
|
48
|
+
- If any category override exists, agents without their own override drop their model and inherit from their category, which is how oh-my-openagent cascades.
|
|
49
|
+
|
|
50
|
+
## What is live and what needs a relaunch
|
|
51
|
+
|
|
52
|
+
| Change | Applies |
|
|
53
|
+
|--------|---------|
|
|
54
|
+
| This screen (live) | Immediately. It is opencode's own picker. |
|
|
55
|
+
| Any other row | After a relaunch, which Hive performs (same session) |
|
|
56
|
+
|
|
57
|
+
oh-my-openagent reads its config once at startup. Writing the file does not change a running process, so Hive saves your choice, quits opencode, and the `habithive` launcher reopens the same session. A row saved but not yet in effect shows ` · pending relaunch` after its model.
|
|
58
|
+
|
|
59
|
+
### Main agent models after relaunch
|
|
60
|
+
|
|
61
|
+
opencode restores a session's last-used model when you reopen it, overriding config. To make a main-agent change (Sisyphus, Prometheus, Atlas, Hephaestus, the main group, or Everything) show up on screen, Hive:
|
|
62
|
+
|
|
63
|
+
1. Reorders opencode's recent-models list so the old model and the new one are adjacent.
|
|
64
|
+
2. Leaves a short-lived marker (valid 10 minutes).
|
|
65
|
+
3. After the relaunch, triggers opencode's recent-model cycle exactly once to move the active agent to the new model, and shows a toast such as `sisyphus → provider/model`.
|
|
66
|
+
|
|
67
|
+
If the cycle cannot run, Hive opens the native model picker and shows `select <model> to apply it to <agent>`. Pick the model there.
|
|
68
|
+
|
|
69
|
+
Subagents and tiers never change the on-screen model, so they skip this step.
|
|
70
|
+
|
|
71
|
+
## Safety
|
|
72
|
+
|
|
73
|
+
- **Not started by `habithive`:** Hive does not quit. It saves the change and shows `saved — restart with habithive -c to apply`.
|
|
74
|
+
- **Prompt open:** if a permission or question prompt is open, Hive waits until it is answered, then quits.
|
|
75
|
+
- **Quit ignored:** after 3 seconds a warning asks you to type `/exit` so the session can reopen.
|
|
76
|
+
- **Model rules:** oh-my-openagent enforces them, not Hive. Sisyphus does not accept most GPT models: among GPT models only `gpt-5.4` and newer, `gpt-5-codex` and `gpt-5.3-codex` are accepted (non-GPT models are fine). Hephaestus is GPT-only unless your config sets `allow_non_gpt_model`. If you pick a model that breaks a rule, Hive warns beforehand: oh-my-openagent will reroute and the agent keeps its previous model.
|
|
77
|
+
|
|
78
|
+
## Reset
|
|
79
|
+
|
|
80
|
+
`/habithive` then **Reset all model overrides** clears every override and rewrites `oh-my-openagent.json` from the baseline. Relaunch to apply. It does not quit for you.
|
|
81
|
+
|
|
82
|
+
## Where settings live
|
|
83
|
+
|
|
84
|
+
| File | Role |
|
|
85
|
+
|------|------|
|
|
86
|
+
| `~/.habithive/overrides.json` | Your overrides: `all`, `categories`, `agents` |
|
|
87
|
+
| `~/.habithive/baseline.json` | Snapshot of your original `oh-my-openagent.json`, the "default" and the Reset target |
|
|
88
|
+
| `~/.config/opencode/oh-my-openagent.json` | What oh-my-openagent reads. Hive compiles it from overrides plus baseline. |
|
|
89
|
+
| `~/.habithive/oh-my-openagent.first-backup.json` | Copy of the file as found when the baseline was first captured |
|
|
90
|
+
| `~/.local/state/opencode/model.json` | opencode's own picker state; Hive only reorders its `recent` list |
|
|
91
|
+
|
|
92
|
+
On a fresh install, where `oh-my-openagent.json` does not exist yet, the baseline is empty and Hive writes only your overrides. If you later edit the file yourself, Hive recaptures the baseline once rather than overwriting your changes. Edit overrides through the menu, not by hand in `oh-my-openagent.json`, because Hive rewrites that file when you apply a change.
|
|
93
|
+
|
|
94
|
+
## Related
|
|
95
|
+
|
|
96
|
+
- [02-modes.md](02-modes.md): the model tree needs complex mode
|
|
97
|
+
- [06-agents-skills-tools.md](06-agents-skills-tools.md): what each agent does
|
|
98
|
+
- [04-omniroute.md](04-omniroute.md): OmniRoute models appear in the picker once connected
|
|
99
|
+
- [08-files-and-safety.md](08-files-and-safety.md)
|
|
100
|
+
- [Guide index](README.md)
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# OmniRoute gateway
|
|
2
|
+
|
|
3
|
+
## What it is
|
|
4
|
+
|
|
5
|
+
OmniRoute is your team's model gateway. It exposes an OpenAI-compatible API, so opencode talks to it through the `@ai-sdk/openai-compatible` adapter. Hive ships an `omniroute` provider with a fixed set of 38 models, installed for everyone with a placeholder address (`http://localhost:20128/v1`). The package contains no real gateway address. A developer becomes eligible by pointing Hive at the gateway and adding a key.
|
|
6
|
+
|
|
7
|
+
## Enable OmniRoute on your machine
|
|
8
|
+
|
|
9
|
+
Get the gateway IP from your team, then run:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
habithive --gateway <ip>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Behavior:
|
|
16
|
+
|
|
17
|
+
- Takes the IP only. Hive builds `http://<ip>:20128/v1` itself.
|
|
18
|
+
- Writes the address into the OmniRoute block of **both** mode sets (see [02-modes.md](02-modes.md)), adding the block if it is missing.
|
|
19
|
+
- Prints `OmniRoute enabled (...)` and the files updated, or `already set`.
|
|
20
|
+
- **Exits without launching opencode.**
|
|
21
|
+
- Rejects input that is not a bare dotted IPv4 address: a scheme or port (`pass only the IP address: habithive --gateway <ip>`), out-of-range or malformed numbers (`not a valid IPv4 address: ...`), or no value (`usage: habithive --gateway <ip>`).
|
|
22
|
+
- Stops and names the file, line and column if a config file cannot be parsed.
|
|
23
|
+
|
|
24
|
+
## Add your key
|
|
25
|
+
|
|
26
|
+
Start opencode and run `/connect`, choose OmniRoute, and enter your API key. opencode stores it; Hive never writes or reads secrets. No model is made a default: choose OmniRoute models in the model picker or the [model tree](03-model-tree.md).
|
|
27
|
+
|
|
28
|
+
Who may use the gateway is controlled in the OmniRoute dashboard. Hive has no command to disable access; to remove a developer, change their eligibility there.
|
|
29
|
+
|
|
30
|
+
## What updates do and do not touch
|
|
31
|
+
|
|
32
|
+
`habithive update`, `habithive reconcile` and `habithive setup` keep the block current.
|
|
33
|
+
|
|
34
|
+
| Hive keeps aligned | Hive never touches |
|
|
35
|
+
|--------------------|--------------------|
|
|
36
|
+
| Provider `name` (`OmniRoute`) | The address (`options.baseURL`) once set |
|
|
37
|
+
| Adapter (`@ai-sdk/openai-compatible`) | Any `apiKey` in the block |
|
|
38
|
+
| The 38 shipped model entries (names and limits) | Models you added yourself |
|
|
39
|
+
| | Everything outside `provider.omniroute` |
|
|
40
|
+
|
|
41
|
+
An update never changes the address. If the address is empty or missing, it is reset to the placeholder.
|
|
42
|
+
|
|
43
|
+
### Old `apiKey` line
|
|
44
|
+
|
|
45
|
+
If your block has `"apiKey": "{env:OMNIROUTE_API_KEY}"` from an older hand-copied config, either export `OMNIROUTE_API_KEY` or delete that line. With the variable unset, opencode sends no key and ignores the one saved by `/connect`. Hive does not add or remove that line. Evidence is in [../COMPATIBILITY.md](../COMPATIBILITY.md).
|
|
46
|
+
|
|
47
|
+
## The 38 shipped models
|
|
48
|
+
|
|
49
|
+
Reference for the `omniroute` provider. Context and input limits are equal. Every model is marked as supporting reasoning, temperature and tool calls. Generated from `OMNIROUTE_MODELS` in `src/omniroute.js`.
|
|
50
|
+
|
|
51
|
+
| Model id | Context | Input | Output |
|
|
52
|
+
|----------|---------|-------|--------|
|
|
53
|
+
| `auto/best-coding` | 1,000,000 | 1,000,000 | 384,000 |
|
|
54
|
+
| `auto/best-reasoning` | 1,000,000 | 1,000,000 | 384,000 |
|
|
55
|
+
| `auto/best-fast` | 1,000,000 | 1,000,000 | 384,000 |
|
|
56
|
+
| `auto/best-vision` | 200,000 | 200,000 | 131,072 |
|
|
57
|
+
| `auto/best-chat` | 1,000,000 | 1,000,000 | 384,000 |
|
|
58
|
+
| `auto/best-coding-fast` | 1,000,000 | 1,000,000 | 384,000 |
|
|
59
|
+
| `auto/pro-coding` | 1,000,000 | 1,000,000 | 384,000 |
|
|
60
|
+
| `auto/pro-reasoning` | 1,000,000 | 1,000,000 | 384,000 |
|
|
61
|
+
| `auto/pro-vision` | 128,000 | 128,000 | 8,192 |
|
|
62
|
+
| `auto/pro-chat` | 1,000,000 | 1,000,000 | 384,000 |
|
|
63
|
+
| `auto/pro-fast` | 1,000,000 | 1,000,000 | 384,000 |
|
|
64
|
+
| `auto/coding` | 1,000,000 | 1,000,000 | 384,000 |
|
|
65
|
+
| `auto/fast` | 1,000,000 | 1,000,000 | 384,000 |
|
|
66
|
+
| `auto/chat` | 1,000,000 | 1,000,000 | 384,000 |
|
|
67
|
+
| `auto/cheap` | 1,000,000 | 1,000,000 | 384,000 |
|
|
68
|
+
| `auto/offline` | 1,000,000 | 1,000,000 | 384,000 |
|
|
69
|
+
| `auto/smart` | 1,000,000 | 1,000,000 | 384,000 |
|
|
70
|
+
| `auto/claude-opus` | 1,000,000 | 1,000,000 | 384,000 |
|
|
71
|
+
| `auto/claude-sonnet` | 1,000,000 | 1,000,000 | 384,000 |
|
|
72
|
+
| `auto/best-free` | 1,000,000 | 1,000,000 | 384,000 |
|
|
73
|
+
| `auto/best-chaos` | 1,000,000 | 1,000,000 | 384,000 |
|
|
74
|
+
| `auto/chaos` | 1,000,000 | 1,000,000 | 384,000 |
|
|
75
|
+
| `auto/coding:fast` | 1,000,000 | 1,000,000 | 384,000 |
|
|
76
|
+
| `auto/coding:cheap` | 1,000,000 | 1,000,000 | 384,000 |
|
|
77
|
+
| `auto/coding:free` | 1,000,000 | 1,000,000 | 384,000 |
|
|
78
|
+
| `auto/coding:pro` | 128,000 | 128,000 | 8,192 |
|
|
79
|
+
| `auto/coding:reliable` | 1,000,000 | 1,000,000 | 384,000 |
|
|
80
|
+
| `auto/reasoning` | 1,000,000 | 1,000,000 | 384,000 |
|
|
81
|
+
| `auto/reasoning:pro` | 128,000 | 128,000 | 8,192 |
|
|
82
|
+
| `auto/vision` | 200,000 | 200,000 | 131,072 |
|
|
83
|
+
| `auto/multimodal` | 200,000 | 200,000 | 131,072 |
|
|
84
|
+
| `auto/glm` | 1,000,000 | 1,000,000 | 131,072 |
|
|
85
|
+
| `auto/minimax` | 128,000 | 128,000 | 8,192 |
|
|
86
|
+
| `auto/mimo` | 200,000 | 200,000 | 131,072 |
|
|
87
|
+
| `auto/zai` | 128,000 | 128,000 | 8,192 |
|
|
88
|
+
| `auto/gemma` | 128,000 | 128,000 | 8,192 |
|
|
89
|
+
| `auto/llama` | 128,000 | 128,000 | 8,192 |
|
|
90
|
+
| `auto/gemini` | 1,048,576 | 1,048,576 | 65,535 |
|
|
91
|
+
|
|
92
|
+
## Related
|
|
93
|
+
|
|
94
|
+
- [01-getting-started.md](01-getting-started.md)
|
|
95
|
+
- [03-model-tree.md](03-model-tree.md): assign OmniRoute models to agents
|
|
96
|
+
- [07-updates-and-versions.md](07-updates-and-versions.md)
|
|
97
|
+
- [09-troubleshooting.md](09-troubleshooting.md)
|
|
98
|
+
- [Guide index](README.md)
|