mix lemon.policy (lemon_channels v0.1.0)

View Source

Manage model policies for channels, accounts, peers, and threads.

Model policies allow setting default models and thinking levels per route, with hierarchical precedence: session > thread > peer > account > channel > global.

Usage

# List all policies
mix lemon.policy list

# List policies for a specific channel
mix lemon.policy list telegram

# Set a policy for a route
mix lemon.policy set telegram --model claude-sonnet-4-20250514
mix lemon.policy set telegram --account default --peer "-1001234567890" --model gpt-4o
mix lemon.policy set telegram --account default --peer "-1001234567890" --thread "456"       --model claude-opus-4-6 --thinking high

# Get the effective policy for a route
mix lemon.policy get telegram --account default --peer "-1001234567890"

# Clear a policy
mix lemon.policy clear telegram --account default --peer "-1001234567890"

# Clear all policies for a channel
mix lemon.policy clear telegram --all

Options

  • --account - Account identifier (e.g., "default", "bot1")
  • --peer - Peer/chat identifier (e.g., Discord channel ID, Telegram chat ID)
  • --thread - Thread/topic identifier
  • --model - Model ID (e.g., "claude-sonnet-4-20250514", "gpt-4o")
  • --thinking - Thinking level (off, minimal, low, medium, high, xhigh)
  • --reason - Reason for setting this policy (stored in metadata)
  • --all - For clear command: clear all policies for the channel