Repository navigation
Conversation
总: 设置 → AI 新增会话标题生成卡片,可配置提示词、模型、思考强度、理想长度与截断长度,默认值保持原有行为,标题生成新增 60 秒超时。 分: 抽取提示词增强与标题生成共用的模型行、编辑弹层、模型回退、超时与 Rust 模板校验,并同步 ADR 0322、D650 与相关规格。
Owner
|
您好,这个功能和提示词优化后续会转成插件,您那可以看看,目前宿主能力是否支持,如果有不足的可以提pr拓展能力 |
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
概述
在 设置 → AI 中新增「会话标题生成」卡片,位于「提示词增强」下方,让首轮会话标题的自动生成(ADR 0186)可以配置。全部保持默认时,发给模型的请求与改动前完全一致。
sessionTitleCustomPrompt、sessionTitlePromptsessionTitleProviderId、sessionTitleModelIdsessionTitleThinkingLeveloffsessionTitleIdealLengthsessionTitleMaxLength决策记录:ADR 0322、D650(修订 D359 / ADR 0186)。
行为说明
25换成可选变量{{idealLength}};按默认长度渲染后与原常量逐字节一致。""并关闭sessionTitleCustomPrompt。这样以后改进内置默认值时,没自定义过的用户也能用上。session/summarizeTitle的请求结构不变:off,并按实际启动的模型收敛。withOneShotTimeout),超时后保留首条提示词生成的回退标题。这是默认配置下唯一的行为变化。实现
packages/shared/src/session-title.ts,包含默认提示词、长度常量、解析与渲染函数。AppSettings新增 7 个字段。summarizeSessionTitle接收提示词和长度覆盖;SESSION_TITLE_SUMMARIZE_SYSTEM_PROMPT保留,作为默认渲染结果的别名。session/summarizeTitle按请求读取设置,加入固定模型回退和超时。新增one-shot-launch.ts(固定模型与回退);prompt-enhancement-timeout.ts抽出通用的withOneShotTimeout。rpc/one_shot_settings.rs,用同一个模板校验器统一校验提示词增强和会话标题两类一次性设置:长度越界返回INVALID_PARAMS,空白提示词被规范化。7 个键加入配置同步的可移植应用字段;sessionTitleProviderId按 provider 引用校验。SessionTitleCard。OneShotModelRows(模型与思考强度两行)和OneShotPromptEditorSheet(编辑弹层)。02-agent-runtime.md§4.1 和01-ipc-protocol.md。兼容性
验证
候选提交:
5341bd5cb基线:
origin/main@72b5e826cpnpm build:js(含文档站构建)pnpm -r --if-present typecheckpnpm lintcargo fmt --checkcargo clippy -p host-core --all-targets --lockedtranscripts.rs:1130)pnpm --filter @pi-desktop/shared testpnpm --filter @pi-desktop/agent-runtime testprompt-enhancement、session-auto-title、settings-general、provider-display-name、settings-search、config-syncnode --test test/*.test.mjs(desktop 全量)cargo test -p host-core --locked已有失败,与本次改动无关: