neurolink icon indicating copy to clipboard operation
neurolink copied to clipboard

PC-013: Tool Support Detection is Hardcoded

Open murdore opened this issue 1 month ago • 0 comments

Bug Summary

supportsTools() is static per provider, but should check model-specific capabilities. O1 models don't support tools.

Root Cause

File: src/lib/core/baseProvider.ts (lines 122-129) supportsTools() returns true by default. Providers override with static boolean.

Affected Providers

All providers (especially OpenAI with O1 models)

Current Behavior

```typescript // OpenAI provider supportsTools(): boolean { return true; // Returns true for ALL models, including O1 } ```

Problem:

  • OpenAI's O1 models don't support tools
  • Runtime error when tools attempted
  • No model-level capability checking

Expected Behavior

Model-specific capability detection:

  • o1, o1-mini → tools: false
  • gpt-4o → tools: true
  • Check before enabling tools
  • Clear error for incompatible models

Implementation

Create MODEL_CAPABILITIES registry: ```typescript export const MODEL_CAPABILITIES: Record<string, ModelCapabilities> = { 'gpt-4o': { tools: true, vision: true, json: true, streaming: true }, 'o1': { tools: false, vision: false, json: true, streaming: false }, 'o1-mini': { tools: false, vision: false, json: true, streaming: false }, };

export function modelSupports( capability: keyof ModelCapabilities, provider: string, model: string ): boolean { // Check model-specific, fall back to provider defaults } ```

Update BaseProvider: ```typescript supportsTools(): boolean { return modelSupports('tools', this.providerName, this.modelName); } ```

Acceptance Criteria

  • MODEL_CAPABILITIES registry
  • Model-specific checking
  • Accurate for known models
  • Clear errors
  • Tests pass
  • Documentation updated

Priority

Medium - Prevents runtime errors

Effort

4 hours

murdore avatar Dec 01 '25 02:12 murdore