Skip to content

Side queries ignore the user's configured output language (recap, title, tool-use summary, suggestions) #4494

@pomelo-nwu

Description

@pomelo-nwu

What happened?

When the user has configured an output language preference (via output-language.md), several side queries that generate user-facing text do not respect it. For example, if the user's output language is set to Chinese, these outputs still come back in English.

Affected features:

  • /recap command and auto-triggered away-summary (sessionRecap.ts)
  • /rename --auto session title generation (sessionTitle.ts)
  • Tool-use summary labels shown in the UI (toolUseSummary.ts)
  • Followup prompt suggestions (suggestionGenerator.ts)

What did you expect to happen?

All side queries that produce user-visible text should respect the user's configured output language preference, just like the main agent conversation does.

Root cause

These side queries call runSideQuery() with their own systemInstruction that replaces the main agent's system prompt. The main agent receives the user's output-language.md content via outputLanguageFilePath in the system context, but side queries bypass this entirely.

Some prompts (recap, title) contain a soft hint:

Match the dominant language of the conversation (English or Chinese).

This is unreliable — models often default to English, especially when the conversation history contains code (which is predominantly English).

Other prompts (tool-use summary, followup suggestion) have no language guidance at all.

Reproduction steps

  1. Configure output language to Chinese (create output-language.md with a Chinese preference)
  2. Have a conversation with some code discussion
  3. Run /recap → recap is in English
  4. Run /rename --auto → title is in English
  5. Complete a tool-use batch → summary label is in English
  6. Wait for a followup suggestion → suggestion is in English

Suggested fix

Pass the user's language preference into side queries. Options:

  • Read output-language.md content and append it to the systemInstruction in runSideQuery
  • Or expose a config.getOutputLanguage() method and inject a language directive into side query prompts
  • Or add a language-aware wrapper around runSideQuery that automatically appends the preference

This would also benefit any future side queries that generate user-facing text.


中文

发生了什么?

用户配置了输出语言偏好(通过 output-language.md)后,多个生成用户可见文本的 side query 都不会遵守该设置。例如,用户的输出语言设为中文时,这些输出仍然为英文。

受影响的功能:

  • /recap 命令和自动触发的 away-summary(sessionRecap.ts
  • /rename --auto session title 生成(sessionTitle.ts
  • UI 中显示的工具使用摘要标签(toolUseSummary.ts
  • Followup 提示建议(suggestionGenerator.ts

预期行为

所有生成用户可见文本的 side query 应该遵守用户配置的输出语言偏好,就像主 agent 对话一样。

根因分析

这些 side query 调用 runSideQuery() 时传入了自己的 systemInstruction,这会替换掉主 agent 的 system prompt。主 agent 通过 outputLanguageFilePath 在 system context 中接收用户的 output-language.md 内容,但 side query 完全绕过了这个机制。

部分 prompt(recap、title)中有一句软提示:

Match the dominant language of the conversation (English or Chinese).

这并不可靠——模型经常默认输出英文,尤其当对话历史包含代码时(代码以英文为主)。

其他 prompt(工具使用摘要、followup 建议)则完全没有语言引导。

复现步骤

  1. 配置输出语言为中文(创建 output-language.md,设置中文偏好)
  2. 进行一段包含代码讨论的对话
  3. 执行 /recap → recap 是英文的
  4. 执行 /rename --auto → title 是英文的
  5. 完成一组工具调用 → 摘要标签是英文的
  6. 等待 followup 建议 → 建议是英文的

建议修复方向

将用户的语言偏好传递给 side query。可选方案:

  • 读取 output-language.md 内容,追加到 runSideQuerysystemInstruction
  • 或在 config 上暴露 getOutputLanguage() 方法,在 side query prompt 中注入语言指令
  • 或为 runSideQuery 增加语言感知的包装层,自动追加偏好

这对未来所有生成用户可见文本的 side query 都有价值。

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions