Agents par Défaut

Cette page décrit la configuration par défaut des agents dans OpenClaw.

Configuration par défaut

Lorsqu'aucune configuration spécifique n'est fournie, OpenClaw utilise :

agents:
  defaults:
    model: "anthropic/claude-sonnet-4"
    timeoutSeconds: 600
    thinking: "low"
    verbose: false
    compaction:
      enabled: true
      threshold: 0.8
      keepRecent: 20
      reserveTokens: 20000

Paramètres par défaut

Modèle

model: "anthropic/claude-sonnet-4"

  • Modèle par défaut pour tous les agents
  • Équilibre performance/coût
  • 200k tokens de contexte
  • Rapide et fiable

Alternatives :

  • anthropic/claude-opus-4 : Plus puissant, plus lent, plus cher
  • anthropic/claude-haiku-4 : Plus rapide, moins cher, moins capable
  • openai/gpt-4 : Alternatif, 128k contexte

Timeout

timeoutSeconds: 600 (10 minutes)

  • Durée maximale d'exécution d'un agent
  • Prévient les boucles infinies
  • Peut être surchargé par exécution

Recommandations :

  • Tâches simples : 60-300s
  • Tâches complexes : 600-1800s
  • Background jobs : 3600s+

Thinking

thinking: "low"

Niveau de raisonnement :

  • off : Pas de thinking (réponses immédiates)
  • low : Raisonnement minimal (rapide)
  • medium : Raisonnement équilibré
  • high : Raisonnement approfondi (lent)

Par défaut low pour :

  • Rapidité (< 2s de latence)
  • Économie de tokens
  • Suffisant pour la plupart des tâches

Verbose

verbose: false

Mode verbeux :

  • false : Réponses concises, masque détails d'outils
  • true : Affiche exécution d'outils, logs, erreurs

Par défaut false pour :

  • Interface utilisateur propre
  • Moins de bruit dans les chats
  • Activer si debug nécessaire

Compaction

Configuration de compaction automatique :

compaction:
  enabled: true          # Activer auto-compaction
  threshold: 0.8         # Déclencher à 80% de la limite
  keepRecent: 20         # Garder 20 derniers messages intacts
  reserveTokens: 20000   # Réserver 20k tokens pour sécurité

Voir Session Pruning pour détails.

Surcharges

Par exécution (CLI)

# Surcharger modèle
openclaw agent --model opus-4 "Complex analysis"

# Surcharger thinking
openclaw agent --thinking high "Deep reasoning needed"

# Surcharger timeout
openclaw agent --timeout 1800 "Long task"

# Activer verbose
openclaw agent --verbose "Debug this issue"

# Combinaisons
openclaw agent --model opus-4 --thinking high --verbose --timeout 1800 "Hard problem"

Par RPC

await gateway.rpc('agent', {
  model: 'anthropic/claude-opus-4',
  thinking: 'high',
  verbose: true,
  timeoutSeconds: 1800,
  message: 'Analyze this deeply'
});

Par canal

channels:
  telegram:
    agent:
      model: "anthropic/claude-sonnet-4"
      thinking: "low"
      verbose: false
  
  discord:
    agent:
      model: "anthropic/claude-haiku-4"
      thinking: "off"
      verbose: false

Par agent spécialisé

agents:
  code-reviewer:
    model: "anthropic/claude-opus-4"
    thinking: "high"
    verbose: true
    timeoutSeconds: 1800
  
  quick-support:
    model: "anthropic/claude-haiku-4"
    thinking: "off"
    verbose: false
    timeoutSeconds: 60

Profils d'agent

Créer des profils réutilisables :

agents:
  # Profil par défaut (déjà inclus)
  default:
    model: "anthropic/claude-sonnet-4"
    timeoutSeconds: 600
    thinking: "low"
    verbose: false
  
  # Profil rapide
  quick:
    model: "anthropic/claude-haiku-4"
    timeoutSeconds: 60
    thinking: "off"
    verbose: false
  
  # Profil puissant
  power:
    model: "anthropic/claude-opus-4"
    timeoutSeconds: 1800
    thinking: "high"
    verbose: true
  
  # Profil debug
  debug:
    model: "anthropic/claude-sonnet-4"
    timeoutSeconds: 600
    thinking: "medium"
    verbose: true

Utiliser un profil :

# CLI
openclaw agent --profile quick "Simple question"
openclaw agent --profile power "Complex analysis"
openclaw agent --profile debug "Debug this issue"

# RPC
gateway.rpc('agent', {
  profile: 'power',
  message: 'Complex task'
})

Variables d'environnement

Surcharger via env vars :

# Modèle par défaut
export OPENCLAW_MODEL="anthropic/claude-opus-4"

# Thinking level
export OPENCLAW_THINKING="high"

# Verbose
export OPENCLAW_VERBOSE="true"

# Timeout
export OPENCLAW_TIMEOUT="1800"

Recommandations

Par cas d'usage

Chat interactif :

  • Model: claude-sonnet-4 ou claude-haiku-4
  • Thinking: off ou low
  • Timeout: 60-300s
  • Verbose: false

Analyse approfondie :

  • Model: claude-opus-4
  • Thinking: high
  • Timeout: 600-1800s
  • Verbose: true (optional)

Background jobs :

  • Model: claude-sonnet-4
  • Thinking: medium
  • Timeout: 1800-3600s
  • Verbose: true

Support client :

  • Model: claude-haiku-4 ou claude-sonnet-4
  • Thinking: off ou low
  • Timeout: 30-60s
  • Verbose: false

Optimisation coûts

Pour réduire les coûts :

  1. Utiliser Haiku quand possible (claude-haiku-4)
  2. Thinking off pour tâches simples
  3. Timeout court pour éviter longues exécutions
  4. Compaction agressive (threshold: 0.7)

Optimisation performance

Pour maximiser la vitesse :

  1. Haiku ou Sonnet (pas Opus)
  2. Thinking off ou low
  3. Compaction désactivée si sessions courtes
  4. Cache contexte (si supporté par provider)

Monitoring

Surveiller l'impact des configs :

# Stats d'usage
openclaw agents stats

# Par modèle
openclaw agents stats --by model

# Par profil
openclaw agents stats --by profile

# Coûts
openclaw agents costs --last 7d

Exemples de configurations

Startup lean (économique)

agents:
  defaults:
    model: "anthropic/claude-haiku-4"
    timeoutSeconds: 300
    thinking: "off"
    verbose: false
    compaction:
      enabled: true
      threshold: 0.7

Enterprise (performance)

agents:
  defaults:
    model: "anthropic/claude-opus-4"
    timeoutSeconds: 1800
    thinking: "high"
    verbose: true
    compaction:
      enabled: true
      threshold: 0.8
      keepRecent: 50

Hybrid (équilibré)

agents:
  defaults:
    model: "anthropic/claude-sonnet-4"
    timeoutSeconds: 600
    thinking: "low"
    verbose: false
  
  code-assistant:
    model: "anthropic/claude-opus-4"
    thinking: "high"
  
  support-bot:
    model: "anthropic/claude-haiku-4"
    thinking: "off"

Ressources

---

La configuration par défaut d'OpenClaw est optimisée pour un bon équilibre entre performance, coût et expérience utilisateur. Ajustez selon vos besoins spécifiques!