This directory contains test scripts for validating grok-cli features.
Purpose: Automated functional testing of temperature configuration feature Coverage: CLI temperature flags, validation, default behavior, persistence
Usage:
cd /Volumes/DM 2T/Source/Agents/grok-cli
zsh tests/temperature-feature-test.zshTest Cases:
- Valid temperature values (0.0, 0.7, 5.0)
- Invalid temperature rejection (-0.1, 5.1, non-numeric)
- Default temperature behavior (0.7)
- State persistence validation
Purpose: Validate Venice AI backend connection (bug fix verification) Coverage: Tests that Venice AI no longer receives unsupported 'think' parameter
Usage:
cd /Volumes/DM 2T/Source/Agents/grok-cli
bun tests/test-venice.jsRequirements:
- VENICE_API_KEY environment variable must be set
- Project must be built (
bun run build)
Test Cases:
- Venice AI connection without HTTP 400 errors
- Basic message exchange with Venice backend
Purpose: Unit test for duplicate JSON handling in tool call arguments (bug fix verification) Coverage: Tests that concatenated/duplicated JSON objects are properly handled
Usage:
cd /Volumes/DM 2T/Source/Agents/grok-cli
bun tests/test-duplicate-json.tsRequirements:
- Project must be built (
bun run build)
Test Cases:
- Exact duplicate objects
- Different duplicate objects
- Triple duplication
- Nested objects duplicated
- Arrays in duplicated objects
- Single valid JSON (regression test)
- Empty object duplicated
Purpose: Automated functional testing of slash commands in headless and no-ink modes (bug fix verification)
Coverage: Tests that slash commands work correctly in both -p (headless) and --no-ink (interactive plain) modes
Usage:
cd /Volumes/DM 2T/Source/Agents/grok-cli
zsh tests/test-slash-commands-headless.zshRequirements:
- Project must be built (
bun run build)
Test Cases:
/helpcommand in headless mode/introspectcommand in headless mode/contextcommand in headless mode/personacommand in headless mode/moodcommand in headless mode/clearcommand in headless mode/modelswith argument in headless mode/modelswithout argument (error expected)/context viewin headless mode (error expected)/context editin headless mode (error expected)
Purpose: Documentation of tool argument validation feature (bug fix documentation) Coverage: Explains how tool arguments are validated against schemas to prevent Ollama 400 errors
Context:
- When LLMs return duplicate JSON tool arguments, the duplicate-JSON fix extracts the first object
- If the tool was called with wrong parameters (e.g.,
getAvailablePersonaswith apersonaparameter), Ollama rejects with400 invalid tool call arguments - Tool validation catches these errors before sending to Ollama, providing clear feedback to the LLM
Implementation:
validateToolArguments()method validates against tool schemas- Checks for: no-parameter tools with arguments, unknown parameters, missing required parameters
- Returns helpful error messages instead of Ollama 400 errors
Tests use mock settings to avoid API dependencies and should be executed in the project root directory.
Test output includes pass/fail indicators and a summary of results.
Add new test scripts to this directory with descriptive names following the pattern: feature-name-test.zsh