Skip to content

V2: /init and /review are not wired into i18n, and the compaction template headings are English by construction #51016

Closed as not planned

Description

@xvcezrqpbxtpzblrt

Description

Re-filing this for OpenCode 2, as the closing comment invited ("if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version"). I am reusing this issue and asking for a reopen rather than opening a third thread on the same topic.

Part of the original report is fixed in V2; the rest is a narrower defect. Both halves below are stated so the fixed half is not re-reported as broken.

Fixed in V2

The V1 headings (Objective, Important Details, Work State, Completed, Active, Blocked, Next Move, Relevant Files) are gone from the front end. Scanning the shipped app.asar of 2.1.1 returns 0 matches for ## Work State and Next Move. The panel is now built from i18n keys in packages/session-ui/src/message/message-content.tsx (ui.messagePart.compaction, .started, .running, .failed, .usage), and zh.ts ships all of them.

The slash-command menu is also wired into i18n: /new, /undo, /redo, /compact, /fork, /export, /open, /mcp resolve through language.t(...) at packages/app/src/session/commands/use-session-commands.tsx:324-499, and /terminal through ctx.t("command.toggle") at packages/gui-extensions/src/terminal/renderer.tsx:46 with a full per-locale dictionary.

Still broken: /init and /review are not wired into i18n

packages/core/src/plugin/command.ts:

30:        name: "init",
31:        description: "guided AGENTS.md setup",
...
43:        name: "review",
44:        description: "review changes [commit|branch|pr], defaults to uncommitted",

Both are string literals with no t() lookup. This is a missing integration, not a missing translation: the keys command.init and command.review do not exist in en.ts either (packages/app/src/runtime/i18n/en.ts, packages/ui/src/i18n/en.ts). There is no key for any locale to supply, so these two entries render from the same literal everywhere. The migrated commands above each have an en.ts key and a zh.ts key, which is exactly what these two lack. Same shape as the prompt-coverage omission in #53274.

Still broken: compaction template headings are English by construction

The headings moved rather than disappeared. They are now the model-facing template in packages/core/src/session/compaction.ts:107-138:

107: const SUMMARY_TEMPLATE = `You MUST use this format for your response...
109: ## Objective
118: ## Work State
129: ## Next Move
132: ## Relevant Files

buildPrompt (compaction.ts:148) takes no locale parameter, and the summary is rendered as-is by PacedMarkdown (packages/session-ui/src/message/message-content.tsx:638), with no heading rewriting. So under a Chinese UI the summary body still reads ## Objective, ## Work State, ## Next Move, ## Relevant Files.

These headings are not cosmetic leftovers. compaction.ts:287-288 derives the expected heading list from the same template and uses it to validate the reply:

287:       const headings = SUMMARY_TEMPLATE.split("\n").filter((line) => line.startsWith("##"))
288:       const filled = (text: string) => text.split("\n").some((line) => headings.includes(line.trim()))

A localized heading would fail filled() and cost a retry, so this cannot be solved by translating UI strings alone; the template itself has to become locale-aware.

Steps to reproduce

  1. Set the desktop UI language to Chinese.
  2. Type / in the composer: /init shows guided AGENTS.md setup and /review shows review changes [commit|branch|pr], defaults to uncommitted, both in English. /compact next to them is localized.
  3. Trigger a context compaction: the summary body still contains ## Objective, ## Work State, ## Next Move, ## Relevant Files.

Expected: both follow the selected UI language. Actual: 2 stays English for /init and /review only; 3 stays English in every locale by construction.

OpenCode version

2.1.1 (desktop). Main verified at 0718864d49a5241e7df5b302b35caed2518171a0.

Operating System

Windows 11

Terminal

Not applicable (desktop app)

Plugins

None.


If a maintainer would rather these be tracked separately: the first is a two-key i18n migration in packages/core/src/plugin/command.ts, the second depends on whether buildPrompt is meant to be locale-aware. I kept them in one thread because #33084 was closed for splitting one topic across threads.

Activity

  1. changed the title [-]Desktop: compaction summary headings and slash-command entries not localized (Simplified Chinese still shows English)[/-] [+]Desktop: compaction summary and slash-command menu are hardcoded to English and not wired into i18n[/+] on Sep 24, 2026
  2. thdxr commented on Oct 11, 2026

    @thdxr
    Member

    Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.

    — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

  3. changed the title [-]Desktop: compaction summary and slash-command menu are hardcoded to English and not wired into i18n[/-] [+]V2: /init and /review are not wired into i18n, and the compaction template headings are English by construction[/+] on Oct 20, 2026
  4. xvcezrqpbxtpzblrt commented on Oct 20, 2026

    @xvcezrqpbxtpzblrt
    Author

    Updated the body above for V2. Two notes for whoever triages this:

    1. This issue is still closed and I cannot reopen it myself 鈥?not_planned was set by the v1 triage, and reopen requires a collaborator. The body has been rewritten so it describes only what is still reproducible on 2.1.1, with the already-fixed half explicitly marked as fixed. If the remaining two items are valid, could a maintainer reopen it so it is not sitting in the closed list?

    2. The re-verification changed what this issue is about, so the title was updated to match. The v1 report said the compaction headings and the slash-command menu were hardcoded UI strings. On 2.1.1 that is no longer true 鈥?the headings were removed from the front end (0 matches for ## Work State in the shipped app.asar) and every slash command except /init and /review now resolves through language.t(...). What survives is narrower: /init and /review have no i18n key in en.ts at all, and the headings live on as the model-facing SUMMARY_TEMPLATE, which compaction.ts:287-288 also uses to validate the reply.

    I would rather keep one thread here than open a new one; if you prefer a fresh issue for the /init + /review part, say so and I will move it.

  5. xvcezrqpbxtpzblrt commented on Oct 21, 2026

    @xvcezrqpbxtpzblrt
    Author

    Re-filing here is not possible from my side (reopen needs a collaborator), so this is now tracked as a new issue: #57828 - #57828

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions