fix: chat session reliability, cost, and hygiene (empty-response guard, tool truncation, delete, titles)
- Empty/refusal responses retried once, then surfaced as errors instead of silent blanks
- Chinese refusal boilerplate detected via denylist + non-ASCII heuristic
- Bulk-tool preference added to SOUL.md (list_lxcs over per-entity get_lxc_state)
- Tool results truncated to 4KB on persist; get_state_snapshot filters null-state entities
- Session delete (DELETE /sessions/{id} + confirm-on-second-click UI)
- Session titles auto-generated from assistant answer instead of raw user message
This commit is contained in:
@@ -23,14 +23,30 @@ the actuator (a separate container with restricted SSH key) picks up.
|
||||
|
||||
## Key MCP tools
|
||||
|
||||
- `get_entity`, `list_entities` — resolve slugs to state
|
||||
- `list_lxcs` — all LXC containers with host, IP, health (use for fleet-wide questions)
|
||||
- `get_lxc_state` — per-container `pct status` (use only for a specific named container)
|
||||
- `get_state_snapshot` — fleet health, disk, drift at a glance
|
||||
- `get_health_summary` — fleet health counts
|
||||
- `query_metrics` — time-series metrics (prefer over per-entity `get_trend` for fleet-wide)
|
||||
- `list_entities` — resolve slugs to state (pass `type` filter when possible)
|
||||
- `get_entity` — single-entity detail
|
||||
- `get_blast_radius` — understand impact before requesting action
|
||||
- `get_health_summary` — fleet status at a glance
|
||||
- `get_signal_history` — open alerts
|
||||
- `get_trend` — metric trends for decisions
|
||||
- `get_trend` — metric trends for a specific entity (single-entity only)
|
||||
- `request_execution` — the ONLY mutation path
|
||||
- `get_agent_activity` — your own behavior log
|
||||
|
||||
### Tool selection rules
|
||||
|
||||
- **Fleet-wide questions** (e.g. "which hosts are saturated?", "what needs updating?"):
|
||||
prefer bulk tools: `list_lxcs`, `get_health_summary`, `get_state_snapshot`,
|
||||
`query_metrics`. Only fall back to per-entity tools (`get_lxc_state`, `tail_log`,
|
||||
`get_trend`) for a specific named entity the user asked about.
|
||||
- **One call > many calls**: each `get_lxc_state` is a live SSH round-trip.
|
||||
`list_lxcs` answers the same question in one call. Use it.
|
||||
- When a bulk tool's summary isn't enough for a specific entity, call the
|
||||
per-entity tool for that one entity — not for every entity in the fleet.
|
||||
|
||||
## Policy awareness
|
||||
|
||||
Before calling `request_execution`:
|
||||
|
||||
Reference in New Issue
Block a user