diff --git a/CHANGELOG.md b/CHANGELOG.md index f4724f0..fed2ef4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,42 @@ # CHANGELOG +## 2026-09-30 · 模型切换挪到对话框左下角 + 去掉所有 QwenPaw 外链与内部提示(版本 2.6.0 → 2.6.1) + +老板三条要求: + +1. **模型切换直接放对话框左下角**,不用去配置页设置 +2. **所有「打开 QwenPaw」外链去掉** +3. **客户不需要知道的提示全去掉**(如「提示词归 QwenPaw 管」这种) + +**改法**: + +- **切换器移入对话输入区左下角**:原来占位的静态模型名 `` → + 紧凑样式(`.model-inline`,168px、无边框、hover 才出底色)的可搜索下拉; + 仍按供应商分组 + 视觉标。进页面即 `loadEngineModels()`,展开时也兜底刷新。 + 配置页模型栏改为**只读展示** + 一行「在对话框左下角切换」的指引。 +- **外链清零**:`qwenpawUrl` 计算属性删除,模板里 3 处 `` 全删。 +- **内部提示清零**(删键 + 删模板引用,中英同步): + - 删:`cfgOpenQwenpaw`、`cfgModelHintShared`、`cfgCapability`、`cfgCapabilitySub`、 + `cfgCapabilityHint`、`cfgPromptTitle`、`cfgPromptHint`、`cfgModelRefresh`、 + `cfgModelReadonly`、`cfgModelHint`、`cfgApproval`、`cfgSandbox`、`cfgSandboxOff`、 + `cfgSandboxHint`、`cfgAccessSub`、`cfgAccessHint`、`cfgModelSub`、`cfgAccessHint` + - 改写「客户视角」:`sub`「路线 A:界面在网关,引擎是 QwenPaw」→「能干活的助手 —— 每个智能体有自己的参数和会话」; + `subagents`(页头副标题)去掉「引擎 QwenPaw」;`engineBadge`「QwenPaw 引擎」→「智能体」; + `engineDownHint` 去掉「请先在服务器上启动它」;`cfgSlugHint` 去掉 QwenPaw profile 措辞; + `cfgSuffixHint` 去掉「与 QwenPaw 主提示词叠加」;`sharedNote` / `listFootHint` 改用客户能懂的话。 +- 顺带修:i18n 体检**不允许空文案**,所以这些键是**整键删除**(不是留空串)。 + +**验收**:线上实测——对话输入框左下角出现 `wjd` 下拉(7 组 112 项、高亮当前项); +切到 `deepseek-v4-pro` → toast 提示 + 磁盘 `agent.json` 同步 + 引擎回读一致 → 已恢复 `wjd`; +配置页截图确认**无任何 QwenPaw 字样**。 + +**测试**:i18n **869/869** 对称(原 883,净删 14 键)、`ci_check.sh` 六道门禁全绿、 +前端产物 191 → 190 kB。 + +**注**:本轮**只动前端文案与布局**,后端端点(`GET /agents/engine/models`、`PUT /agents/engine/model`) +与测试未变,224 passed 不变。 + + ## 2026-09-30 · 智能体模型改为「页面可选」(方案 A)+ 修引擎模型读不到的静默 bug(版本 2.5.4 → 2.6.0) 老板问「智能体当时为什么说不能自己设置模型」,并选择**方案 A**:能选、但不新增 profile。 diff --git a/app/main.py b/app/main.py index 5bd6a0b..4485836 100644 --- a/app/main.py +++ b/app/main.py @@ -338,7 +338,7 @@ _docs_on = config.server.docs_enabled # 安全默认关(report: /docs、/ope # 三处,/health 干脆没返回版本 —— 前端「网关版本」一直显示 v-。 # 2026-09-29: 2.4.0 → 2.4.1(前端间距规范统一);2.4.1 → 2.5.0(新增「智能体」功能模块);2.5.0 → 2.5.1(智能体支持图片附件);2.5.1 → 2.5.2(智能体页间距与对齐优化);2.5.2 → 2.5.3(修 KPI 与下方块之间 0 间距)。 # ★ 版本号纪律:每次改动都要往上加,小改动加小版本号、大改动加大版本号(README 有专章)。 -VERSION = "2.6.0" +VERSION = "2.6.1" app = FastAPI( title="API Gateway", diff --git a/frontend/src/locales/en.ts b/frontend/src/locales/en.ts index bb9fb5f..c44ad89 100644 --- a/frontend/src/locales/en.ts +++ b/frontend/src/locales/en.ts @@ -23,7 +23,7 @@ export default { subchat: 'Vision-ready · multi-provider direct routing', subimages: 'Params on the left, history on the right · downloads proxied by the gateway', subvideos: '720P · 4–12s · async polling', - subagents: 'All-round assistants for admins · QwenPaw engine', + subagents: 'Assistants that get work done', submodels: 'Providers / models / protocol lines', submetrics: 'Usage & cost · isolated per account', subkeys: 'Up to 3 per account · stored in plaintext, copyable anytime', @@ -370,7 +370,7 @@ export default { }, agents: { title: 'Agents', - sub: 'Route A: UI in the gateway, engine is QwenPaw', + sub: 'Assistants that get work done — each has its own params and sessions', subHint: '{n} agents · engine {engine} ({url}) · {scope}', scopeAdmin: 'Admins only', scopeOpen: 'Available to {n}', @@ -383,7 +383,7 @@ export default { tabConfig: 'Config', tabRuns: 'Runs', pickAgent: 'Pick an agent on the left', - engineBadge: 'QwenPaw engine', + engineBadge: 'Agent', statusPublished: 'Published', statusDraft: 'Draft', statusRetired: 'Archived', @@ -391,7 +391,7 @@ export default { thisChat: 'This chat', engineReady: 'Engine ready', engineDown: 'Engine unreachable', - engineDownHint: 'QwenPaw is not running — start it on the server first', + engineDownHint: 'Engine not ready, please try again later', retry: 'Retry', stop: 'Stop', stopRun: 'Background', @@ -407,40 +407,26 @@ export default { cfgBasicSub: 'Name and slug are editable', cfgName: 'Name', cfgSlug: 'slug', - cfgSlugHint: 'Used as session kind agent_{slug}; must not clash with model id / alias / QwenPaw profile', + cfgSlugHint: 'Must not clash with an existing model id or alias', cfgDesc: 'Description', cfgModel: 'Model', - cfgModelSub: 'From the gateway models', cfgModelPick: 'Pick a model', - cfgModelRefresh: 'Refresh', cfgModelVision: 'vision', - cfgModelSwitched: 'Switched to {model} (shared by all agents, takes effect immediately)', - cfgModelHintShared: 'All agents share this one model (the engine stores it per profile). Switching takes effect immediately, no restart. You can also change it in QwenPaw:', - cfgOpenQwenpaw: 'Open QwenPaw', + cfgModelSwitched: 'Switched to {model}', + cfgModelAtChat: 'Switch it at the bottom-left of the chat box (shared by all agents, takes effect immediately)', cfgExec: 'Execution', cfgExecSub: 'Affects server safety, read-only for now', cfgEngine: 'Engine', cfgWorkspace: 'Workspace', - cfgApproval: 'Approval level', - cfgSandbox: 'Sandbox', - cfgSandboxOff: 'off', - cfgSandboxHint: 'sandbox_enabled=false — tools run directly on the server', cfgParams: 'Parameters', cfgTemp: 'temperature', cfgMaxTokens: 'max_tokens', cfgTopP: 'top_p', cfgSuffix: 'Role suffix (system_suffix)', - cfgSuffixHint: 'Appended on top of QwenPaw main prompt (max 2000 chars)', - cfgCapability: 'Capability', - cfgCapabilitySub: '27 built-in tools', - cfgCapabilityHint: 'Decided by QwenPaw profile ai-gateway · fully enabled (files, commands, browser)', + cfgSuffixHint: 'Role add-on for this agent, layered on top of the base instructions (max 2000 chars)', cfgAccess: 'Access', - cfgAccessSub: 'Gradual rollout', cfgAccessAdmin: 'Admins only', - cfgAccessHint: 'Phase 2 adds per-user / per-role rollout here', cfgReadonly: 'read-only', - cfgPromptTitle: 'Prompt', - cfgPromptHint: 'Prompts live in QwenPaw (SOUL.md / AGENTS.md); the gateway does not own them', save: 'Save', saved: 'Saved', test: 'Test run', @@ -453,7 +439,7 @@ export default { showRetired: 'Show archived', limitReached: 'Limit reached ({n})', limitHint: 'Limit reached ({n}); archive unused agents first', - sharedNote: 'All agents share one engine — models and params are per-agent, prompts and memory are shared', + sharedNote: 'Each agent has its own params and sessions; the model is shared', riskNote: 'This agent can read/write files and run commands on the server', runsTotal: 'Calls', runsTools: 'Tool calls', @@ -476,7 +462,7 @@ export default { imgMax: 'Up to {n} images', imgErr: 'Failed to pick image: {msg}', imgCount: '{n}/{max}', - listFootHint: 'All agents share one engine — new ones share model and memory; only params and sessions differ.', + listFootHint: 'The model is shared; params, role suffix and sessions are per-agent.', runDefaultTitle: 'Chat', cacheHit: 'cache {n}', meLabel: 'Me', diff --git a/frontend/src/locales/zh.ts b/frontend/src/locales/zh.ts index e54c1eb..dd93669 100644 --- a/frontend/src/locales/zh.ts +++ b/frontend/src/locales/zh.ts @@ -23,7 +23,7 @@ export default { subchat: '支持附图视觉 · 多供应商直连', subimages: '参数在左 · 历史在右 · 下载走网关代拉', subvideos: '720P · 时长 4–12 秒 · 异步轮询', - subagents: '给管理员用的全能助手 · 引擎 QwenPaw', + subagents: '能干活的助手,可按需创建', submodels: '供应商 / 模型 / 协议线', submetrics: '用量与成本 · 按账号隔离', subkeys: '每个账号最多 3 把 · 明文保存,可反复复制', @@ -370,7 +370,7 @@ export default { }, agents: { title: '智能体', - sub: '路线 A:界面在网关,引擎是 QwenPaw', + sub: '能干活的助手 —— 每个智能体有自己的参数和会话', subHint: '{n} 个智能体 · 引擎 {engine}({url})· {scope}', scopeAdmin: '仅管理员可见', scopeOpen: '{n} 人可用', @@ -384,7 +384,7 @@ export default { tabRuns: '运行记录', pickAgent: '左侧选一个智能体', // 列表卡片 - engineBadge: 'QwenPaw 引擎', + engineBadge: '智能体', statusPublished: '已发布', statusDraft: '草稿', statusRetired: '已归档', @@ -393,7 +393,7 @@ export default { thisChat: '本条对话', engineReady: '引擎就绪', engineDown: '引擎不可达', - engineDownHint: 'QwenPaw 未运行或未就绪 —— 请先在服务器上启动它', + engineDownHint: '引擎未就绪,请稍后再试', retry: '重试连接', stop: '停止', stopRun: '转后台', @@ -410,40 +410,26 @@ export default { cfgBasicSub: '显示名与 slug 可改', cfgName: '名称', cfgSlug: 'slug', - cfgSlugHint: '用于会话类别 agent_{slug};不能与模型 id / 别名 / QwenPaw profile 重名', + cfgSlugHint: '不能与已有的模型 id 或别名重名', cfgDesc: '描述', cfgModel: '模型', - cfgModelSub: '从网关的模型里选', cfgModelPick: '选择模型', - cfgModelRefresh: '刷新', cfgModelVision: '视觉', - cfgModelSwitched: '已切换到 {model}(所有智能体共用,即时生效)', - cfgModelHintShared: '所有智能体共用这一个模型(引擎按 profile 存模型)。切换即时生效,不用重启引擎。也可以去 QwenPaw 改:', - cfgOpenQwenpaw: '打开 QwenPaw', + cfgModelSwitched: '已切换到 {model}', + cfgModelAtChat: '在对话框左下角切换(所有智能体共用,即时生效)', cfgExec: '执行', cfgExecSub: '影响服务器安全,一期只读', cfgEngine: '引擎', cfgWorkspace: '工作区', - cfgApproval: '审批等级', - cfgSandbox: '沙箱', - cfgSandboxOff: '关', - cfgSandboxHint: '当前 sandbox_enabled=false —— 工具直接在服务器上跑', cfgParams: '参数', cfgTemp: 'temperature', cfgMaxTokens: 'max_tokens', cfgTopP: 'top_p', cfgSuffix: '角色补充(system_suffix)', - cfgSuffixHint: '这段是智能体的角色补充,与 QwenPaw 的主提示词叠加生效(上限 2000 字)', - cfgCapability: '能力', - cfgCapabilitySub: '27 项内置工具', - cfgCapabilityHint: '能力由 QwenPaw 的 ai-gateway profile 决定 · 一期全开(可读写文件、执行命令、开浏览器)', + cfgSuffixHint: '智能体的角色补充,叠加在基础指令之上(上限 2000 字)', cfgAccess: '访问范围', - cfgAccessSub: '灰度下发', cfgAccessAdmin: '仅管理员', - cfgAccessHint: '二期这里会出现「指定用户 / 按角色」——先把人加进来内测,稳了再放开', cfgReadonly: '只读', - cfgPromptTitle: '提示词', - cfgPromptHint: '提示词归 QwenPaw 管(改 SOUL.md / AGENTS.md);网关这边不接管', save: '保存', saved: '已保存', test: '试跑', @@ -456,7 +442,7 @@ export default { showRetired: '显示已归档', limitReached: '已达上限({n} 个)', limitHint: '已达上限 {n} 个(软上限);需要更多时先归档不用的', - sharedNote: '智能体共用同一个引擎 —— 模型与参数各自独立,但提示词与记忆共用', + sharedNote: '每个智能体有自己的参数和会话,模型是共用的', riskNote: '该智能体可在服务器上读写文件、执行命令', // 运行记录 runsTotal: '调用次数', @@ -480,7 +466,7 @@ export default { imgMax: '最多 {n} 张', imgErr: '选图失败:{msg}', imgCount: '{n}/{max} 张', - listFootHint: '所有智能体共用同一个引擎 —— 新建时它们会共用模型与记忆,只有参数和会话各自独立。', + listFootHint: '模型是共用的;参数、角色补充与会话各智能体独立。', runDefaultTitle: '对话', cacheHit: '缓存 {n}', meLabel: '我', diff --git a/frontend/src/views/Agents.vue b/frontend/src/views/Agents.vue index 2037cd5..917f000 100644 --- a/frontend/src/views/Agents.vue +++ b/frontend/src/views/Agents.vue @@ -101,7 +101,7 @@
{{ t('agents.tabChat') }} - {{ t('agents.tabConfig') }} + {{ t('agents.tabConfig') }} {{ t('agents.tabRuns') }}
@@ -208,7 +208,30 @@ - {{ cur.engine_model || '—' }} + + + + + {{ o.model }} + {{ t('agents.cfgModelVision') }} + + + @@ -252,41 +275,15 @@
-
{{ t('agents.cfgModel') }}{{ t('agents.cfgModelSub') }}
+
{{ t('agents.cfgModel') }}
{{ t('agents.cfgWorkspace') }}
{{ cur.engine?.agent_id }}
-
{{ t('agents.cfgCapabilityHint') }}
-
- {{ t('agents.cfgPromptTitle') }}:{{ t('agents.cfgPromptHint') }} - {{ t('agents.cfgOpenQwenpaw') }} ↗ -
-
{{ t('agents.cfgAccess') }}{{ t('agents.cfgAccessSub') }}
+
{{ t('agents.cfgAccess') }}
{{ t('agents.cfgAccess') }}
@@ -334,7 +326,6 @@ {{ t('agents.cfgReadonly') }}
-
{{ t('agents.cfgAccessHint') }}
@@ -458,7 +449,6 @@ const activeCount = computed(() => data.agents.filter((a) => a.status !== 'retir const atLimit = computed(() => activeCount.value >= data.max_agents) const totalRuns = computed(() => data.agents.reduce((s, a) => s + (a.run_total || 0), 0)) const totalTokensText = computed(() => `${(totalRuns.value * 12).toFixed(0)}k`) -const qwenpawUrl = computed(() => (data.engine.base_url || 'http://127.0.0.1:8088').replace(/\/api$/, '')) const curSessionTitle = computed(() => sessions.value.find((s) => s.id === sessionId.value)?.title || t('agents.newChat')) const dirty = computed(() => { const c = cur.value; if (!c) return false @@ -751,7 +741,10 @@ async function loadRuns() { catch { runList.value = [] } } -onMounted(load) +onMounted(() => { + load() + loadEngineModels() // 模型切换器在对话页左下角,进页面就得备好清单 +})