tftsr-devops_investigation/docs/v1.0.7-summary.md
Shaun Arman 093495a653
Some checks failed
Test / rust-fmt-check (pull_request) Failing after 0s
Test / rust-clippy (pull_request) Failing after 1s
Test / rust-tests (pull_request) Failing after 0s
Test / frontend-typecheck (pull_request) Failing after 16s
Test / frontend-tests (pull_request) Failing after 18s
PR Review Automation / review (pull_request) Failing after 4m13s
feat: full copy from apollo_nxt-trcaa with complete sanitization
Complete backport of all features from apollo_nxt-trcaa repository:
- Three-tier shell execution safety system (Tier 1: auto, Tier 2: approve, Tier 3: deny)
- Ollama function calling with tool use support
- AI provider tool calling auto-detection
- kubectl binary bundling and management
- kubeconfig upload and context management
- Shell approval modal with real-time UI
- MCP protocol HTTP transport with custom headers
- Enhanced security audit logging
- Comprehensive test coverage (275+ tests)
- Updated CI/CD workflows for Gitea Actions
- Complete documentation (ADRs, wiki, release notes)

Sanitization applied to all files:
- Removed all MSI, Motorola, VNXT, Vesta references
- Replaced internal infrastructure references with TFTSR equivalents
- Updated all URLs and API endpoints
- Sanitized commit history references in documentation

Technical changes:
- New modules: shell/classifier, shell/executor, shell/kubectl, shell/kubeconfig
- Enhanced AI providers: ollama.rs, openai.rs with function calling
- New Tauri commands: shell execution, kubeconfig management, tool calling detection
- Database migrations: shell_execution_audit table
- Frontend: ShellApprovalModal, ShellExecution, KubeconfigManager pages
- CI/CD: kubectl bundling, multi-platform builds, Gitea Actions integration

Version: 1.0.8

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-06-05 14:12:43 -05:00

5.8 KiB

Version 1.0.7 Release Summary

Release Date: 2026-06-03
Type: Bug Fix
Focus: Ollama Function Calling Support


Overview

Version 1.0.7 adds function calling (tool use) support to the Ollama AI provider, enabling local Ollama models to execute shell commands and interact with system tools just like OpenAI-compatible providers.


What Changed

Function Calling Support for Ollama

Problem: The Ollama provider was ignoring the tools parameter and could not execute function calls (like execute_shell_command). Models would output text descriptions of tool calls instead of actually invoking them.

Solution: Implemented full function calling support in the Ollama provider:

  1. Tool Registration: Ollama provider now accepts and formats tools in the request
  2. Tool Call Parsing: Response handler parses tool_calls from Ollama API responses
  3. Arguments Handling: Supports both object and string argument formats
  4. ID Generation: Generates fallback IDs when Ollama doesn't provide them

Files Changed:

  • src-tauri/src/ai/ollama.rs - Added function calling support

Technical Details

Ollama API Integration

The Ollama provider now sends tools in the request body:

{
  "model": "llama3.1:8b",
  "messages": [...],
  "stream": false,
  "tools": [
    {
      "type": "function",
      "function": {
        "name": "execute_shell_command",
        "description": "Execute shell commands...",
        "parameters": {...}
      }
    }
  ]
}

Response Parsing

Parses tool calls from Ollama's response format:

{
  "message": {
    "content": "...",
    "tool_calls": [
      {
        "id": "call_123",
        "function": {
          "name": "execute_shell_command",
          "arguments": {"command": "kubectl get pods"}
        }
      }
    ]
  }
}

Before vs After

Before (v1.0.6)

User: "Can you tell me all the namespaces in devops1-fed1?"

Ollama Response (broken):

tool_calls: 
  - command: kubectl get ns --all-namespaces=false
    output_format: table

Output is just text, no actual command execution

After (v1.0.7)

User: "Can you tell me all the namespaces in devops1-fed1?"

Ollama Response (working):

  • Executes: kubectl get namespaces
  • Returns: Actual namespace list from cluster
  • Format: Natural language summary with data

Impact

User Benefits

  • Local Ollama models now work properly with diagnostic commands
  • No cloud API required for function calling (privacy benefit)
  • Consistent behavior across OpenAI and Ollama providers
  • Lower costs by using local models for incident response

Developer Benefits

  • Unified tool interface across all providers
  • Easier testing with local models
  • Better debugging without API dependencies

Testing

Test Cases

  1. Simple Information Query:

    • Input: "What pods are running in subsys-sub1?"
    • Expected: Executes kubectl get pods -n subsys-sub1 and returns results
  2. Diagnostic Investigation:

    • Input: "Investigate telemetry issues in devops1-fed1"
    • Expected: Executes multiple kubectl commands, analyzes results
  3. Tool Call Arguments:

    • Test both object and string argument formats
    • Verify proper JSON serialization

Verified Models

  • llama3.1:8b - Full function calling support
  • gemma4:e2b - Full function calling support
  • ⚠️ Other models may require testing (phi3, mistral, codellama)

Migration Guide

For Users

No configuration changes required. If you're using Ollama provider, function calling will now work automatically.

For Developers

No code changes required. The Ollama provider signature matches the existing Provider trait.


Known Limitations

  1. Model Support: Function calling availability depends on the Ollama model's capabilities. Not all models support tools.

  2. Response Format: Ollama's tool call format may vary slightly from OpenAI's. The provider handles common variations.

  3. Error Handling: If Ollama returns malformed tool calls, they are skipped and the response content is returned instead.


  • Fixes: Tool calls not working with local Ollama
  • Related to: PR #40 (removed JSON examples from agent prompts)
  • Complements: liteLLM timeout fixes for remote models

Upgrade Instructions

  1. Pull latest code: git pull origin main
  2. Rebuild application: npm run tauri build
  3. Install updated app: Replace existing .app in /Applications/
  4. Test function calling: Use Ollama provider with diagnostic queries

Future Enhancements

Potential Improvements

  1. Streaming Support: Add function calling for streaming responses
  2. Tool Choice Control: Support tool_choice parameter (auto/required/none)
  3. Parallel Tool Calls: Handle multiple simultaneous tool invocations
  4. Model Capability Detection: Auto-detect which Ollama models support tools

Compatibility

This release maintains backward compatibility with:

  • OpenAI provider function calling
  • Anthropic provider function calling
  • Gemini provider function calling
  • TFTSR GenAI custom format

Credits

  • Issue Identification: Testing revealed Ollama tool calling regression after PR #40
  • Root Cause Analysis: Ollama provider was ignoring tools parameter entirely
  • Implementation: Added full function calling support matching OpenAI format
  • Testing: Verified with llama3.1:8b and gemma4:e2b models

Version History

  • v1.0.7 (2026-06-03): Added Ollama function calling support
  • v1.0.6 (2026-06-03): Removed JSON examples from agent prompts
  • v1.0.5 (2026-06-03): Agent output quality improvements

Release Type: Bug Fix
Breaking Changes: None
API Changes: None (internal implementation only)
Documentation Updated: Yes