Receiver通知をSSE化してストリーミング発話を高速化 - #593
Merged
Merged
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughReceiver通信をSSE通知中心へ変更しました。切断時のポーリングと指数バックオフ再接続を追加しました。 ChangesReceiver SSE通知と発話セッション連携
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant messageReceiver
participant receiverEventStream
participant eventsApi as /api/v1/events
participant messageGateway
messageReceiver->>receiverEventStream: ReceiverごとのSSE購読
receiverEventStream->>eventsApi: 認証付きSSE接続
messageGateway-->>eventsApi: messagesまたはcommandsイベント
eventsApi-->>receiverEventStream: SSEイベント送信
receiverEventStream-->>messageReceiver: 起床通知
messageReceiver->>messageGateway: メッセージまたはコマンド取得
Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/features/api/messageGateway.ts`:
- Line 337: 同一 speechSessionId の高優先度チャンクが unshift
により逆順になるため、メッセージ挿入処理を更新してください。後続チャンクは同一セッションの既存チャンク群の直後に挿入して FIFO
順を維持し、異なるセッション間の高優先度処理は変更しないでください。高優先度チャンクを同一セッションへ連続投入した際に投入順で取得できる回帰テストを追加してください。
In `@src/features/api/receiverEventStream.ts`:
- Around line 107-109: Update the reconnect handling around the
connection-success logic in the SSE receiver so reconnectDelayMs is not reset
immediately after HTTP success; reset it only after the connection has remained
established for the intended stability period. Preserve onConnectionChange
behavior, and add a regression test covering immediately closing 200 responses
that verifies delays increase from 250ms to 500ms to 1 second.
In `@src/pages/send-message.tsx`:
- Around line 142-147: Update the speechSessionId parameter definition in the
send-message API schema to document the acceptance constraint as 1–200
characters after trimming whitespace. Use the existing type/description metadata
so the API console clearly indicates that whitespace-only and over-200-character
values are invalid.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 0bfd7ed0-cfad-46aa-9283-f7b6ada1823a
📒 Files selected for processing (12)
docs/external-presentation-api-spec.mddocs/receiver-registry-api-spec.mdsrc/__tests__/features/api/receiverEventStream.test.tssrc/__tests__/pages/api/v1/externalApi.test.tssrc/__tests__/pages/api/v1/externalApiValidation.test.tssrc/components/messageReceiver.tsxsrc/features/api/messageGateway.tssrc/features/api/receiverEventStream.tssrc/features/chat/speechPipeline/speakMessageHandler.tssrc/pages/api/v1/events.tssrc/pages/api/v1/speak.tssrc/pages/send-message.tsx
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
speechSessionIdを渡し、同一SpeakQueueセッションでFIFO処理します。Verification
npm exec eslint -- <変更対象>npm test -- --runInBand src/__tests__/features/api/receiverEventStream.test.ts src/__tests__/pages/api/v1/externalApi.test.ts src/__tests__/pages/api/v1/externalApiValidation.test.ts(54件通過)NODE_OPTIONS="--localstorage-file=<temporary-file>" npm test -- --runInBand(202 suites、2226件通過、7件skip)npm run buildstop_requestedからcommands_fetchedまで28msであることを実測Notes
--localstorage-file未指定時、既存のimages.test.tsがNode組み込みlocalStorageの保存先不足で14件失敗します。保存先を明示すると全suiteが通過します。EventSourceはAuthorizationヘッダーを指定できないため、Receiver側はfetchのReadableStreamでSSEを購読します。Summary by CodeRabbit
新機能
/api/v1/speakで発話セッションIDを指定でき、分割された発話の順序を維持できます。改善
ドキュメント