---
estimated_steps: 6
estimated_files: 1
skills_used: []
---

# T02: Modality-aware LLMClient with think-tag stripping

1. Add strip_think_tags(text) utility function that removes <think>...</think> blocks
2. Handle multiline, multiple blocks, and no-block passthrough
3. Add modality parameter to LLMClient.complete() with model_override
4. For 'thinking' modality: skip response_format json_object, append JSON instructions to system prompt, strip think tags from response
5. For 'chat' modality: keep current behavior
6. Use model_override if provided, otherwise fall back to settings default

## Inputs

- `backend/pipeline/llm_client.py`

## Expected Output

- `backend/pipeline/llm_client.py (updated)`

## Verification

cd backend && python3 -c "from pipeline.llm_client import strip_think_tags; assert strip_think_tags('<think>reasoning</think>{\"a\": 1}') == '{\"a\": 1}'; print('PASS')"
