response-language setting for Ask AI and agent review jobs#1018
Open
JaeSeoKim wants to merge 1 commit into
Open
response-language setting for Ask AI and agent review jobs#1018JaeSeoKim wants to merge 1 commit into
JaeSeoKim wants to merge 1 commit into
Conversation
Adds a "Response Language" option (preset dropdown + custom input, Settings AI tab) so Ask AI answers and guide/tour/review agent jobs are written in the user's chosen language. - Ask AI: optional `responseLanguage` on AIContext; buildSystemPrompt / buildForkPreamble append the instruction. A per-query instruction is appended only when settings drift from the session's baked-in language, so a change applies from the very next question without duplication. - Agent jobs: launchJob injects the setting into the job body; guide/tour buildCommand and the review-job user message (Bun + Pi servers) prepend the instruction. Guide repair jobs are deliberately excluded (they must never rewrite content). - Stored as English language name in the cookie `plannotator-ai-response-language`; default Auto (no instruction). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a Response Language setting so users can get AI output in their preferred language (e.g. Korean) instead of English, across both Ask AI chat and launched agent jobs (Guided Review / Code Tour / agent code reviews).
Motivation
Ask AI and guide/tour outputs always come back in English (the model default), which makes the AI features awkward for non-English-speaking users during code review. This adds an opt-in language preference that injects a prompt instruction; default is Auto (no instruction, today's behavior).
What's included
Settings UI (
AISettingsTab)Custom…free-text input.plannotator-ai-response-language(consistent with other cookie-backed prefs; works across random ports).Ask AI
responseLanguagefield onAIContext(all three variants) — rides inside the existingcontextserialization, so no provider or endpoint changes needed; claude / codex / opencode / pi all pick it up viabuildSystemPromptandbuildForkPreamble(forked sessions skip the system prompt, so the fork preamble carries it too).(Respond in …)tail is appended only until a new session picks it up — a change applies from the very next question, with no duplicate instruction in the steady state.Agent jobs (guide / tour / review)
launchJobinjects the setting into the job body;responseLanguageadded to the jobs-endpoint field allowlist and config threading (Bun server + Pi server mirror).agentJobLanguageInstruction()(shared inagent-review-message.ts) is prepended to the guide/tour user message and the review-job user message. Instruction scopes to natural-language output only — file paths, code identifiers, and JSON/schema keys stay as-is, so guide/tour structured output still validates.Testing
buildSystemPrompt/buildForkPreambleinclude/omit the instruction; guidebuildCommandprepends it fromconfig.responseLanguage.bun run typecheckclean; full test suite passes.