Skip to content

Session recap (away summary) is always generated in English — no way to match the conversation language #11847

Description

@4ekuct25

Summary

The session recap — the one-sentence "where did I leave off" summary shown when a user
returns to an idle session (the recap: row in the TUI / away_recap history item,
POST /session/:id/recap in the daemon) — is generated by a side query whose system
prompt is hardcoded in English:

// packages/core/src/services/sessionRecap.ts
var RECAP_SYSTEM_PROMPT = `You generate session recaps for a programming assistant CLI.

The user stepped away and is coming back. Recap in under 40 words, 1-2 plain sentences,
no markdown. Lead with the overall goal and current task, then the one next action. ...

Output format — strict:
- Wrap your recap in <recap>...</recap> tags.
...
Example:
<recap>Debugging the auth retry race condition. Next: add deterministic timing to the integration test.</recap>`;

The recap is a standalone side query (runSideQuery, purpose session-recap, run against
the fast model) containing only the last 30 dialog messages plus this prompt. It carries
no session context, so the session system prompt (including any
permissions.autoMode.environment hint), QWEN.md/AGENTS.md, and output-language
preference cannot influence it. Because the prompt is English — with an English example
and a strict output-format block — the recap comes back in English even when the whole
conversation has been in another language (e.g. Russian).

The only settings that exist are general.showSessionRecap (on/off) and
general.sessionRecapAwayThresholdMinutes (idle threshold). There is no way to control
the recap language.

Reproduction

  1. Enable the recap (e.g. "general": { "showSessionRecap": true }).
  2. Hold a session with several messages written in Russian (or any non-English language).
  3. Step away until the away threshold passes, then return to the session.
  4. Result: the recap is rendered in English, regardless of the conversation language or
    any language-related setting.

Impact

Users whose working language is not English get the "where did I leave off" summary —
the text they rely on to re-orient after stepping away — in a different language from
the rest of the session. Same class of gap as the hardcoded explain-shell prompt
(#11791): the feature works, but only for English (and, unlike explain-shell, there is
not even a second locale).

Suggested fix

Preferred order:

  1. Derive the recap language from the recent user messages already included in the
    side-query window (the last 30 dialog messages are right there), e.g. append an
    instruction like "Write the recap in the same language the user is using."
  2. Honor general.outputLanguage (or an equivalent setting) when it is set.
  3. At minimum, add a dedicated setting (e.g. general.sessionRecapLanguage) with a
    free-form language value interpolated into the prompt.

A local string patch (appending "Write the recap in Russian." to RECAP_SYSTEM_PROMPT)
works and is verified locally, but it breaks on every rebuild — a config-level fix is
strongly preferred.

Environment

  • Standalone 0.23.3 (anchor present in lib/chunks/chunk-BZM5U74J.js)
  • Qwen Code Desktop 0.3.0 (bundled qwen-code 0.23.2; anchor present in the runtime
    lib/chunks/chunk-ML7BJBOD.js), macOS (Apple M4 Pro)
  • Feature location: packages/core/src/services/sessionRecap.ts — RECAP_SYSTEM_PROMPT
  • Feature flags: general.showSessionRecap, general.sessionRecapAwayThresholdMinutes

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions