Skip to content

fix(mod): queue a built-in a session asks control_session to run on itself - #62

Merged
omartelo merged 1 commit into
mainfrom
fix/self-command-via-control
Oct 9, 2026
Merged

omartelo merged 1 commit into
mainfrom
fix/self-command-via-control

Conversation

@omartelo

@omartelo omartelo commented Oct 9, 2026

Copy link
Copy Markdown
Collaborator

Asked "run /compact", sessions mostly reached for lich's control_session, which refuses a session's own ("never your own"), and either gave up or asked a peer to run it on them. The self-command mod now also takes that path.

  • tool.call on mcp__lich__control_session: lich answers first; an error answer to action command whose target is this session (named by its LICH_SESSION_ID, or lich's "is this session, and a session cannot control itself" refusal) is answered by queueing the built-in, same checks as the Skill path (/model and /effort refused).
  • tool.describe on it: says action command on this session is accepted and spells out the session id to pass, since a session cannot look its own label up (list_sessions/lich sessions leave it out).

Measured (Claude Code 2.1.295)

  • Tool name in tool.call/tool.describe: mcp__lich__control_session; input { session, action, value, args, tool, tool_use_id }.
  • Self refusal: isError: true, text "<label>" is this session, and a session cannot control itself: ….
  • tool.describe fires for the MCP tool while deferred behind ToolSearch.
  • A session told to target itself tried its LICH_SESSION_ID (no session named …) and gave up, hence the id in the description.

Tests

  • node --test tests/*.test.mjs: 377 pass. claude plugin validate: pass (same warnings as every other tool.call hook). claude plugin test .: 31 pass.
  • Live, new lich session, "roda um /compact": Skill(compact) → compacted. Told to use control_session on itself: called it with its id, got "queued on this session", compacted.

@omartelo
omartelo merged commit ef0c96e into main Oct 9, 2026
3 checks passed
@omartelo
omartelo deleted the fix/self-command-via-control branch October 9, 2026 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant