Skip to content

Troubleshooting Guide

Common issues and solutions for using Victor effectively.

Quick Diagnostics

Start here if you're experiencing problems:

# 1. Check Victor version
victor --version

# 2. Check installed providers
victor providers

# 3. Test basic functionality
victor chat "Hello, Victor!" --provider ollama

# 4. Check configuration
victor config show

# 5. View logs
victor logs --tail 50

Expected Output:
- Version should be latest: victor 0.x.x
- Providers should list 24 providers
- Chat should respond successfully
- Config should show your profiles
- Logs should show recent activity

Still having issues? → Jump to specific sections below


Installation Issues

Issue: Command Not Found

Symptom:

victor --version
# zsh: command not found: victor

Solutions:

1. Check installation:

# Verify Victor is installed
pip list | grep victor

# If not installed, install it
pipx install victor-ai
# or
pip install victor-ai

2. Check PATH (if using pip):

# Find where pip installed Victor
pip show victor-ai | grep Location

# Add to PATH if needed
export PATH="$HOME/.local/bin:$PATH"

# Add to ~/.bashrc or ~/.zshrc for persistence
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc

3. Reinstall with uv (recommended):

# Uninstall existing
pip uninstall victor-ai

# Install with uv
uv tool install --python 3.12 victor-ai

# Verify
which victor
# Should output: /home/user/.local/bin/victor

Issue: Python Version Incompatible

Symptom:

# During installation
ERROR: Package 'victor-ai' requires a different Python: 3.11.x not in '>=3.12'

Solutions:

1. Check Python version:

python --version
# Must be 3.12 or higher

2. Install Python 3.12+:

macOS:

brew install python@3.12

Ubuntu/Debian:

sudo apt update
sudo apt install python3.12

Windows:
- Download from python.org

3. Use correct Python:

# Use python3.12 explicitly
python3.12 -m pip install victor-ai

# Or create virtual environment
python3.12 -m venv ~/.victor-venv
source ~/.victor-venv/bin/activate  # Windows: ~/.victor-venv\Scripts\activate
pip install victor-ai

Issue: Dependencies Failed to Install

Symptom:

# During installation
ERROR: Could not build wheels for some packages

Solutions:

1. Install build tools:

macOS:

xcode-select --install

Ubuntu/Debian:

sudo apt install build-essential python3-dev

Windows:
- Install Visual Studio Build Tools

2. Install with dev dependencies:

pip install "victor-ai[dev]"

3. Use pre-built wheels:

pip install --only-binary :all: victor-ai

Issue: Permission Denied

Symptom:

# During installation
ERROR: Could not install packages due to an EnvironmentError: [Errno 13] Permission denied

Solutions:

1. Use pipx (recommended):

pip install pipx
pipx install victor-ai

2. Use virtual environment:

python -m venv ~/.victor-venv
source ~/.victor-venv/bin/activate
pip install victor-ai

3. Use --user flag (not recommended):

pip install --user victor-ai


Provider Issues

Issue: API Key Not Found

Symptom:

victor chat --provider anthropic "Hello"
# ERROR: API key not found for provider 'anthropic'

Solutions:

1. Set environment variable:

export ANTHROPIC_API_KEY=sk-ant-...

# Verify
echo $ANTHROPIC_API_KEY

2. Add to shell profile (persistent):

# Add to ~/.bashrc or ~/.zshrc
echo 'export ANTHROPIC_API_KEY=sk-ant-...' >> ~/.bashrc
source ~/.bashrc

3. Use profiles.yaml:

# ~/.victor/profiles.yaml
profiles:
  claude:
    provider: anthropic
    api_key_env: ANTHROPIC_API_KEY

4. Set directly (not recommended, insecure):

victor chat --provider anthropic --api-key sk-ant-...

Environment Variables by Provider:

# Cloud providers
export ANTHROPIC_API_KEY=sk-ant-...
export OPENAI_API_KEY=sk-proj-...
export GOOGLE_API_KEY=...
export XAI_API_KEY=...
export DEEPSEEK_API_KEY=...
export MISTRAL_API_KEY=...

# Enterprise
export AZURE_OPENAI_API_KEY=...
export AZURE_OPENAI_ENDPOINT=https://...

# Local (optional)
export OLLAMA_HOST=127.0.0.1:11434
# Local runtime endpoints go in ~/.victor/profiles.yaml, e.g.
# providers.lmstudio.base_url: http://127.0.0.1:1234
# providers.vllm.base_url:     http://127.0.0.1:8000
# providers.llamacpp.base_url: http://127.0.0.1:8080

Issue: Provider Not Available

Symptom:

victor chat --provider together "Hello"
# ERROR: Provider 'together' not available

Solutions:

1. Check installed providers:

victor providers

# Should list 24 providers

2. Install provider extras:

# Reinstall with specific provider
pip install "victor-ai[together]"

# Or install all providers
pip install "victor-ai[all]"

3. Check provider spelling:

# Correct names
victor chat --provider anthropic "Hello"
victor chat --provider openai "Hello"
victor chat --provider ollama "Hello"

# NOT
victor chat --provider Anthropic "Hello"  # Wrong case
victor chat --provider open_ai "Hello"   # Wrong separator

Issue: Model Not Found

Symptom:

victor chat --provider anthropic --model claude-3 "Hello"
# ERROR: Model 'claude-3' not found

Solutions:

1. List available models:

victor providers --provider anthropic --models

# Or check documentation
# https://docs.victor.ai/reference/providers/

2. Use correct model name:

# Correct
victor chat --provider anthropic --model claude-sonnet-4-20250514

# NOT
victor chat --provider anthropic --model claude-3  # Too generic

3. Pull model first (for local providers):

# Ollama
ollama pull qwen2.5-coder:7b

# Then use
victor chat --provider ollama --model qwen2.5-coder:7b

Issue: Connection Timeout

Symptom:

victor chat --provider anthropic "Hello"
# ERROR: Connection timeout after 30s

Solutions:

1. Check network connectivity:

# Test API endpoint
curl https://api.anthropic.com/v1/messages

# Check DNS
nslookup api.anthropic.com

2. Check firewall/proxy:

# Set proxy if needed
export HTTP_PROXY=http://proxy.example.com:8080
export HTTPS_PROXY=http://proxy.example.com:8080

3. Increase timeout:

victor chat --timeout 60 "Hello"

4. Test with local provider:

# If cloud fails, try local
victor chat --provider ollama "Hello"

Issue: Rate Limiting

Symptom:

victor chat --provider anthropic "Hello"
# ERROR: Rate limit exceeded

Solutions:

1. Wait and retry:

# Wait 60 seconds
sleep 60
victor chat "Hello"

2. Switch providers:

# During conversation
/provider openai

# Or start new conversation
victor chat --provider openai "Hello"

3. Use local provider as fallback:

/provider ollama  # No rate limits

4. Check your rate limit:

# Anthropic
# https://console.anthropic.com/settings/limits

# OpenAI
# https://platform.openai.com/usage

# Google
# https://console.cloud.google.com/apis/api/generativelanguage.googleapis.com/quotas

Issue: Authentication Failed

Symptom:

victor chat --provider anthropic "Hello"
# ERROR: Authentication failed (401)

Solutions:

1. Verify API key is valid:

# Test with curl
curl https://api.anthropic.com/v1/messages \
  -H "x-api-key: $ANTHROPIC_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  -d '{"model":"claude-sonnet-4-20250514","max_tokens":10,"messages":[{"role":"user","content":"Hi"}]}'

2. Regenerate API key:
- Visit provider console
- Delete old key
- Create new key
- Update environment variable

3. Check for typos:

# Make sure no extra spaces
echo $ANTHROPIC_API_KEY | tr -d ' '

# Should not have leading/trailing spaces

Issue: Ollama Not Responding

Symptom:

victor chat --provider ollama "Hello"
# ERROR: Ollama not responding

Solutions:

1. Check Ollama status:

# List running models
ollama list

# Check logs
ollama logs

# Test directly
ollama run qwen2.5-coder:7b "Hello"

2. Restart Ollama:

# Stop Ollama
ollama stop

# Start Ollama
ollama serve

# In another terminal, test
victor chat --provider ollama "Hello"

3. Pull model:

ollama pull qwen2.5-coder:7b

4. Check Ollama host:

# Default is 127.0.0.1:11434
export OLLAMA_HOST=127.0.0.1:11434

Issue: vLLM Connection Failed

Symptom:

victor chat --provider vllm "Hello"
# ERROR: Failed to connect to vLLM server

Solutions:

1. Start vLLM server:

# Install vLLM
pip install vllm

# Start server
vllm serve meta-llama/Llama-3.2-3B-Instruct --port 8000

2. Check vLLM status:

curl http://127.0.0.1:8000/v1/models

3. Set host:

# providers.vllm.base_url: http://127.0.0.1:8000  (in ~/.victor/profiles.yaml)

4. Check GPU/memory:

# Check GPU availability
nvidia-smi

# Check memory
free -h


Performance Issues

Issue: Slow Responses

Symptom:

victor chat "Generate a REST API"
# Takes 30+ seconds to respond

Solutions:

1. Check which provider you're using:

# Cloud providers: 1-5 seconds (normal)
# Local providers: 5-30 seconds (depends on hardware)
victor providers --current

2. Switch to faster provider:

# Groq, Cerebras: <1 second
/provider groq

# Or local with GPU
/provider ollama  # If you have GPU

3. Use smaller model:

# For simple tasks
victor chat --model gemini-2.5-flash "Quick question"
# or
victor chat --provider ollama --model llama3.2:3b "Quick question"

4. Enable caching:

# ~/.victor/config.yaml
cache:
  enabled: true
  ttl: 3600

5. Check your internet:

# Test speed
ping api.anthropic.com
traceroute api.anthropic.com

Issue: High Memory Usage

Symptom:

# Victor consuming >1GB memory

Solutions:

1. Check memory usage:

# On Linux/macOS
ps aux | grep victor

# On Windows
tasklist | findstr victor

2. Reduce context size:

victor chat --max-tokens 1024 "Hello"

3. Use smaller model:

# Local models vary in size
# 3B model: ~4GB RAM
# 7B model: ~8GB RAM
# 14B model: ~16GB RAM
victor chat --provider ollama --model llama3.2:3b "Hello"

4. Clear cache:

# Clear conversation cache
victor cache clear

# Clear all cache
rm -rf ~/.victor/cache/

5. Restart Victor:

# Stop and restart
victor quit
victor chat "Hello"

Issue: CPU Usage 100%

Symptom:

# Victor consuming 100% CPU

Solutions:

1. Check if using local model:

# Local models use CPU heavily (normal)
victor providers --current

2. Use GPU if available:

# For Ollama
ollama run qwen2.5-coder:7b

# Check GPU usage
nvidia-smi

3. Switch to cloud provider:

/provider anthropic  # Uses provider's compute

4. Use smaller local model:

victor chat --provider ollama --model llama3.2:3b


Configuration Issues

Issue: Profile Not Found

Symptom:

victor --profile production chat "Hello"
# ERROR: Profile 'production' not found

Solutions:

1. List available profiles:

victor config profiles

2. Create profile:

# ~/.victor/profiles.yaml
profiles:
  production:
    provider: anthropic
    model: claude-sonnet-4-20250514

3. Check profile syntax:

# Validate YAML
python -c "import yaml; yaml.safe_load(open('~/.victor/profiles.yaml'))"

4. Use default profile:

victor chat "Hello"  # Uses default profile

Issue: Invalid Configuration

Symptom:

victor chat "Hello"
# ERROR: Invalid configuration in ~/.victor/profiles.yaml

Solutions:

1. Validate YAML syntax:

# Check for syntax errors
cat ~/.victor/profiles.yaml | python -m yaml

2. Check common YAML errors:

# WRONG (spaces vs tabs)
profiles:
  production:    # 2 spaces
    provider: anthropic
  └── model: claude  # Tab character (wrong!)

# CORRECT
profiles:
  production:      # 2 spaces
    provider: anthropic
    model: claude-sonnet-4-20250514  # 4 spaces (2+2)

3. Reset configuration:

# Backup current config
mv ~/.victor/profiles.yaml ~/.victor/profiles.yaml.bak

# Create new config
victor config init

Issue: Settings Not Applied

Symptom:

# Settings in profiles.yaml not being used

Solutions:

1. Check profile is being used:

# Explicitly specify profile
victor --profile production chat "Hello"

# Or check default profile
victor config show

2. Check for conflicting CLI flags:

# CLI flags override profile settings
victor chat --provider ollama "Hello"  # Overrides profile

3. Verify config location:

# Should be at ~/.victor/profiles.yaml
ls -la ~/.victor/profiles.yaml

4. Check for multiple configs:

# Only one config file should exist
find ~ -name "profiles.yaml" -path "*/.victor/*"


Context Issues

Issue: Context Not Preserved Between Providers

Symptom:

/provider openai
# Loses conversation history

Solutions:

1. Check ConversationController:

# Context should be preserved automatically
# If not, check logs
victor logs --tail 100 | grep -i context

2. Use same session:

# Don't exit and restart
# Stay in same conversation

3. Report bug:

# If context is lost, this is a bug
# Create issue with logs
victor logs > victor-logs.txt
# Upload to GitHub issue

Issue: Context Too Long

Symptom:

victor chat "Continue"
# ERROR: Context exceeds model limit

Solutions:

1. Clear conversation:

# Start new conversation
victor chat --new "Hello"

2. Summarize and continue:

# Ask Victor to summarize
victor chat "Summarize our conversation so far"

# Start new conversation with summary
victor chat --new "Here's context: [paste summary]. Continue with..."

3. Use model with larger context:

# Claude, Gemini: 1M-2M tokens
victor chat --provider anthropic "Continue"

# Check context window
victor providers --provider anthropic --info


Tool Issues

Issue: Tool Execution Failed

Symptom:

victor chat "Read auth.py"
# ERROR: Tool execution failed: read_file

Solutions:

1. Check tool is available:

victor tools | grep read_file

2. Check file permissions:

# File must be readable
ls -la auth.py

# Fix permissions
chmod +r auth.py

3. Check file exists:

# Use absolute path
victor chat "Read /home/user/project/auth.py"

# Or check current directory
pwd

4. Enable debug logging:

victor --debug chat "Read auth.py"

Issue: Tool Not Found

Symptom:

victor chat "Execute pytest"
# ERROR: Tool 'pytest' not found

Solutions:

1. List available tools:

victor tools

2. Install tool dependencies:

# Some tools require external commands
# e.g., pytest requires pytest to be installed
pip install pytest

3. Check tool name:

# Tool names are specific
victor chat "Run tests"  # Victor chooses right tool
# NOT
victor chat "Execute tool pytest"  # Wrong

Issue: Tool Deduplication - Expected Tool Missing

Symptom:

victor tools list
# Expected tool not in list (e.g., lgc_wikipedia missing)

Solutions:

1. Check if tool was deduplicated:

# Check logs for deduplication messages
victor logs --tail 100 | grep -i dedup
# Should show: "Skipped lgc_wikipedia (source=langchain) in favor of wikipedia"

2. Check deduplication settings:

# View current deduplication configuration
victor config show | grep dedup

3. Add tool to whitelist (if you need both):

# ~/.victor/profiles.yaml
profiles:
  default:
    tools:
      deduplication_whitelist:
        - wikipedia
        - lgc_wikipedia

4. Disable deduplication (not recommended):

# ~/.victor/profiles.yaml
profiles:
  default:
    tools:
      enable_tool_deduplication: false

5. Check priority order:

# Native tools have priority over adapters
# If you have native 'wikipedia', 'lgc_wikipedia' will be skipped
victor tools list | grep wikipedia

Issue: Tool Has Unexpected Prefix

Symptom:

victor tools list
# Shows mcp_github_search instead of github_search
# Or lgc_wikipedia instead of wikipedia

Solutions:

1. Check if naming enforcement is enabled:

victor config show | grep naming_enforcement
# Should show: deduplication_naming_enforcement: true

2. This is expected behavior:

# LangChain tools get lgc_ prefix
# MCP tools get mcp_ prefix  
# Plugin tools get plg_ prefix
# Native tools have no prefix

3. Disable naming enforcement (if needed):

# ~/.victor/profiles.yaml
profiles:
  default:
    tools:
      deduplication_naming_enforcement: false

4. Use full tool name:

# Reference tool with prefix
victor chat "Search GitHub using mcp_github_search"

Issue: Too Many Duplicate Tools

Symptom:

victor tools list
# Shows multiple tools with similar names
# e.g., search, lgc_search, mcp_search

Solutions:

1. Check if deduplication is enabled:

victor config show | grep enable_tool_deduplication

2. Enable deduplication:

# ~/.victor/profiles.yaml
profiles:
  default:
    tools:
      enable_tool_deduplication: true

3. Check priority order:

# ~/.victor/profiles.yaml
profiles:
  default:
    tools:
      deduplication_priority_order:
        - native      # Highest priority
        - langchain
        - mcp
        - plugin      # Lowest priority

4. Verify logs show deduplication:

victor logs --tail 50 | grep -i "conflict resolved"
# Should show which tools were kept/skipped


Log Analysis

Viewing Logs

# View recent logs
victor logs --tail 50

# Follow logs
victor logs --follow

# Filter by level
victor logs --level ERROR

# Save logs to file
victor logs > victor-logs.txt

Finding Errors

# Search for errors
victor logs | grep ERROR

# Search for warnings
victor logs | grep WARN

# Search for specific provider
victor logs | grep anthropic

# Search for tool execution
victor logs | grep tool.execution

Log Levels

Level Description When to Use
DEBUG Detailed diagnostic info Troubleshooting, development
INFO General informational Normal operation
WARNING Warning messages Potential issues
ERROR Error messages Failures, exceptions
CRITICAL Critical failures Crashes, data loss

Set log level:

# ~/.victor/config.yaml
logging:
  level: DEBUG  # DEBUG, INFO, WARNING, ERROR, CRITICAL
  file: /var/log/victor.log


When to Open an Issue

Before opening an issue:
1. Check existing issues: https://github.com/anvai-labs/victor/issues
2. Search discussions: https://github.com/anvai-labs/victor/discussions
3. Try troubleshooting steps above
4. Collect logs and error messages

When to open an issue:
- ✅ Bug: Victor crashes or behaves incorrectly
- ✅ Feature request: New functionality
- ✅ Documentation: Unclear or missing docs
- ✅ Performance: Unexpected slowness

When NOT to open an issue:
- ❌ Usage questions: Use discussions
- ❌ Provider issues: Contact provider support
- ❌ Hardware issues: Check your system
- ❌ Network issues: Check your connection

Issue Template:

## Description
[Brief description of the issue]

## Steps to Reproduce
1. Run this command: `victor chat "Hello"`
2. See error: [error message]

## Expected Behavior
[What you expected to happen]

## Actual Behavior
[What actually happened]

## Environment
- OS: [macOS, Linux, Windows]
- Python version: [3.12, 3.13, etc.]
- Victor version: [from `victor --version`]
- Provider: [anthropic, openai, ollama, etc.]

## Logs
[Paste relevant logs here]

## Additional Context
[Any other information]

Getting Help

Documentation

Community

Diagnostic Commands

Run diagnostics and share output:

# Full diagnostic report
victor doctor

# Save to file
victor doctor > victor-diagnostic.txt

# Share in GitHub issue


Quick Reference

Common Commands

# Diagnostics
victor --version
victor providers
victor tools
victor config show
victor logs --tail 50

# Testing
victor chat "Hello" --provider ollama
victor chat "Hello" --provider anthropic

# Configuration
victor config profiles
victor config show

# Logs
victor logs --tail 100
victor logs --follow
victor logs --level ERROR

Environment Variables

# API Keys
export ANTHROPIC_API_KEY=sk-ant-...
export OPENAI_API_KEY=sk-proj-...
export GOOGLE_API_KEY=...

# Local Providers
export OLLAMA_HOST=127.0.0.1:11434
# providers.vllm.base_url: http://127.0.0.1:8000  (in ~/.victor/profiles.yaml)

# Debug
export VICTOR_LOG_LEVEL=DEBUG
export VICTOR_LOG_FILE=/var/log/victor.log

Configuration Files

~/.victor/profiles.yaml   # Provider/model profiles
~/.victor/config.yaml      # Global settings
~/.victor/mcp.yaml         # MCP server config
.victor.md                  # Project context
CLAUDE.md                   # AI instructions

Native Extensions & Version Drift

The Rust native extensions (victor-native wheel) release in lockstep with
victor-ai, but existing installs never upgrade the wheel — the
victor-ai[native] extra is only a floor for fresh installs. A stale native
binary then silently executes under newer Python code. On 2026-11-06 this
exact drift (victor_native 0.15.0 under victor-ai 0.26.x) pinned a chat
session at 100% CPU inside a native dedup livelock that current Rust had
fixed months earlier.

Check: victor doctor

Native Extensions │ ✗ │ victor_native 0.15.0 is older than victor-ai 0.26.2
                  │    │ — a stale native wheel is in use ...
  • Stale major.minor → ERROR, exit code 1. Fix immediately (below).
  • Patch drift → WARNING. Same major.minor; realign when convenient.
  • newer / skipped (INFO) → source builds or an explicit
    VICTOR_NATIVE_SKIP_VERSION_CHECK=1; no action needed.

Victor also logs a loud warning at startup when a stale wheel is loaded —
check ~/.victor/logs/victor.log for stale native wheel is in use.

Fix a stale native wheel

# Installed from PyPI:
pip install -U 'victor-ai[native]'

# Source checkout (builds the current rust/ workspace into your venv):
cd rust && maturin develop --release

Developers: make install-dev pins victor-native to the checkout's
VERSION automatically (best-effort). If you build native from source, set
VICTOR_NATIVE_SKIP_SYNC=1 so install-dev does not overwrite your build
with the published wheel.

Session Hangs or 100% CPU

A wedged session usually looks like: the model finished responding, but the
process stays at ~100% CPU and never returns to the prompt.

1. Dump the stacks (no root required)

Victor installs an in-process diagnostics handler (unless
VICTOR_FAULTHANDLER=0): send SIGUSR1 and every thread's Python stack prints
to the terminal where victor is running:

ps auxwww | grep victor        # find the pid
kill -USR1 <pid>               # stacks appear in the victor terminal

The bottom frames tell you the story: a tight loop inside
victor_native::... means native code (check wheel drift above); a kevent
/ select leaf with high CPU means an event-loop flood, not a compute hang.

2. Confirm it is actually spinning (not just busy)

ps -o pid,cputime,command -p <pid>   # note the CPU time
sleep 5
ps -o pid,cputime,command -p <pid>   # grew by ~5s → pinned core

3. macOS fallback without USR1 support

py-spy needs root on macOS; the stock sample tool does not:

/usr/bin/sample <pid> 3 -file /tmp/sample.txt   # note: /usr/bin/sample —
                                                # a venv may shadow `sample`
grep -A5 "Call graph" /tmp/sample.txt

