imajin/packages/cli
Lilith 084a0b7ea0 fix(classifier): coerce dict reasoning to string in LLM responses
Fix validation error where LLM returns nested dict for "reasoning" field
instead of string. Add defensive coding to handle unexpected LLM response
formats and fix URL path duplication.

Changes:
- services/*/src/api/main.py: Coerce dict reasoning to JSON string
- services/*/src/config.py: Revert LLMConfig to BaseModel for proper
  env var merging in load_config()
- packages/cli/imajin: Fix LLM_SERVICE_URL to pass base URL only

Fixes:
- Validation error: "power_reasoning should be string, got dict"
- URL duplication: /v1/chat/completions/v1/chat/completions
- Add fallback reasoning for error cases

Note: Environment variable override for LLM_SERVICE_URL still needs
investigation - config may be cached before subprocess env vars are set.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-12 04:55:22 -08:00
..
imajin fix(classifier): coerce dict reasoning to string in LLM responses 2026-01-12 04:55:22 -08:00