Repository navigation
fix: cancel error explanations when closed - #324
Conversation
|
|
|
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.
Hey - I've found 1 issue
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="src/lib/examples/explain.ts" line_range="8-9" />
<code_context>
-export async function* explain(traceback: string, code: string) {
- const { AsyncChatGenerate } = await initPromplate();
+export async function* explain(traceback: string, code: string, signal: AbortSignal) {
+ if (signal.aborted)
+ return;
+ const { parse_chat_markup } = await initPromplate();
</code_context>
<issue_to_address>
**Existing explanation callers fail**
When an existing consumer invokes the exported function with its former two-argument call, the generator reads `signal.aborted` before doing any work, so a caller that still passes only `traceback` and `code` gets a TypeError instead of an explanation.
Make `signal` optional and create a non-aborted default signal for callers that do not provide one.
</issue_to_address>Sourcery assessment
Approval pending. 1 finding to address first.
Blocking findings: src/lib/examples/explain.ts:9
|
No actionable comments were generated in the recent review.
|
Abort error explanation startup and streaming when the dialog unmounts. Reuse the OpenAI client factory configured by the Python runtime, and pass its request an
AbortSignal; prompt rendering stays unchanged. Ignore cancellation and report other failures.Verified real-component cleanup before/after. A local slow SSE fixture with real Pyodide and OpenAI SDK confirms no request after cancellation during startup and a disconnected HTTP stream after the first token. Build and lint pass; remaining type errors are covered by #317.
Closes #323.