open-design/packages
Matt Van Horn 715ed04f5d
fix(prompt): instruct discovery form to follow user's chat language (#2534)
* fix(prompt): instruct discovery form to follow user's chat language

The discovery form was reaching users in English even when their UI
language was Chinese (#1416). The form is generated by the LLM under
guidance from packages/contracts/src/prompts/discovery.ts, but the
prompt only mentioned that option labels MAY follow the user's
language. The example form embedded English text for title,
description, per-question labels, and placeholders, and the LLM
copied that text verbatim instead of localizing.

Two minimal changes to the prompt:

1. Add a sentence under RULE 1 making the language-match expectation
   explicit before the example forms.
2. Expand the Form authoring rules bullet so it covers every
   user-facing string (title, description, label, placeholder, option
   label) and pins the unlocalized identifiers (id, type, option
   value, branch values) for the runtime branch logic.

Fixes #1416

* fix(prompts): mirror discovery localization rule to daemon prompt copy

Apply the same 'Match the user's chat language' paragraph and the
expanded 'Localize every user-facing string' bullet to
apps/daemon/src/prompts/discovery.ts, which the daemon-backed chat
path uses (it imports ./discovery.js, not the contracts copy).

Also add apps/daemon/tests/prompts/discovery-localization-drift.test.ts,
which reads both prompt copies and asserts each one contains both rules,
so the contracts and daemon files cannot silently drift on this behavior.

Apply-anyway reason: pnpm install / pnpm vitest could not run locally
(registry DNS blocked in sandbox + node v26 vs required v24). Direct
Node content assertion over both files passes. CI will run vitest.

---------

Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
2026-05-23 11:48:17 +08:00
..
agui-adapter chore: pin dependency versions and harden CI caches (#2189) 2026-05-19 13:58:27 +08:00
contracts fix(prompt): instruct discovery form to follow user's chat language (#2534) 2026-05-23 11:48:17 +08:00
diagnostics feat(diagnostics): add one-click log export from Settings → About (#798) 2026-05-20 09:10:51 +08:00
host fix(host): accept folder imports without entry files (#2701) 2026-05-22 17:21:22 +08:00
platform chore: pin dependency versions and harden CI caches (#2189) 2026-05-19 13:58:27 +08:00
plugin-runtime chore: pin dependency versions and harden CI caches (#2189) 2026-05-19 13:58:27 +08:00
registry-protocol chore: pin dependency versions and harden CI caches (#2189) 2026-05-19 13:58:27 +08:00
sidecar chore: pin dependency versions and harden CI caches (#2189) 2026-05-19 13:58:27 +08:00
sidecar-proto fix(tools-dev): preserve web origin trust on web start (#2715) 2026-05-23 00:25:43 +08:00
AGENTS.md refactor desktop host bridge (#2246) 2026-05-19 18:27:05 +08:00