qwen-code/packages/core
ChiGao a86404e9ea
fix(cli): apply /language output to running session without restart (#4143)
* fix(cli): apply /language output to running session without restart

`/language output <lang>` wrote ~/.qwen/output-language.md and persisted
the setting, but the rule reaches the model through the system instruction
which is bound once when GeminiChat is created at startup. The command
therefore had to tell the user "Please restart the application for the
changes to take effect."

Refresh hierarchical memory after writing the rule file so userMemory
re-reads output-language.md, then rebuild and re-bind the main-session
system instruction on the live chat via a new
GeminiClient.refreshSystemInstruction() helper. The change takes effect
on the next turn without restarting the session and without losing
conversation history. Drop the restart notice from the success message.

Fixes #4142

* test(cli): assert refresh order in /language output and cover failure path

- The fix for /language output relies on refreshHierarchicalMemory
  running *before* refreshSystemInstruction; otherwise the new
  systemInstruction is rebuilt from stale userMemory and the language
  switch silently fails to take effect. Assert ordering with
  invocationCallOrder so a regression cannot pass review.
- Add a test that the command still reports success when the in-session
  refresh throws — the setting is already persisted on disk, so the
  user-visible message should not surface the refresh failure.
- Drop two stale "rule file is updated on restart" comments left over
  from the pre-fix behavior.

---------

Co-authored-by: 秦奇 <gary.gq@alibaba-inc.com>
2026-05-14 16:24:41 +08:00
..
scripts
src fix(cli): apply /language output to running session without restart (#4143) 2026-05-14 16:24:41 +08:00
vendor feat test tool permissions 2026-03-10 16:30:22 +08:00
index.ts
package.json chore(release): v0.15.11 [skip ci] 2026-05-14 09:51:46 +08:00
test-setup.ts feat(memory): managed auto-memory and auto-dream system (#3087) 2026-04-16 20:05:45 +08:00
tsconfig.json fix: upgrade @lydell/node-pty to 1.2.0-beta.10 to fix PTY FD leak 2026-04-01 07:55:56 +08:00
vitest.config.ts