Repository navigation
fix: resolve safe issues from automated triage - #856
Conversation
Greptile SummaryThis update improves provider routing, Copilot tool-schema compatibility, daemon connection diagnostics, Homebrew launcher argument forwarding, desktop panel resizing, and terminal focus rendering. One user-visible issue remains in OpenAI Responses streaming: after one reasoning item streams a live summary delta, a later independent reasoning item that only returns a completed summary is not shown in the transcript. The routing, socket-error mapping, desktop resizing, and Homebrew launcher paths were exercised successfully. Confidence Score: 4/5The release should not merge until OpenAI reasoning-summary replay is tracked per reasoning item so later summaries remain visible. The reproduced OpenAI stream failure can cause a user to miss reasoning content from a later independent item. Files Needing Attention: crates/jcode-provider-openai/src/stream.rs
What T-Rex did
|
|
Quality Guardrails exposed a pre-existing Clippy --- — Jcode agent (automated triage), on behalf of @1jehuang |
|
The rerun passes Clippy and reaches the oversized-file ratchet, which still fails. I reproduced that ratchet on an untouched detached --- — Jcode agent (automated triage), on behalf of @1jehuang |
OpenAI Responses streams the reasoning summary twice: live via response.reasoning_summary_text.delta, then again inside the reasoning item on response.output_item.done. We replayed the item.done summary as ThinkingStart/Delta/End, so the TUI rendered the full thinking block a second time. Track saw_thinking_delta per stream and skip the item.done summary replay when live deltas were already streamed. The OpenAIReasoning event (encrypted content for history/replay) is still emitted.
| } | ||
| "response.reasoning.delta" | "response.reasoning_summary_text.delta" => { | ||
| if let Some(delta) = event.delta { | ||
| *saw_thinking_delta = true; |
There was a problem hiding this comment.
Reasoning summaries are suppressed across independent items
saw_thinking_delta is maintained for the entire response stream rather than for a specific reasoning item. Once item r1 emits response.reasoning_summary_text.delta, a later item r2 that has no live delta but does provide a completed summary reaches handle_openai_output_item with the flag already set. The parser emits OpenAIReasoning for r2 but skips its ThinkingStart, ThinkingDelta, and ThinkingEnd events, so that item's reasoning is absent from the user-visible transcript. Track streamed-summary state by reasoning item ID and suppress completed-summary replay only for the item that already streamed it.
Artifacts
Reproducible Rust parser test for independent reasoning items
- This standalone Rust program invokes the exported OpenAI Responses parser with the baseline and two-item lifecycle sequences, ending with an exact StreamEvent assertion.
Single-item reasoning baseline passed
- The executed baseline command parses one live-delta reasoning item and shows actual StreamEvents equal expected StreamEvents with exit code 0, establishing the control behavior.
Multi-item reasoning summary suppression failure
- The executed multi-item command shows the second item's expected ThinkingStart, ThinkingDelta, and ThinkingEnd are absent and panics with exit code 101, confirming the defect.
Narrow existing OpenAI stream test attempt blocked by Cargo locks
- The attempted narrow package test command records that concurrent builds held Cargo's package and build locks before it was stopped; the independent reproduction supplied the executed parser coverage.
Ran code and verified through T-Rex
Prompt To Fix With AI
This is a comment left during a code review.
Path: crates/jcode-provider-openai/src/stream.rs
Line: 342
Comment:
**Reasoning summaries are suppressed across independent items**
`saw_thinking_delta` is maintained for the entire response stream rather than for a specific reasoning item. Once item `r1` emits `response.reasoning_summary_text.delta`, a later item `r2` that has no live delta but does provide a completed summary reaches `handle_openai_output_item` with the flag already set. The parser emits `OpenAIReasoning` for `r2` but skips its `ThinkingStart`, `ThinkingDelta`, and `ThinkingEnd` events, so that item's reasoning is absent from the user-visible transcript. Track streamed-summary state by reasoning item ID and suppress completed-summary replay only for the item that already streamed it.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
Summary
swarmis acceptedVerification
scripts/dev_cargo.sh build --profile selfdev -p jcode --bin jcode$@Fixes #855
Fixes #854
Fixes #852
Fixes #849
Fixes #847
--- — Jcode agent (automated triage), on behalf of @1jehuang