4. Known-fixed classes

  • Unclosed code fence livelock (2026-11-06): a model response ending in
    an unterminated code fence (``) spunsplit_into_blocks` forever. Fixed in
    v0.26.2+ (PR #1700); if you see it, upgrade the native wheel first.
  • Graph watch daemon stuck at 100% CPU: victor.ui.cli graph watch
    foreground daemons can livelock in an fsevents storm and may ignore
    SIGTERM — use kill -9 on the daemon pid (it is stateless; the next chat
    session restarts it). Under investigation.

5. Where session data lives (for bug reports)

~/.victor/logs/victor.log          # per-run log; contains session ids
<project>/.victor/project.db       # sessions, messages, checkpoints (sqlite)
~/.victor/victor.db                # global: RL telemetry (rl_outcome), usage

A session string seen in the UI or a stack trace can be located with
sqlite3 <db> "SELECT ... WHERE session_id LIKE '%<prefix>%'"
across both databases.

Provider Model Registration (Context-Window Mis-Resolution)

This runbook covers the class of failure where a new model (e.g. a newly
released flagship like glm-5.2) causes the UI to freeze, the agent to emit
empty responses, and the streaming executor to loop on "aggressive recovery"
—even though the model itself advertises a very large context window.

Problem

A provider profile advertises a model with a large context window (e.g. 1M
context), but once the conversation grows past a low threshold the session
freezes. Logs show a degenerate loop:

WARNING - chat_stream_helpers - Stream completed without content or tool calls
WARNING - chat_stream_helpers - Provider payload required tool-history repair: ... removed=1 ...
WARNING - chat_stream_executor - Model returned empty response - attempting aggressive recovery

Root Cause

The runtime does not read the advertised context window from
~/.victor/profiles.yaml (that loader only maps provider, model,
coding_plan, temperature, max_tokens, description). The effective window
comes from provider.context_window(model) (the BaseProvider API), consumed at
victor/agent/services/tool_service.py:2799 (_get_tool_context_window).

Two registration gaps cause the freeze:

  1. Missing context_window() override. The base class method has its own
    lookup table (victor/providers/base.py:1075) that does NOT include the new
    model. Unknown models fall back to 8192 tokens
    (base.py:1150 warns Unknown model ... using default context window of 8192).
  2. Missing registry entry. If the provider only ships a custom
    get_context_window() (note the get_ prefix), it is not consulted by
    the tool/KV-budgeting path — the base context_window() wins.

With the window mis-resolved to 8192:
- max_tool_tokens = int(8192 * 0.25) = 2048 for the tool schema budget
(tool_service.py:2740).
- KV session-locking is disabled (8192 >= 32000 is False,
tool_service.py:2810).
- Context pruning/compaction is tuned to a ceiling ~125x too small, so the
tool-history repair path starts removing messages — breaking the
OpenAI tool-call ↔ tool-result pairing and triggering the empty-response
recovery loop that manifests as the freeze.

Diagnosis

Confirm what the runtime actually sees (this is the authoritative check):

python -c "
from victor.providers.zai_provider import ZAIProvider
p = ZAIProvider(api_key='x')
for m in ['glm-5.2','glm-5.2:coding','glm-5.1','glm-4.6']:
    print(f'{m:16} context_window()={p.context_window(m)}')
"

A healthy result shows the model's true window (e.g. 1000000). An unhealthy
result shows 8192 or a value far below the advertised window, plus the
Unknown model ... using default context window of 8192 warning.

Solutions

Preferred (config-driven, no code change):

  1. Register the model in victor/config/provider_context_limits.yaml. This is
    the single source of truth for context windows at runtime —
    BaseProvider.context_window() consults it first, before any hardcoded
    provider table. Add a fnmatch pattern under models: (takes precedence over
    the provider default), or a provider block under providers::
providers:
  zai:                      # provider-level default for all GLM models
    context_window: 200000
    response_reserve: 8192
    supports_extended_context: true

models:
  "glm-5.3*":              # model-specific override (highest precedence)
    context_window: 1000000  # Z.AI: 1M context
    response_reserve: 131072  # 128K maximum output

For Sandhi-backed providers, also register the model in
victor/config/openai_compat_model_policy.yaml: its context-window routes
take precedence in the provider's context_window() method, and its model
catalog advertises max_output for discovery.

response_reserve budgets context; it does not change the per-request
max_tokens in ~/.victor/profiles.yaml. The Z.AI GLM-5.3 API supports
up to 128K output tokens, but a profile may choose a smaller operational
limit (for example, 32768) to control latency and usage.

Official model references used to check the additional model limits:
GLM-5.2 (1M context, 128K output),
GLM-5.1 (200K context, 128K output),
GPT-5 nano
(400K context, 128K output), and
Gemini 2.5 Pro
(1,048,576 input tokens, 65,536 output tokens). Profiles with custom
gateway model IDs or locally served variants must be checked against their
deployed limits; do not infer those limits from the model name alone.
Groq's model table lists
llama-3.3-70b-versatile at 131,072 context / 32,768 maximum completion
and openai/gpt-oss-120b at 131,072 / 65,536. These are hosted limits,
not proof that a locally hosted model with a similar name shares them.

Resolution order at runtime:
1. models: fnmatch pattern (e.g. glm-5.2* matches glm-5.2 and
glm-5.2:coding)
2. providers: block default for the provider
3. the provider's hardcoded <PROVIDER>_MODELS table (legacy fallback)
4. 8192 safe default

  1. Re-run the diagnosis snippet above — both the exact name and any suffix
    variant (e.g. glm-5.2:coding) must resolve to the true window.

Adding a new model is now a YAML edit. You only need to touch provider
code if the model also needs non-window metadata (max_output,
supports_thinking, etc.) for that provider's list_models() / capability
advertising. For context-window sizing alone, use the YAML.

Fallback (code edit, for providers without a YAML entry):

  1. Add an exact entry to the provider's <PROVIDER>_MODELS table (e.g.
    ZAI_MODELS in victor/providers/zai_provider.py), placed so exact-match
    wins, AND ensure context_window() (no get_ prefix) is overridden to
    delegate to it:
def context_window(self, model: str) -> int:
    return self.get_context_window(model)

Note: adding context_window: to ~/.victor/profiles.yaml will not fix
this — the profile loader ignores that field. Use
victor/config/provider_context_limits.yaml (the runtime override) instead.

Prevention (Adding Any New Model)

Follow this checklist whenever a new model is added (new release, new provider,
or new suffix/variant):

  1. Add a models: pattern to provider_context_limits.yaml with the
    correct context_window. This makes the window available to the runtime
    budgeting path with no code change.
  2. Confirm context_window(model) resolves correctly by running the
    diagnosis snippet — verify the exact name AND every suffix/variant used in
    profiles (e.g. :coding, :china).
  3. Check get_provider_category() (victor/config/tool_tiers.py:184) —
    tool-broadcasting strategy is tiered by window (<16384, <131072, ...);
    a mis-resolved window picks the wrong strategy.
  4. Watch the logs for the failure signature on first real use:
    Unknown model ... using default context window of 8192, or the
    tool-history repair ... removed= / attempting aggressive recovery loop.
    If either appears, the model is not registered for the budgeting path.
  5. Add/extend the provider's unit test asserting
    provider.context_window(model) returns the expected value for each
    supported model name (see test_context_window_config_driven_override in
    tests/unit/providers/test_zai_provider_ext.py for the config-driven
    pattern).
  • victor/config/provider_context_limits.yaml — runtime source of truth
    for context windows (config-driven; edit this to register a new model)
  • victor/config/config_loaders.py:166 — get_provider_limits() YAML loader
    (fnmatch patterns, TTL cache, hot-reload via invalidate_config_cache())
  • victor/providers/base.py:1055 — context_window() consults the YAML first,
    then falls back to its hardcoded table (8192 fallback at :1150)
  • victor/providers/<provider>_provider.py — hardcoded <PROVIDER>_MODELS
    registry (legacy fallback when no YAML entry exists)
  • victor/agent/services/tool_service.py:2799,2740,2810 — runtime consumers
  • victor/config/tool_tiers.py:184 — provider category by window size


Installing Directly from GitHub

Every release tag is installable straight from the public repository, with
native wheels that match the tag exactly:

pip install "victor-ai[native] @ git+https://github.com/anvai-labs/victor.git@v0.26.2"

See Installation → Method 5
for the @develop channel and its native-rebuild caveat, and run
victor doctor afterwards to verify the install.


Still stuck? Open an issue →

Next: User Guide | Provider Reference | Configuration Options