Repository navigation
feat(agent): Codex 式插话 — Enter 插话、Tab 排队、托盘持久化、不并发第二个 Run - #229
Merged
Merged
Conversation
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.
What and why / 改了什么、为什么
Codex 式插话:Run 在跑时不再并发开第二个 Run,而是让用户「插一句」或「排到后面」。外观沿用 OfferU 现有胶囊 / 玻璃 Token,紫色 = Agent。
POST /api/agent/runtime/runs/:id/steer把这句话交给正在跑的 Run,下一步之前送到模型(后端已有,服务端同时把它存进对话);气泡上方紫色小标「插话」。返回not_running或请求失败时,消息从对话里撤下、放回队首,不丢。AgentQueueTray;这一轮结束、且不在等用户(Ask / 可恢复)、没报错时,依次自动发出。每条可「插话 / 发送」「拉回输入框改」「删除」。localStorage offeru.agent.queue.v1,按对话分开,新对话第一次保存后跟过去;刷新后读回的条目标为未就绪(不自动发,要点发送),避免页面一打开就自己发消息。drainAgentCompose)在 Run 进行中来的请求一律插话 / 排队;附件在 Run 进行中不发(提示等这一轮结束)。lib/agentSteerQueue.ts(纯函数:按键意图、入队 / 队首 / 移除 / 按对话筛选 / 下一条 / 重绑定 / 读写存储)、agentRuntimeApi.steer、docs/design/components.md。怎么测的 / Testing
backend-ts: 新增「运行中插话」契约测试(Run 卡在第一步时 steer →steered;第二步请求里有这句 user 消息;对话里顺序是 问 / 插话 / 答;结束后 steer →not_running);vitest✅、typecheck✅。frontend: 新增agentSteerQueue.test.ts(Enter/Tab 意图含输入法组合、Shift、无文字;入队上限、队首、按对话、重绑定、存储往返与坏数据)、AgentQueueTray.test.tsx(渲染、插话 / 发送 / 修改 / 删除回调、恢复条目与暂停提示);typecheck✅、vitest✅、design:audit✅ 0 new、build✅。风险 / Risk
怎么撤回 / How to revert
revert 这个 PR;无数据变更(队列只在浏览器 localStorage)。
Checklist