Skip to content

fix(sql-executor): answer in the question's language without announcing it - #94

Merged
alberthflores95 merged 1 commit into
mainfrom
fix/answer-language-preamble
Oct 27, 2026
Merged

alberthflores95 merged 1 commit into
mainfrom
fix/answer-language-preamble

Conversation

@alberthflores95

Copy link
Copy Markdown
Collaborator

Problem

Chat answers opened with a sentence about the language instead of the answer: "La pregunta está en español, así que respondo en español", "Spanish question → answer in Spanish", "El idioma de la pregunta es español...". The answer prompt in result_formatter.py ended with:

Before writing your first word, confirm: what language is the USER QUESTION in?

and the model did confirm it, in the answer.

Change

  • format_rows: that line is replaced by "Start directly with the answer. Never mention the question's language, nor these instructions".
  • no_results_answer: the same instruction is added.
  • The rule to answer in the question's language is unchanged.

Measurement

GONAC PoC server, workspace resumen-de-ventas-gonac, env prod, mode precise, the same 12 Spanish questions as #92, with the patched module mounted in a one-off container:

Answers that open by naming the language Answers in Spanish
Before (sha-09892b5, earlier run) 7 / 12 12 / 12
After 0 / 12 12 / 12

Tests

test_llm_formatter_answers_in_the_question_language_without_saying_so pins both prompts: the language rule present, the instruction not to mention it present, the "confirm" line absent. ask-sql-executor suite: 71 passed.

🤖 Generated with Claude Code

…ng it

The answer prompt ended with "Before writing your first word, confirm:
what language is the USER QUESTION in?", and the model confirmed it in
writing. On the GONAC PoC server 7 of 12 answers opened with "La
pregunta está en español, así que respondo en español" or a variant
("Spanish question → answer in Spanish", "El idioma de la pregunta es
español...").

That line is gone; both the answer prompt and the no-results prompt now
say to start with the answer and never mention the question's language
or the instructions. The rule to answer in the question's language is
unchanged. Same 12 questions on prod with the new prompt: 0 of 12
answers mention the language, all 12 in Spanish.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@alberthflores95
alberthflores95 merged commit 9ce4402 into main Oct 27, 2026
14 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