Skip to content

fix(ai): return user-friendly errors across AI features - #1035

Merged
WCY-dt merged 1 commit into
DevXDojo:release/v1.3.28from
marcomarcogd:codex/fix-ai-friendly-errors
Aug 27, 2026
Merged

fix(ai): return user-friendly errors across AI features#1035
WCY-dt merged 1 commit into
DevXDojo:release/v1.3.28from
marcomarcogd:codex/fix-ai-friendly-errors

Conversation

@marcomarcogd

Copy link
Copy Markdown
Contributor

Description

Classifies AI provider and transport failures into stable, user-facing error codes and short localized messages. Long provider JSON, authentication details, and complete responses are no longer returned to AI search, configuration tests, Profile tests, summaries, or translation UI paths.

Type of Change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📝 Documentation update
  • 🎨 Style/UI change
  • ♻️ Code refactoring
  • ⚡ Performance improvement
  • ✅ Test addition/update

Related Issues

Fixes #1034

Changes Made

  • Add stable codes for invalid configuration, usage limits, 401/403, 402, 404, 413, 429, timeout, network, 5xx, and invalid responses.
  • Keep /api/ai/search HTTP 200 plus success=false compatibility while adding error_code.
  • Use one frontend mapper for AI Search, AI/Profile tests, summaries, and translation-related failures.
  • Redact endpoint userinfo, query parameters, and fragments; stop logging search queries, generated terms, SQL, and complete AI responses.

Screenshots

Not included because the before-state can expose provider response data. The frontend regression is covered by the existing test suite in the downstream integration.

Testing

Test Configuration

  • OS: macOS 26
  • MrRSS Version: main@fd351377 / 1.3.27
  • Go Version: 1.27.0
  • Node Version: 24.19.0

Test Steps

  1. go test -v -timeout=5m ./internal/ai ./internal/handlers/ai ./internal/handlers/summary ./internal/handlers/translation
  2. cd frontend && npm run lint
  3. Verified classifications do not include a synthetic provider secret or complete response.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented the public error and endpoint-redaction behavior
  • Documentation changes are not required for this compatibility-preserving fix
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective
  • New and existing target tests pass locally with my changes
  • No dependent change is required

Additional Notes

This PR intentionally excludes Toast layout, article-chat persistence, fork branding, release metadata, and changelog changes. Those concerns are handled separately.

Breaking Changes

None. Existing response fields and the AI Search HTTP 200 error convention remain available.

@WCY-dt
WCY-dt changed the base branch from main to release/v1.3.28 August 25, 2026 14:15
@marcomarcogd
marcomarcogd marked this pull request as ready for review August 26, 2026 00:54
@WCY-dt

WCY-dt commented Aug 26, 2026

Copy link
Copy Markdown
Member

麻烦解决一下冲突

@marcomarcogd
marcomarcogd force-pushed the codex/fix-ai-friendly-errors branch from 8e8b234 to 12a00f1 Compare August 27, 2026 01:39
@marcomarcogd

Copy link
Copy Markdown
Contributor Author

冲突已解决,已基于最新 release/v1.3.28@085e9ff 完成 rebase,并保留已合入的参数化搜索、相关度展示与文章导航逻辑。新提交为 12a00f17。本地 make check、前端 lint/单测/构建、相关 Go 测试及 macOS 构建均通过;相同 Test 工作流的 Backend、Frontend、Build、Skills 也已全部通过:https://github.com/marcomarcogd/MRSS/actions/runs/33030942859 。麻烦复审。

@WCY-dt
WCY-dt merged commit 4263eae into DevXDojo:release/v1.3.28 Aug 27, 2026
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.

[BUG] AI features expose long provider errors in the UI

2 participants