Skip to content

Commit 81dc720

Browse files
mios-devclaude
andcommitted
fix `process_chat 'parameters' KeyError + SOUL self-iteration + brand
OWUI's process_chat:2013 unwraps spec["parameters"] for every bound tool. The OpenUI tool was installed with specs=[] (operator-flagged chat 2026-05-17 truncated at literal `'parameters'` -- the agent's response WAS the KeyError string surfacing as content). mios_verbs specs also lacked parameters and listed two methods that no longer exist on the Tools class (everything_search, mios_apps). Fixed both: * mios-owui-install-tools: rewrote `specs` list to match the actual 3-method Tools class (launch_app, mios_find, system_status) with full JSONSchema parameters blocks. Live DB patched in-place; next rebuild starts correct. * mios-owui-install-pipe: hand-built openui spec with parameters (one method render_openui taking openui_lang_code + optional title). Live DB patched in-place. * hermes-soul.md: added "Self-improvement -- fork and iterate" section + clone verbs in the helpers table (mios-skill-clone, mios-tool-clone). Operator 2026-05-17: "agentic agents like Hermes should understand that tools and skills can be updated/ iterated on -- making copies and improving them -- Hermes should be able to do this natively". The verbs and writable resolver paths existed since 2026-05-15; SOUL.md just didn't tell the agent. Added when-to-fork heuristic + WHY-stamp convention. * MiOS-Agent dropdown description tightened a third time per operator: "Local agent. Offline. Locale-aware." -> "local-first Agent for MiOS systems". Live DB patched across function meta + both bound-model rows. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 26dc838 commit 81dc720

3 files changed

Lines changed: 83 additions & 11 deletions

File tree

usr/libexec/mios/mios-owui-install-pipe

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ print(json.dumps({
8787
"name": pname,
8888
"content": content,
8989
"meta": {
90-
"description": "Local agent. Offline. Locale-aware.",
90+
"description": "local-first Agent for MiOS systems",
9191
"manifest": {},
9292
},
9393
"type": "pipe",
@@ -156,7 +156,7 @@ print(json.dumps({
156156
"name": mname,
157157
"meta": {
158158
"profile_image_url": "/static/favicon.png",
159-
"description": "Local agent. Offline. Locale-aware.",
159+
"description": "local-first Agent for MiOS systems",
160160
"capabilities": {"vision": False, "citations": True},
161161
# Native MiOS tool surface -- the model SEES these in its
162162
# tool_calls list (no `terminal: mios-<verb>` indirection).

usr/libexec/mios/mios-owui-install-tools

Lines changed: 43 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,16 +95,50 @@ def main() -> int:
9595
if attached:
9696
c.commit()
9797

98-
# Build specs JSON. OWUI's loader extracts the schema from
99-
# type hints + docstrings at runtime, but the `specs` column is
100-
# also used as a quick reference for the admin UI. Compute the
101-
# minimal spec list now; if a method signature changes the next
102-
# firstboot run will re-derive on hash mismatch.
98+
# Build specs JSON. OWUI's chat-completion path indexes into
99+
# spec["parameters"] (open_webui.main:process_chat) so every spec
100+
# MUST carry a JSONSchema parameters block -- a partial spec list
101+
# (missing `parameters`) crashes the entire chat with KeyError:
102+
# 'parameters'. Keep this list in lockstep with the actual Tools
103+
# class methods in /usr/share/mios/owui/tools/mios_verbs.py.
103104
specs = [
104-
{"name": "launch_app", "description": "Launch a MiOS-registered app by short name (Steam/Epic/Xbox/flatpak/.exe/.lnk)"},
105-
{"name": "everything_search", "description": "Search Windows NTFS index via Voidtools es.exe (sub-100ms)"},
106-
{"name": "mios_apps", "description": "Inventory installed apps across all sources"},
107-
{"name": "mios_find", "description": "Look up one app's launch info (fast single-shot)"},
105+
{
106+
"name": "launch_app",
107+
"description": "Launch a MiOS-registered Windows/Linux app by short name. Resolves through the canonical chain (Steam/Epic/Xbox/GOG/Battle.net via protocol handler, Windows shortname, MiOS shim, Linux GUI, plain CLI). Dispatch only -- launch is detached.",
108+
"parameters": {
109+
"type": "object",
110+
"properties": {
111+
"name": {
112+
"type": "string",
113+
"description": "App short name. Case-insensitive substring matches against the Windows games inventory; exact for shortnames. Examples: \"beamng\", \"notepad\", \"chromedev\", \"marvel rivals\".",
114+
}
115+
},
116+
"required": ["name"],
117+
},
118+
},
119+
{
120+
"name": "mios_find",
121+
"description": "Resolve an app's launch info without launching it (read-only). Returns the canonical command the launcher would execute. Use this when you want to know whether something is installed / how it would be invoked.",
122+
"parameters": {
123+
"type": "object",
124+
"properties": {
125+
"name": {
126+
"type": "string",
127+
"description": "App short name (same matching rules as launch_app).",
128+
}
129+
},
130+
"required": ["name"],
131+
},
132+
},
133+
{
134+
"name": "system_status",
135+
"description": "Snapshot of host MiOS state: active services, container status, last journal errors, GPU/CPU/RAM headline numbers. Read-only -- safe to call without side effects.",
136+
"parameters": {
137+
"type": "object",
138+
"properties": {},
139+
"required": [],
140+
},
141+
},
108142
]
109143

110144
meta = {

usr/share/mios/ai/hermes-soul.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,8 @@ boundary (operator secret, hardware fault).
120120
| `mios-restart <svc>` | Graceful systemd restart (for MiOS services). |
121121
| `mios-doctor` | Health probe. |
122122
| `mios-env-probe` | Runtime snapshot. |
123+
| `mios-skill-clone <name> [--as <new>]` | Fork a vendor skill into `$HERMES_HOME/skills/` so you can edit it. Same-name fork overrides on next load. |
124+
| `mios-tool-clone <name> [--as <new>]` | Fork a vendor shim into `/usr/local/bin/` (precedes `/usr/libexec/mios` on PATH). |
123125

124126
State paths (read freely):
125127
- `/var/lib/mios/scratch/` — inter-agent shared scratch (mode 1777)
@@ -257,6 +259,42 @@ For standalone markdown editing (the operator types + sees rendered
257259
preview): `terminal: mios-md [<file>] [--text "<inline>"]` opens the
258260
vendored snarkdown viewer in their browser.
259261

262+
## Self-improvement — fork and iterate
263+
264+
Your tools and skills are **mutable**. When a vendor skill or shim
265+
doesn't quite fit a recurring task, fork it and improve it — don't
266+
work around it forever.
267+
268+
Skills:
269+
- `terminal: mios-skill-clone <name>` forks
270+
`/usr/share/mios/hermes/skills/<name>/` into
271+
`$HERMES_HOME/skills/<name>/`. The resolver loads your copy first.
272+
- Edit `$HERMES_HOME/skills/<name>/SKILL.md` (and support files) with
273+
`write_file` or `terminal: $EDITOR …`. The next turn loads it.
274+
- Use `--as <new-name>` to ship a sibling skill instead of overriding.
275+
- `skill_manage` (native tool) handles CRUD on the metadata side; pair
276+
it with `mios-skill-clone` for the file payload.
277+
278+
Shims (`mios-*` helpers):
279+
- `terminal: mios-tool-clone <name>` copies the vendor shim into
280+
`/usr/local/bin/`, which precedes `/usr/libexec/mios` on PATH.
281+
- Edit the local copy; next call uses it.
282+
- For brand-new shims with no parent to clone: `write_file
283+
/usr/local/bin/<name>` + `terminal: chmod +x /usr/local/bin/<name>`.
284+
285+
When to fork (operator directive 2026-05-15: "Hermes should be
286+
properly improving skills and tools iteratively"):
287+
- A skill keeps producing the wrong shape for a task you do often →
288+
clone, tighten the SKILL.md prompt, ship.
289+
- A shim is missing a flag you need → clone, add the flag, ship.
290+
- A new recurring workflow doesn't match any existing skill → write
291+
a new one rather than re-deriving the steps every turn.
292+
293+
Always stamp WHY in a one-line comment at the top of the edit
294+
(operator 2026-05-DD: "<their words>" or a short root-cause note).
295+
Don't fork pre-emptively — fork when you've hit the same failure
296+
twice.
297+
260298
## Long-form detail
261299

262300
`hermes-soul-full.md` ships alongside this file. Load it

0 commit comments

Comments
 (0)