diff --git a/CHANGELOG.md b/CHANGELOG.md index dd47627..bc8fd62 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- **A session asked to run /compact on itself through `control_session` now + does.** Asked "run /compact", models mostly reached for lich's + `control_session`, which refuses a session's own, and either gave up or asked + another session to run it on them. The self-command mod now takes that + refusal for action `command` and queues the built-in the way it does for the + Skill tool, `/model` and `/effort` refused alike. The tool's description says + so and names the session by its `LICH_SESSION_ID`, since a session cannot + look its own label up. + ## [0.19.1] - 2026-10-09 ### Added diff --git a/CLAUDE.md b/CLAUDE.md index 9fdb0cf..0dff177 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -67,7 +67,7 @@ Contracts are **canonical in the lich repository** (`docs/hooks/` there); this p - [docs/mod-usage.md](docs/mod-usage.md): a Claude Code session reports the context window, rate limits and cost it measured itself, through a mod hooking `session.measure`; Claude Code only - [docs/mod-answer.md](docs/mod-answer.md): a lich subagent worker answers the task it was handed with its turn's final message, through a mod reading the main loop's `classic.Stop` and `turn.complete`; Claude Code only - [docs/mod-status.md](docs/mod-status.md): a Claude Code session shows the relay errands it is part of (owed, out, ready) in its prompt footer, through a mod reading `/mod/status`, which never collects; Claude Code only -- [docs/self-command.md](docs/self-command.md): a Claude Code session runs a built-in slash command the user asked it for (`/compact`), queued after the turn, through a mod answering the Skill tool's refusal of a built-in rather than lich's `control`, which refuses a session's own; Claude Code only +- [docs/self-command.md](docs/self-command.md): a Claude Code session runs a built-in slash command the user asked it for (`/compact`), queued after the turn, through a mod answering the Skill tool's refusal of a built-in, and lich's `control_session` refusal of the session's own, by queueing the command itself; Claude Code only - [docs/edit-guard.md](docs/edit-guard.md): an edit to a file another lich session edited in the last minutes carries a note naming it, through markers in the checkout's git dir rather than an HTTP contract; Claude Code only - [docs/providers.md](docs/providers.md) — the per-harness map, including what installing on omp takes and what it cannot report diff --git a/docs/self-command.md b/docs/self-command.md index 2082bbf..b9399eb 100644 --- a/docs/self-command.md +++ b/docs/self-command.md @@ -12,12 +12,26 @@ control itself"), and the mod runs in the session's own process anyway. ## How the model asks -Through the Skill tool, the one it already reaches for. Measured on Claude Code +Through a tool it already reaches for: the Skill tool, or lich's own +`control_session`. Measured on Claude Code 2.1.295, asked to "run /compact", the model answered that it could not because `/compact` is a CLI command and not a skill; called on `compact`, the Skill tool refuses with `compact is a built-in CLI command, not a skill. Ask the user to run /compact themselves — it cannot be invoked via the Skill tool.` +Asked the same with only the Skill tool taken, sessions still went to +`control_session`, whose description says "never your own": one called it on +itself, another asked a peer session to run it on it. Claude Code names that +tool `mcp__lich__control_session` in `tool.call` and `tool.describe`, the call's +input arrives as `{ session, action, value, args }`, and lich refuses a session +named by its own label with an error result whose text is `"