Skip to content

fix(wiki): ensure prompt language is always resolved - #2543

Merged
lyingbug merged 1 commit into
Tencent:mainfrom
lyingbug:fix/wiki-language-resolution
Aug 5, 2026
Merged

fix(wiki): ensure prompt language is always resolved#2543
lyingbug merged 1 commit into
Tencent:mainfrom
lyingbug:fix/wiki-language-resolution

Conversation

@lyingbug

@lyingbug lyingbug commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add unified language resolution helpers (ResolveLanguage, ResolveLanguageName, LanguageFromContextOrDefault) so async workers never interpolate an empty {{.Language}} into wiki and related prompts.
  • Fix wiki ingest enqueue/consume paths: pending ops, map/reduce, and retract updates now persist and recover language via context/default fallbacks.
  • Align other async task payloads (document processing, summary refresh, follow-up suggestions) to use the same resolution rules.

Test plan

  • go test ./internal/types/... ./internal/application/service/... -run 'TestResolveLanguage|TestResolveLanguageName|TestLanguageFromContextOrDefault|TestNewWikiIngestPendingOp|TestResolveSlugUpdateLanguage|TestWikiPromptsNeverRenderAnEmptyLanguage'
  • Upload a document to a wiki-enabled KB and verify generated wiki prompts include Write in Chinese (Simplified). (or the configured language)
  • Trigger wiki generation from a background path (e.g. clone/move or reparse) and confirm language is still present in reduce prompts
  • Delete a source document and verify retract-only wiki updates still carry language in the editor prompt

Wiki generation sometimes rendered "Write in ." because async workers
read empty locale payloads without falling back to context or defaults.
Unify language resolution helpers and apply them at enqueue and consume
time so every wiki and related async prompt gets a non-empty language.
@lyingbug
lyingbug merged commit 39f4220 into Tencent:main Aug 5, 2026
2 checks passed
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.

1 participant