Skip to content

Conversation

HenkDz
Copy link
Contributor

@HenkDz HenkDz commented Aug 27, 2025

Summary

  • Default to LMStudio base URL when headers are missing, and remember the last working base URL from the models list for chat.
  • Surface non-retryable streaming errors (e.g., 401) to the client with clear, actionable messages.
  • Make Windows logging UTF-8 safe and provide a global logger instance.
  • Add diagnostics: log model-list HTTP errors.

Why

  • LMStudio users could list models but chat failed when headers weren’t forwarded; this enables out-of-the-box local usage.
  • Streaming errors were opaque; now users see explicit reasons and next steps.
  • Windows consoles/files previously hit cp1252 Unicode errors; resolved with UTF-8-safe handlers.

Changes

  • backend/controller/conversation_api.py: LMStudio/default base URL fallback; early auth messaging if neither key nor LMStudio URL is present.
  • backend/utils/globals.py: add LAST_OPENAI_BASE_URL with getters/setters.
  • backend/controller/llm_api.py: remember base URL after successful models list; log failures.
  • backend/service/mcp_client.py: propagate non-retryable error text to the stream.
  • backend/utils/logger.py: UTF-8-safe logging; export global log.

Testing

  • Model list works with LMStudio set in settings.
  • Chat runs without an OpenAI key when LMStudio base URL is present or remembered.
  • Unicode logging no longer crashes on Windows.

Notes

  • No schema changes. UI still passes headers when configured; backend has sensible defaults for local LMStudio.

HenkDz added 6 commits August 22, 2025 22:31
… no cache; part of LMStudio flow follow-up (no dist)
…KFLOW_MODEL_NAME

- Updated workflow_rewrite_agent.py to use user's selected model
- Updated debug_agent.py (all agents) to use user's selected model
- Updated workflow_rewrite_agent_simple.py to use user's selected model
- All agents now fall back to WORKFLOW_MODEL_NAME if no user selection
@ai-business-hql
Copy link
Collaborator

I'll test it as soon as possible.

@ai-business-hql
Copy link
Collaborator

You changed a lot, I'm afraid that my function be affected, so I'll test fully, and need to take some time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants