Revert "refactor(honcho): write all host-scoped settings into hosts block"
This reverts commit c90ba029ce.
This commit is contained in:
parent
c90ba029ce
commit
4c54c2709c
3 changed files with 28 additions and 42 deletions
|
|
@ -121,20 +121,20 @@ def cmd_setup(args) -> None:
|
||||||
|
|
||||||
hermes_host.setdefault("aiPeer", HOST)
|
hermes_host.setdefault("aiPeer", HOST)
|
||||||
|
|
||||||
# Memory mode (host-scoped)
|
# Memory mode
|
||||||
current_mode = hermes_host.get("memoryMode") or cfg.get("memoryMode", "hybrid")
|
current_mode = cfg.get("memoryMode", "hybrid")
|
||||||
print(f"\n Memory mode options:")
|
print(f"\n Memory mode options:")
|
||||||
print(" hybrid — write to both Honcho and local MEMORY.md (default)")
|
print(" hybrid — write to both Honcho and local MEMORY.md (default)")
|
||||||
print(" honcho — Honcho only, skip MEMORY.md writes")
|
print(" honcho — Honcho only, skip MEMORY.md writes")
|
||||||
print(" local — MEMORY.md only, Honcho disabled")
|
print(" local — MEMORY.md only, Honcho disabled")
|
||||||
new_mode = _prompt("Memory mode", default=current_mode)
|
new_mode = _prompt("Memory mode", default=current_mode)
|
||||||
if new_mode in ("hybrid", "honcho", "local"):
|
if new_mode in ("hybrid", "honcho", "local"):
|
||||||
hermes_host["memoryMode"] = new_mode
|
cfg["memoryMode"] = new_mode
|
||||||
else:
|
else:
|
||||||
hermes_host["memoryMode"] = "hybrid"
|
cfg["memoryMode"] = "hybrid"
|
||||||
|
|
||||||
# Write frequency (host-scoped)
|
# Write frequency
|
||||||
current_wf = str(hermes_host.get("writeFrequency") or cfg.get("writeFrequency", "async"))
|
current_wf = str(cfg.get("writeFrequency", "async"))
|
||||||
print(f"\n Write frequency options:")
|
print(f"\n Write frequency options:")
|
||||||
print(" async — background thread, no token cost (recommended)")
|
print(" async — background thread, no token cost (recommended)")
|
||||||
print(" turn — sync write after every turn")
|
print(" turn — sync write after every turn")
|
||||||
|
|
@ -142,22 +142,22 @@ def cmd_setup(args) -> None:
|
||||||
print(" N — write every N turns (e.g. 5)")
|
print(" N — write every N turns (e.g. 5)")
|
||||||
new_wf = _prompt("Write frequency", default=current_wf)
|
new_wf = _prompt("Write frequency", default=current_wf)
|
||||||
try:
|
try:
|
||||||
hermes_host["writeFrequency"] = int(new_wf)
|
cfg["writeFrequency"] = int(new_wf)
|
||||||
except (ValueError, TypeError):
|
except (ValueError, TypeError):
|
||||||
hermes_host["writeFrequency"] = new_wf if new_wf in ("async", "turn", "session") else "async"
|
cfg["writeFrequency"] = new_wf if new_wf in ("async", "turn", "session") else "async"
|
||||||
|
|
||||||
# Recall mode (host-scoped)
|
# Recall mode
|
||||||
current_recall = hermes_host.get("recallMode") or cfg.get("recallMode", "hybrid")
|
current_recall = cfg.get("recallMode", "hybrid")
|
||||||
print(f"\n Recall mode options:")
|
print(f"\n Recall mode options:")
|
||||||
print(" hybrid — pre-warmed context + memory tools available (default)")
|
print(" hybrid — pre-warmed context + memory tools available (default)")
|
||||||
print(" context — pre-warmed context only, memory tools suppressed")
|
print(" context — pre-warmed context only, memory tools suppressed")
|
||||||
print(" tools — no pre-loaded context, rely on tool calls only")
|
print(" tools — no pre-loaded context, rely on tool calls only")
|
||||||
new_recall = _prompt("Recall mode", default=current_recall)
|
new_recall = _prompt("Recall mode", default=current_recall)
|
||||||
if new_recall in ("hybrid", "context", "tools"):
|
if new_recall in ("hybrid", "context", "tools"):
|
||||||
hermes_host["recallMode"] = new_recall
|
cfg["recallMode"] = new_recall
|
||||||
|
|
||||||
# Session strategy (host-scoped)
|
# Session strategy
|
||||||
current_strat = hermes_host.get("sessionStrategy") or cfg.get("sessionStrategy", "per-session")
|
current_strat = cfg.get("sessionStrategy", "per-session")
|
||||||
print(f"\n Session strategy options:")
|
print(f"\n Session strategy options:")
|
||||||
print(" per-session — new Honcho session each run, named by Hermes session ID (default)")
|
print(" per-session — new Honcho session each run, named by Hermes session ID (default)")
|
||||||
print(" per-repo — one session per git repository (uses repo root name)")
|
print(" per-repo — one session per git repository (uses repo root name)")
|
||||||
|
|
@ -165,7 +165,7 @@ def cmd_setup(args) -> None:
|
||||||
print(" global — single session across all directories")
|
print(" global — single session across all directories")
|
||||||
new_strat = _prompt("Session strategy", default=current_strat)
|
new_strat = _prompt("Session strategy", default=current_strat)
|
||||||
if new_strat in ("per-session", "per-repo", "per-directory", "global"):
|
if new_strat in ("per-session", "per-repo", "per-directory", "global"):
|
||||||
hermes_host["sessionStrategy"] = new_strat
|
cfg["sessionStrategy"] = new_strat
|
||||||
|
|
||||||
cfg.setdefault("enabled", True)
|
cfg.setdefault("enabled", True)
|
||||||
cfg.setdefault("saveMessages", True)
|
cfg.setdefault("saveMessages", True)
|
||||||
|
|
|
||||||
|
|
@ -201,16 +201,8 @@ class HonchoClientConfig:
|
||||||
or raw.get("recallMode")
|
or raw.get("recallMode")
|
||||||
or "hybrid"
|
or "hybrid"
|
||||||
),
|
),
|
||||||
session_strategy=(
|
session_strategy=raw.get("sessionStrategy", "per-session"),
|
||||||
host_block.get("sessionStrategy")
|
session_peer_prefix=raw.get("sessionPeerPrefix", False),
|
||||||
or raw.get("sessionStrategy")
|
|
||||||
or "per-session"
|
|
||||||
),
|
|
||||||
session_peer_prefix=(
|
|
||||||
host_block.get("sessionPeerPrefix")
|
|
||||||
if "sessionPeerPrefix" in host_block
|
|
||||||
else raw.get("sessionPeerPrefix", False)
|
|
||||||
),
|
|
||||||
sessions=raw.get("sessions", {}),
|
sessions=raw.get("sessions", {}),
|
||||||
raw=raw,
|
raw=raw,
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -37,16 +37,16 @@ The setup wizard walks through API key, peer names, workspace, memory mode, writ
|
||||||
|
|
||||||
### Manual Setup
|
### Manual Setup
|
||||||
|
|
||||||
#### 1. Get an API Key
|
#### 1. Install the Client Library
|
||||||
|
|
||||||
Go to [app.honcho.dev](https://app.honcho.dev) > Settings > API Keys.
|
|
||||||
|
|
||||||
#### 2. Install the Client Library
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pip install 'honcho-ai>=2.0.1'
|
pip install 'honcho-ai>=2.0.1'
|
||||||
```
|
```
|
||||||
|
|
||||||
|
#### 2. Get an API Key
|
||||||
|
|
||||||
|
Go to [app.honcho.dev](https://app.honcho.dev) > Settings > API Keys.
|
||||||
|
|
||||||
#### 3. Configure
|
#### 3. Configure
|
||||||
|
|
||||||
Honcho reads from `~/.honcho/config.json` (shared across all Honcho-enabled applications):
|
Honcho reads from `~/.honcho/config.json` (shared across all Honcho-enabled applications):
|
||||||
|
|
@ -54,23 +54,17 @@ Honcho reads from `~/.honcho/config.json` (shared across all Honcho-enabled appl
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"apiKey": "your-honcho-api-key",
|
"apiKey": "your-honcho-api-key",
|
||||||
|
"workspace": "hermes",
|
||||||
"peerName": "your-name",
|
"peerName": "your-name",
|
||||||
"enabled": true,
|
"aiPeer": "hermes",
|
||||||
"hosts": {
|
"memoryMode": "hybrid",
|
||||||
"hermes": {
|
"writeFrequency": "async",
|
||||||
"workspace": "hermes",
|
"recallMode": "hybrid",
|
||||||
"aiPeer": "hermes",
|
"sessionStrategy": "per-directory",
|
||||||
"memoryMode": "hybrid",
|
"enabled": true
|
||||||
"writeFrequency": "async",
|
|
||||||
"recallMode": "hybrid",
|
|
||||||
"sessionStrategy": "per-directory"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
The `hosts` structure lets multiple integrations share the same config file. Each host (Hermes, Claude Code, Cursor, etc.) reads its own block while sharing global fields like `apiKey` and `peerName`.
|
|
||||||
|
|
||||||
Or set the API key as an environment variable:
|
Or set the API key as an environment variable:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue