Repository navigation
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a new utility file open-sse/utils/stream/claudeLifecycle.ts to manage and track the lifecycle of Claude empty responses in SSE streams. The review feedback identifies unused and invalid imports (convertOpenAIToResponsesToolCall and uuidv4) at the top of the file that will cause compilation or runtime errors and should be removed.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| import { convertOpenAIToResponsesToolCall } from "../handlers/responseTranslator.ts"; | ||
| import { v4 as uuidv4 } from "uuid"; | ||
|
|
||
| import { JsonRecord } from "./types.ts"; |
There was a problem hiding this comment.
The imports convertOpenAIToResponsesToolCall and uuidv4 are unused in this file. Additionally, convertOpenAIToResponsesToolCall is not exported by ../handlers/responseTranslator.ts, which will cause a compilation or runtime error. These unused and invalid imports should be removed.
| import { convertOpenAIToResponsesToolCall } from "../handlers/responseTranslator.ts"; | |
| import { v4 as uuidv4 } from "uuid"; | |
| import { JsonRecord } from "./types.ts"; | |
| import { JsonRecord } from "./types.ts"; |
…ecycle.ts Part of Issue diegosouzapw#3594 modularization. Extracted Claude-specific lifecycle handling from the monolithic stream.ts. Exports: - SYNTHETIC_CLAUDE_EMPTY_RESPONSE_TEXT, createClaudeEmptyResponseLifecycle - getClaudeEventType, isClaudeEventPayload, updateClaudeEmptyResponseLifecycle - shouldInjectClaudeEmptyResponseBeforeCurrentEvent, shouldInjectClaudeEmptyResponseOnFlush - shouldInjectClaudeMissingFinalizersOnFlush, buildSyntheticClaudeEmptyResponseEvents - restoreClaudePassthroughToolUseName
39c762f to
2a755ec
Compare
|
Thanks, @oyi77 🙏. These stream extractions are currently additive — the new modules under |
Part of modularization effort (Issue #3594).
Extracts Claude-specific lifecycle handling from the monolithic
open-sse/utils/stream.tsinto a dedicated module.Changes:
open-sse/utils/stream/claudeLifecycle.ts(179 lines)SYNTHETIC_CLAUDE_EMPTY_RESPONSE_TEXT,createClaudeEmptyResponseLifecycle,getClaudeEventType,isClaudeEventPayload,updateClaudeEmptyResponseLifecycle,shouldInjectClaudeEmptyResponseBeforeCurrentEvent,shouldInjectClaudeEmptyResponseOnFlush,shouldInjectClaudeMissingFinalizersOnFlush,buildSyntheticClaudeEmptyResponseEvents,restoreClaudePassthroughToolUseNameTesting: No behavior change. Existing stream tests pass.
Follow-up PRs will extract: types (#3917), utils (#3918), errors (#3919), textualToolCalls (#3920), sseFormatters (#3923), openaiChunks (#3924), responsesLifecycle, and streamCore.