Repository navigation
fix: 新建原生任务的首条长粘贴不再报「内容已丢失」 - #164
Conversation
新建任务的编辑器一直把长粘贴存进 Kimi 的粘贴库(pastes-kimi-<host>), 而原生 Agent(Codex/Claude 等)的发送路径用 native 库展开 (pastes-native-<host>),令牌解析不到,首次发送必报丢失。会话已建、 界面切到会话编辑器后重粘,写读才同库,所以"删了重粘就好"。 编辑器按所选 provider 取对应连接自己的粘贴库,写读同库。
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 73f79d5285
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| referenceBrowser.open(path) | ||
| showReference = true | ||
| }, pastes: kimi.pastes, minimumEditorHeight: 96, referencesBelowEditor: true, files: projectFiles) | ||
| }, pastes: provider == .kimi ? kimi.pastes : native.pastes, minimumEditorHeight: 96, referencesBelowEditor: true, files: projectFiles) |
There was a problem hiding this comment.
Preserve folded pastes when switching providers
If a user selects a native agent, pastes long text, and then switches to Kimi before sending, the existing @paste token remains in prompt while this expression changes the backing store from native.pastes to kimi.pastes. KimiConnection.sendPrompt expands only its own store, so it rejects the first message as missing content even though the paste still exists in the native store. Rehome existing folded content when the provider changes, or retain the originating store for each token.
Useful? React with 👍 / 👎.
问题
新建任务 + 长粘贴(折成
@paste("id")令牌)首次发送必报「粘贴内容已丢失」;删掉重粘就好了。机制:新建任务的编辑器把长粘贴存进 Kimi 的粘贴库(
pastes-kimi-<host>,NewTaskView.swift:187写死了kimi.pastes),而选中原生 Agent(Codex/Claude 等)时发送路径用 native 库(pastes-native-<host>)展开令牌——写读不同库,解析不到。首次发送失败后会话已创建、界面切到会话编辑器(用的是 native 库),所以重粘就好。Kimi 路径写读同库,不受影响。修复
编辑器按所选 provider 取对应连接的粘贴库(
provider == .kimi ? kimi.pastes : native.pastes)。验证
Release 构建通过。发送链路无注入接缝,未加单测;复现路径:新建任务 → 选 Codex/Claude → 粘贴长文本 → 发送。