-
Notifications
You must be signed in to change notification settings - Fork 3.1k
fix(web-shell): localize vision bridge notices #10003
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # Web Shell Vision Bridge Notice Localization | ||
|
|
||
| ## Problem | ||
|
|
||
| Vision Bridge status is emitted as an ordinary English assistant message. Web Shell receives no semantic data, so a Chinese locale cannot translate it. | ||
|
|
||
| ## Design | ||
|
|
||
| Keep the English text as an ACP fallback for clients that do not understand Qwen metadata. Add a discrete `vision_bridge_notice` source with structured status, counts, model display name, endpoint, and egress state. Web Shell projects that event as a standalone system message and formats it through its existing locale catalog. Invalid or missing metadata falls back to the original text. | ||
|
|
||
| Within a turn, the existing processed-step control hides the notice when collapsed and restores it when expanded. | ||
|
|
||
| Message rewriting passes these notices through without adding them to the rewritten assistant response. | ||
|
|
||
| Channel bridges continue forwarding the English fallback as ordinary response text. | ||
|
|
||
| This change is limited to prompt-level Vision Bridge notices. TUI, headless, external ACP clients, tool-result notices, and voice notices retain their current behavior. | ||
|
|
||
| ## Verification | ||
|
|
||
| - The cancelled prompt-level notice carries fallback text and structured metadata. | ||
| - The Web Shell keeps the notice separate from adjacent assistant output. | ||
| - Chinese renders localized text; malformed metadata renders the fallback. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Suggestion] The provider-prefix strip here (
result.modelId.replace(/^[^:]+:/, '')) duplicates core's privatedisplayVisionModelId(inpackages/core/src/services/visionBridge/vision-bridge-service.ts) — the byte-identical regex that produces the model name inside the English fallback text emitted in this very same update. The two derivations are kept in sync by convention alone; the new Session test ties them for exactly one prefixed shape. If core's display-name logic ever changes (the module already carries\0-suffixed selector variants of model ids), the English fallback and the structuredmodelNamemetadata silently diverge — the localized Web Shell notice would then name a different model than the daemon's English text for the same event, so the privacy-relevant egress disclosure ("your image was sent to X") disagrees between two renderings of one event. ExportdisplayVisionModelIdfrom the core vision-bridge service and call it here instead of re-inlining the regex:中文说明
这里的 provider 前缀剥离(
result.modelId.replace(/^[^:]+:/, ''))与 core 中私有的displayVisionModelId(位于packages/core/src/services/visionBridge/vision-bridge-service.ts)重复——该正则逐字节相同,用于生成同一条 update 中英文回退文本里的模型名。两处推导仅靠约定保持同步,新增的 Session 测试也只针对一种带前缀格式将二者绑定。一旦 core 的显示名逻辑变更(该模块已经存在带\0后缀的模型 id selector 变体),英文回退文本与结构化modelName元数据会悄悄分叉——本地化的 Web Shell 通知将与 daemon 英文文本就同一事件显示不同的模型名,即隐私相关的出站披露("你的图片已发送至 X")在同一事件的两种渲染中互相矛盾。建议从 core 的 vision-bridge service 导出displayVisionModelId,在此调用它,而不是重新内联这段正则:— qwen3.8-max via Qwen Code /review (v0.22.0)