docs: add master audit and follow-up issue drafts#572
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a comprehensive master audit document and several detailed issue drafts aimed at addressing technical debt and architectural inconsistencies across the backend and frontend. The audit highlights critical areas for improvement, including divergent provider naming conventions, the monolithic nature of the LLM client, inconsistent API error envelopes, and duplicated SSE configuration logic. Feedback on the audit document suggests expanding the proposed canonical provider enum to include missing providers like Anthropic and GitHub Copilot to ensure the documentation accurately reflects the intended system architecture.
| - Risk: high | ||
| - Problem: Runtime config aliases map `gemini -> google`, while other API/contracts expose both `gemini` and `google` conventions. | ||
| - Evidence: `_PROVIDER_ALIASES` normalizes to `google`; invalid-provider error message only lists `google`, not `gemini`. | ||
| - Recommended fix: Introduce one canonical provider enum in shared contract (`ollama|openai|gemini|custom_openai`), and normalize all route and registry layers to it. |
There was a problem hiding this comment.
The proposed canonical provider enum (ollama|openai|gemini|custom_openai) is inconsistent with the current codebase. github_copilot is defined in the backend, and anthropic is present in the frontend. Following the principle that documentation should reflect intended functionality, these should be included in the audit. Furthermore, the backend should be updated to implement anthropic to match the frontend contract, rather than allowing the documentation to remain inconsistent with the intended full provider set.
| - Recommended fix: Introduce one canonical provider enum in shared contract (`ollama|openai|gemini|custom_openai`), and normalize all route and registry layers to it. | |
| (ollama|openai|gemini|anthropic|github_copilot|custom_openai) |
References
- When documentation is inconsistent with the code because the code is incomplete, the correct action is to implement or add the missing code features rather than removing the documentation.
|
Schließe als duplicate-Pfad (Triage-Review 2026-05-24). Issue-Drafts in
Parent-Audit-Issue #571 ist ebenfalls CLOSED. Damit würde der Audit-Bericht selbst ( Nicht eingearbeitet: Gemini-Vorschlag, Anthropic + GitHub Copilot in die kanonische Provider-Enum aufzunehmen. Empfehlung: close, Audit-MD separat als Doku-PR neu öffnen. |
Motivation
Description
docs/audits/master-audit-2026-05-22.mdthat enumerates findings with file references, risk levels, and recommended fixes.docs/issues/addressing provider naming unification, API error envelope v2, splitting the monolithicllm_client.py, and centralizing SSE retry/reconnect config; each draft includes evidence and acceptance criteria.docs: add master audit and actionable follow-up issue draftsand the five new files staged underdocs/audits/anddocs/issues/.Testing
rg --files,rg -n <patterns> backend/app frontend/src, andnl -ba <file>to collect concrete references, and these inspection commands completed successfully.docs/audits/master-audit-2026-05-22.mdanddocs/issues/2026-05-22-*.mdand committed them withgit commit, which succeeded.Codex Task