Repository navigation
Chat: honor Enter and IME in original Agent replies - #7301
Conversation
Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
loopx-agent
left a comment
There was a problem hiding this comment.
Reviewer: model_agent; gpt-6.1-sol; OpenAI; runtime_reported; reasoning_effort=max (latest host-recorded execution; active_turn_verified=true).
Approval conclusion (author-owned PR; GitHub blocks formal self-approval)
动机
从工作台进入原 Agent 会话并追加回复的用户,需要与普通聊天一致的发送、换行和输入法行为。 普通聊天中 Enter 会发送,但原 Agent 会话的同类输入框按 Enter 只换行,必须再找发送按钮;现在 Enter 进入原有投递路径,Shift+Enter 换行,输入法确认仍只提交候选词。 打包原会话页面已验证一次 Enter 仅产生一次原宿主输入;忙碌或回执未明时不投递并保留草稿,来源和快捷键说明通过小图标按需读取。 本次交付原会话回复的键盘一致性和说明入口,不增加原宿主排队、调整本轮、权限或自动重发能力。 真实 macOS 输入法和已安装版本的投递效果仍未验证;完整研究工作台、长工具记录阅读及双端消息交付继续沿原任务推进。
改动思路
现有 composerKeyAction 已定义发送、换行和输入法保护,原会话只缺少调用;复用它并保留各自宿主的准入和回执所有者,比复制快捷键规则或接入另一套队列更小。 本 PR 只把键盘意图接到既有原会话投递处理,并用共享帮助呈现可选说明;原绑定、宿主执行权和持久回执不变。 前端只解释键盘意图,真正能否接收由原宿主决定。这里没有借普通 Chat 的排队能力假装原会话也能排队:忙碌时的 Command+Enter 给出明确拒绝,草稿仍在。发送前继续先保存恢复记录,再调用原有投递;增加一个同步的组件内标记,避免同一浏览器任务的两个键事件在重新渲染前各创建一次操作。来源事实、原会话是否可回复、失败与回执继续直接可见,完整定义放在共享图标帮助中。
下表仅解释此head的实际分支,执行证据见后文:
| 输入 | 原会话以前 | 此head |
|---|---|---|
| 空闲时 Enter | 换行,需要再点发送 | 进入原有投递,一次输入 |
| Shift+Enter / 输入法确认 | 本地文本操作 | 保持本地换行或候选词确认 |
| 空闲时 Command+Enter | 没有专用快捷键 | 与显式发送相同 |
| 忙碌或状态未知时快捷键 | 不能经按钮投递 | 明确拒绝、保留草稿,不增加调整本轮或队列能力 |
具体改动
规范基准为 docs/development/design.md,版本 af68b0ff180ca8309b5d63d7ee326c77848521bb;任务路径同时遵循既有 docs/development/frontend-delivery.md。shared-composer-intent 已实现:实际原会话输入框复用已有键盘语义,组合输入、重复键与换行均有否定路径。explanations-on-demand 已实现:来源与快捷键使用语义不同的小图标,完整说明能悬浮、聚焦或点击读取。populated-page-review 已实现:检查默认、完整中英文帮助、长消息与工具混合记录、忙碌恢复的桌面和390px视图。task-first-recovery 已实现:原绑定输入、拒绝、回执及原消息回读经既有所有者验证。没有修改规范或后端规则来迁就实现。
关键代码讲解
apps/presentation/dashboard/src/features/personal-workspace/attached-agent-conversations.tsx:86的AttachedConversation仍由原 Goal→Agent 页面按确切会话绑定挂载。useId让输入框与可访问标签明确对应,帮助按钮放在标签外。来源文案完整从原生 title 移到共享帮助,来源事实和回复条件留在页面。键盘事件经过既有意图函数,再检查原会话是否空闲、可回复及恢复状态;输入框仍只有一个。apps/presentation/dashboard/src/features/personal-workspace/attached-agent-conversations.tsx:349的send是按钮和快捷键共同的效果入口。同步标记在写入待确认恢复记录前置位,阻止同一任务里的第二次进入;保存失败时立即释放并保持零POST,最终分支也释放。原来的操作标识、确切绑定、服务端明确未投递证明以及只读回执恢复保持。未知投递不会因重读或刷新重放。apps/presentation/dashboard/src/features/personal-workspace/composer-keyboard.ts:2的composerKeyAction实现未改动。组件组合状态、事件组合状态、WebKit229、重复键或Shift都会返回无发送意图;Command只返回已有局部意图,不能授予原宿主执行权。普通Chat在apps/presentation/dashboard/src/features/personal-workspace/personal-workspace-page.tsx:3073的原调用不变,它的排队/调整本轮准入继续由自身提供方管理。examples/personal-workspace-browser/codex-attached.mjs:30的runConversation扩展原有集成场景,而非另建只测模拟按钮的页面。编译Chat经真实原会话HTTP所有者连接可丢弃的原宿主协议peer,核对输入计数、三种IME保护、同任务重复事件、存储失败、忙碌竞争、未知回执与完整帮助。原有多会话选择、迟到结果、分页历史、重绑定及原始记录覆盖仍完整运行。十张公开安全的合成截图直接嵌入PR描述。
对主干的风险
最严重的风险是中文候选词确认被当成发送、同一任务重复创建原生操作,或快捷键绕过忙碌与未确认回执。既有共享函数的单元测试之前已经通过,却不能证明另一处实际输入框接入了它;旧的按钮路径测试也不会发现这个缺口。最终将不可变主干的两个产品文件放入完全相同的冻结场景,Enter始终等不到原宿主接纳,退出1;恢复此head后完整场景55.568秒通过,三个测试/peer来源指纹未变,产品文件回到确切提交。
原会话所有者64项测试通过,普通Chat的managed/attached准入场景及共享键盘测试通过。IME否定事件、Shift换行、同任务重复、恢复存储拒绝、忙碌和未知回执均通过实际编译页面到原HTTP所有者检查;实际宿主效果由合成peer承接。构建、JS语法、31份CSS检查通过。标准premerge的4项直接检查与8项选择检查执行通过,确切范围CQR有效;原始结果仍因十张PNG而是manual_review_required,已逐张查看像素和元数据,不把它改写成自动全绿。三个变更文本路径公开边界干净;全局registry另有两条无关既有权威错误,保留为诊断。当前策略不查询或等待CI。无格式迁移,回滚本提交可恢复旧键盘行为。
我的整体评价
结论为 justified_increment:这一实际输入入口有完整的发送、拒绝和恢复证据,可独立交付;更大的工作台体验仍在既有任务中。long_horizon 为 preserved,不声称已测得token或长程效率收益;user_experience 在本次键盘和帮助范围为 improved。默认桌面和390px页面仍以原对话及一个底部输入框为主,只有来源和键盘两个小图标;展开中英文完整帮助保持正文字号,忙碌拒绝与草稿继续可见。 合成原宿主协议覆盖编译页面与真实HTTP所有者,不等同真实账号发送、macOS输入法或安装后投递验收;长记录沿用现有阅读结构,本次不宣告整个研究页面已重设计。 本次复用既有意图词汇,新增状态只在组件内存在,不构造第二个权限、队列或持久回执所有者。
English verdict: APPROVE at 03c638e4e00928abf29341f710fc35c9a7d1768e. The actual original-Agent reply field now reuses existing Enter/IME intent and native admission, with exactly-once local entry and unchanged receipt-only recovery. Frozen base/head, complete packaged original-owner integration, main Chat parity,64native tests and declared local checks support this bounded slice. Real macOS IME, live-account effects and post-install adoption remain separately unverified.
Goal And Delivered Outcome
Original Agent conversations had a separate reply textarea that never called the shared keyboard-intent owner. Enter inserted a line while ordinary Chat sent the message. Route this existing entry through
composerKeyAction: Enter sends, Shift+Enter adds a line, IME confirmation stays local, and idle Command+Enter also sends.The original binding, native admission and receipt route still decide every effect. Busy replies and unsupported active steering retain the draft with visible feedback. Source/update and shortcut definitions use shared accessible glyph help.
main.af68b0ff180ca8309b5d63d7ee326c77848521bb, then passes on03c638e4e00928abf29341f710fc35c9a7d1768e. Two keydowns in one browser task produce one native input.Author Declaration
docs/development/design.mdataf68b0ff180ca8309b5d63d7ee326c77848521bb, especially explanations on demand and populated page review; companiondocs/development/frontend-delivery.mdand the existingcomposer-keyboard.tsintent contract.AttachedConversationreusescomposerKeyAction; packaged Enter/Command+Enter positive cases and IME/newline negativesContextHelp; pointer-to-panel continuity, focus/Escape, tap, Chinese/English and 390px capturesSelf-check: read the design/delivery/smoke contracts and inspected all changed source plus ten synthetic captures. The small reuse pass shares the existing intent/help owners and keeps the duplicate-submit latch local to this component. No new protocol field, backend, persistent setting or queue/steering authority is introduced.
Scope And Continuation
Complete within this original-reply entry and its packaged regression. Broader workbench refinement and actual native IME/dual-end qualification continue under existing owners. This is independently reversible without changing original conversations or their execution rules.
Validation
03c638e4e00928abf29341f710fc35c9a7d1768e.attached-host-follow-up: 55.568s; original reply keyboard, composition guards, duplicate keydowns, recovery-storage refusal, busy and unknown receipts, two Sessions, long tool/history paging and languagecomposer-session-admissionpreserves ordinary managed/attached Chat behavior (2.980s)cqr_743d7a797e2f14e7b7e6Premerge retains ten binary-image manual-review holds; the captures below supply their inspection evidence. Scoped public-text scanning is clean. Separate full registry diagnostics retain two pre-existing unrelated authority-state errors; no authority state is changed. CI is not queried under the current local-validation review contract.
The installed App was inspected read-only as the baseline; it had one original reply field and no shortcut help. No real message, model analysis, permission/configuration change or Session reset was performed. Post-change installed behavior is not claimed here. Disposable browser servers stop after the run, so there is no persistent preview URL.
Frontend / Visual Evidence
af68b0ff180ca8309b5d63d7ee326c77848521bb. After:03c638e4e00928abf29341f710fc35c9a7d1768e, production packaged assets with the isolated native owner above.Type / Area / Boundary