docs(honcho): document workspace routing and provider context
This commit is contained in:
@@ -98,6 +98,31 @@ class MyMemoryProvider(MemoryProvider):
|
||||
# ... implement remaining methods
|
||||
```
|
||||
|
||||
### Initialization context
|
||||
|
||||
`AIAgent` passes session context through `MemoryManager.initialize_all()` to
|
||||
`initialize(session_id, **kwargs)`. Accept `**kwargs` and tolerate missing optional
|
||||
fields; callers may initialize a provider without an agent or a session database.
|
||||
|
||||
| Keyword | Meaning |
|
||||
|---|---|
|
||||
| `hermes_home` | Active profile's storage directory. |
|
||||
| `platform` | Session surface, such as `cli`, `gui`, `acp`, or `telegram`. |
|
||||
| `session_title` | Stored session title, when available. A display label is not necessarily a user-selected identity. |
|
||||
| `session_title_source` | Stored title provenance, when available: `derived`, `llm`, or `user`. Automatic sources must not be mistaken for explicit identity overrides; missing provenance retains a provider's legacy behavior. Shared constants live in `hermes_state_common.py`. |
|
||||
| `cwd` | Non-empty logical workspace supplied as `AIAgent(cwd=...)`, available before provider initialization. Omitted for `None` or an empty string. |
|
||||
| `gateway_session_key` | Stable messaging-chat identity for per-chat session isolation. |
|
||||
| `user_id`, `user_id_alt`, `user_name`, `chat_id` | Gateway identity fields, included when present. |
|
||||
| `agent_identity` | Active profile name, when available. |
|
||||
| `agent_workspace`, `agent_context` | Runtime agent scope (`hermes` and `primary` for the main agent). |
|
||||
|
||||
Do not assume `os.getcwd()` identifies the conversation's workspace: one Desktop
|
||||
or gateway backend can serve several sessions. If `cwd` is absent and directory
|
||||
routing is needed, `agent.runtime_cwd.resolve_agent_cwd()` honors the session cwd
|
||||
context, then scoped `terminal.cwd` (carried internally as `TERMINAL_CWD`), then
|
||||
the launch directory. Construction-time workspace metadata does not require
|
||||
changing the process cwd or rebuilding an existing conversation's system prompt.
|
||||
|
||||
## Required Methods
|
||||
|
||||
### Core Lifecycle
|
||||
|
||||
@@ -140,7 +140,11 @@ When pointing Hermes at a self-hosted Honcho server, `hermes honcho setup` (and
|
||||
- `per-repo` — one session per git repository.
|
||||
- `global` — single session across all directories.
|
||||
|
||||
Automatically generated Hermes titles are display metadata and do not override `sessionStrategy`. An explicit user title remains an intentional session-name override for non-gateway, non-`per-session` sessions.
|
||||
Directory-based strategies and manual `sessions` mappings use the logical session working directory, not the backend's launch directory. Desktop/TUI project workspaces and ACP session directories are passed during agent construction, including deferred builds. When no directory is supplied, Honcho uses the runtime cwd resolver: session context, then the scoped `terminal.cwd` setting, then the process launch directory.
|
||||
|
||||
Messaging gateways keep their stable per-chat session key regardless of strategy or title. For other sessions, `per-session` identity takes priority, followed by a manual directory mapping, an explicit title, and the configured strategy.
|
||||
|
||||
Automatically generated Hermes titles (`derived` or `llm`) are display metadata and do not override `sessionStrategy`. An explicit user title remains an intentional session-name override for non-gateway, non-`per-session` sessions without a manual mapping.
|
||||
|
||||
Sessions created before title provenance was recorded retain legacy behavior: because an old automatic title cannot be distinguished from an old user title, a title with no source is treated as an explicit override.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user