makecindy / makecindy/cindy

停止运行后切换模型再 rewind 报 "会话未激活 NO_LIVE_QUERY",agent 无法激活

Open
#2,250 1 comment 0 reactions 0 assignees View on GitHub
bug pi
Dominant language
TypeScript
Stars
2.7k
Forks
401
Avg merge
21h 48m
Merged PRs (30d)
776

Description

### 问题描述 / What happened

## 实际行为 / Actual behavior

在会话运行中点「停止」(abort),随后切换到另一个模型并尝试 rewind(回退)时,持续报错:

```
[ERROR] Error occurred in handler for 'maker:rewind:preview': Error: [NO_LIVE_QUERY] 会话未激活——请先发送任意一条消息(即使是 "ok"),让 SDK 起来后再 rewind
[ERROR] Error occurred in handler for 'maker:rewind:commit': Error: [NO_LIVE_QUERY] 会话未激活——请先发送任意一条消息(即使是 "ok"),让 SDK 起来后再 rewind
```

具体表现:
1. abort 后 rewind preview/commit 连续失败 10+ 次(间隔几百 ms,说明 UI 在反复重试,不是单次失败)。
2. 从旧会话 fork 出的新 SDK session 已创建(jsonl 里只有 `session_info` + `thinking_level_change`),但用户消息从未送达——没有任何 `message` 记录,会话一直处于「未激活」状态。
3. 期间反复退出/重启应用(3 次,均为干净退出 exitCode=0 before-quit)仍无法恢复;直到新建 session 成功发出第一条消息后才恢复。
4. 日志同时出现 `ignoring stale abort completion`(abortBoundaryGeneration=0, currentGeneration=0)。

## 期望行为 / Expected behavior

- abort 后切换模型再执行 rewind,应该能正常回退;或至少给出可恢复的引导(而不是让 UI 反复重试失败)。
- fork / 新建会话在切换模型后应能正常激活并发出用户消息。
- rewind 失败时不应以数百 ms 间隔无限重试。

### 环境 / Environment

- Cindy 版本 / version or commit: 0.1.38 (app), maker 0.145.0, pi 0.83.0
- 平台与版本 / platform & OS version: macOS 26.6.1 (arm64)
- 安装方式 / install method: DMG (Cindy.app)
- agent: pi
- 模型: deepseek-v4-flash → deepseek/deepseek-v4-flash(切换前后)

### 复现步骤 / Steps to reproduce

1. 在 pi 会话运行中点击「停止」(abort)——日志出现 `maker-input-coordinator ignoring stale abort completion`
2. 切换到另一个模型(如 deepseek-v4-flash → deepseek/deepseek-v4-flash)
3. 对会话执行 rewind(回退)→ 报 `[NO_LIVE_QUERY] 会话未激活——请先发送任意一条消息(即使是 "ok"),让 SDK 起来后再 rewind`
4. 从旧会话 fork 新会话再试 → SDK session 创建成功但消息发不出去(jsonl 无 message 记录),同样无法 rewind
5. 退出并重启应用重试 → 仍然失败;只有新建 session 并成功发出一条消息后才恢复

### 日志与截图 / Logs & screenshots

```
[2026-08-09T12:25:20.911+08:00] [INFO ] [maker-input-coordinator] ignoring stale abort completion { sessionId: 'a4e511cf-...', abortBoundaryGeneration: 0, currentGeneration: 0 }
[2026-08-09T12:26:08.645+08:00] [ERROR] [console] Error occurred in handler for 'maker:rewind:preview': Error: [NO_LIVE_QUERY] 会话未激活——请先发送任意一条消息(即使是 "ok"),让 SDK 起来后再 rewind
[2026-08-09T12:26:09.369+08:00] [ERROR] [console] Error occurred in handler for 'maker:rewind:commit': Error: [NO_LIVE_QUERY] 会话未激活——请先发送任意一条消息(即使是 "ok"),让 SDK 起来后再 rewind
(此后每几百 ms 重复,持续约 2 分钟,跨 3 次应用重启)

```

Contributor guide

Open the contributing guide

Research direction

Start by tracing the maker:rewind:preview and maker:rewind:commit handlers, then follow the abort completion path around the “ignoring stale abort completion” log. Reproduce the abort, model switch, fork, and rewind sequence, and verify that a forked session can deliver its first user message and that failed rewind attempts do not retry indefinitely.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
ai, desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.