Punkcan Yang

Results comments of Punkcan Yang

Code review 确认了这四个根因的代码位置: - **RC1**: `ui.rs` — `apply_engine_error_to_app` 清除 `streaming_thinking_active_entry` 但未调用 `finalize_streaming_thinking_active_entry` - **RC2**: `ui.rs` — `ThinkingStarted` handler 无条件调用 `streaming_state.reset()`,丢弃前一个 block 的缓冲内容 - **RC3**: `ui.rs` — `ThinkingComplete` 和 `MessageComplete` 处理顺序不保证,`last_reasoning.take()`...

Code review 发现一个可能影响缓存命中率的因素: **`SessionSource` 和 `ThreadStatus` 在 `protocol` 和 `state` 两个 crate 重复定义**,`core` crate 中有大量手动映射代码(`to_protocol_thread`, `to_persisted_status`, `to_persisted_source` 等)。如果映射逻辑导致消息格式或顺序不一致,DeepSeek API 的 prefix cache 匹配会失效。 另外 `client/chat.rs` 中 `build_chat_messages_with_reasoning()` 每次请求都大量 clone 消息结构,如果消息构建过程中有任何格式差异(空行、字段顺序、时间戳精度),都会导致...

Thanks for the thoughtful review! Updated the branch with all the feedback addressed: - **fmt**: `cargo fmt` passes - **Stale protection**: `AtomicU64` turn token — background tasks discard results if...

Added config opt-in and tests: - **Config**: `prompt_suggestion = true` (top-level, default `false` — opt-in only). Accessor: `config.prompt_suggestion_enabled()` - **Provider-aware model**: uses `config.default_model()` which respects the active provider — no...

Code review 发现几个可能导致"一直卡在工作中"的根因: 1. **`ThinkingComplete` 和 `MessageComplete` 事件处理顺序不可控** (`ui.rs`) — 如果 `MessageComplete` 先于 `ThinkingComplete` 处理,`reasoning_content` 丢失,DeepSeek V4 返回 HTTP 400,流中断但 UI 无错误提示 2. **流中断后 `streaming_thinking_active_entry` 未 finalize** — thinking spinner...

Code review 发现几个可能相关的根因: 1. **ShellManager.cleanup() 标记了 `#[allow(dead_code)]` 从不执行** (`crates/tui/src/tools/shell.rs:1348`) — 后台 shell 进程和读取线程无限累积,长时间 session 后资源耗尽 2. **SQLite 每次操作都 `Connection::open()`** (`crates/state/src/lib.rs:158`) — 无连接池、无 WAL 模式,高频操作(消息追加、checkpoint 保存)下性能劣化 3. **后台 shell 读取线程在 Drop...

Code review 发现两个可能相关的根因: 1. **checkpoint JSON 解析错误静默返回 Null** (`crates/state/src/lib.rs:566,587`): ```rust let state = serde_json::from_str(&state_json).unwrap_or(Value::Null); ``` 如果 checkpoint 文件损坏,调用方收到 `Value::Null` 且无任何提示,可能触发无止境的重试写入。 2. **ShellManager.cleanup() 从未执行** (`shell.rs:1348`) — 后台进程快照无清理机制,累积在内存和磁盘上。 两者结合可能解释了 `.deepseek/snapshots` 目录异常膨胀到 1.2TB...

Code review 确认了一个额外的根因: **`Runtime::new` 静默丢弃 job 加载错误** (`crates/core/src/lib.rs:672`): ```rust let _ = jobs.load_from_store(&state); ``` 数据库损坏、schema 不匹配、I/O 失败等错误被完全静默 — 不报错、不警告、不 log。启动后 job 列表为空,用户无感知。 这和本 issue 描述的两个 bug 互补: - Bug 1...

Code review 确认了这个问题。`SseTransport::run_sse_loop` 中的 SSE parser 只匹配 `\n\n` 作为事件分隔符,不处理 `\r\n\r\n`(CRLF)。 issue 里已经贴了完整的 diff,3 处改动: 1. 同时匹配 `\n\n` 和 `\r\n\r\n` 2. 按实际分隔符长度推进 buffer 3. 行尾 trim `\r` 这个修复是向后兼容的 — 接受 LF...

It would be good to have a notification, we need a tool to indicate when the work reaches a certain stage. I'll take a look