Skip to content

fix(worker): gapanalysis agent always falls back to pipeline — bindtools not supported by ollama provider #439

Description

@AndreLiar

Problem

The gap analysis worker tries to run a LangChain tool-calling agent as its primary path, then falls back to a sequential pipeline when it fails. In prod, the agent always fails immediately:

```
WARN: llm [object Object] must define bindTools method.
INFO: LangChain agent failed, using fallback pipeline
```

Root cause: the `analysis` LLM purpose is configured as `ollama` provider (`gemma3:12b` via Ollama Cloud). The Ollama LangChain integration does not implement `bindTools()` — tool-calling is not supported on this provider path.

Impact

  • Every gap analysis runs the fallback pipeline (not necessarily wrong, but the error log is misleading and the agent path is dead code in prod)
  • If the fallback pipeline ever diverges from the agent's intended behavior, it will be invisible

Fix options

  1. Make fallback the official primary path — remove the try/catch agent wrapper, run the pipeline directly, delete dead agent code
  2. Switch analysis LLM to a provider that supports tool calling — e.g. Groq (`llama-3.3-70b-versatile`) supports `bindTools()`; set `LLM_ANALYSIS_PROVIDER=groq`
  3. Keep both paths but suppress the warning — if the fallback is intentional as a degraded mode

Recommended: option 2 (Groq for analysis) or option 1 (clean up dead code).

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendBackend changesbugSomething isn't workingpriority: mediumMedium priority

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions