串接 host-native 轉檔與本機 E2E - #75
monkey1sai merged 1 commit into
Conversation
- 讓 B 方案 conversion request 不再要求退役 worker IDs - 修正 host-native artifact root、pwsh 選擇與 coordinator conversion API fallback - 修正 viewer auth/DataChannel 傳訊並補上本機 E2E evidence
📝 WalkthroughWalkthroughThis PR consolidates configuration precedence handling, makes conversion job identifiers optional, adds intelligent PowerShell executable selection, normalizes service storage paths, introduces runtime public IP resolution for WebRTC streaming, and updates viewer-side authentication and message passing. The verification document reflects updated build/test results and runtime evidence. ChangesHost-Native Conversion Service Enhancement
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
此 PR 針對「host-native 轉檔 + 本機 E2E」串接做整體修補:讓 B 方案 IFC-ready intake 能以 host-native conversion service(49101)完成轉檔並被 coordinator / viewer 消費,同時修正 viewer WebRTC 啟動與 DataChannel 訊息格式、以及 Kit streaming launcher 對 LAN IP(publicIp)的支援,並補齊本機驗證證據文件。
Changes:
- Web viewer:DataChannel 改送 object(非 JSON 字串)、未提供 accessToken 時不啟用 NVIDIA auth,並改善 stream started 後的 UI/等待狀態處理。
- bim-streaming-server:host-native conversion 的預設 service_root 路徑修正、PowerShell executable 選擇(prefers
pwsh)、B-scheme request 允許 retired worker IDs 欄位為 optional。 - bim-review-coordinator:忽略 retired
http://127.0.0.1:8003/localhost:8003conversion API default,改採 streaming conversion API base(49101)並補測試。
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| web-viewer-sample/src/Window.tsx | DataChannel 訊息改送 object;stream started 後 UI 狀態/timeout 清理與 Kit ready polling 流程調整。 |
| web-viewer-sample/src/AppStream.tsx | 未提供 accessToken 時不啟用 authenticate,並在有 token 時才帶入 accessToken。 |
| docs/verification/2026-05-19-introduce-host-native-conversion-authority-service.md | 更新 TDD/build 與本機 E2E(LAN IP / WebRTC)證據與結果。 |
| bim-streaming-server/tests/test_host_native_conversion_service.py | 補強 host-native config 預設路徑與 PowerShell exe 選擇行為測試。 |
| bim-streaming-server/tests/test_conversion_authority_api.py | 新增 B 方案 request 不再要求 retired worker IDs 欄位的 regression test。 |
| bim-streaming-server/source/extensions/…/ifc2usdc_powershell_adapter.py | 預設 PowerShell 優先用 pwsh;env adapter 改用該預設並維持顯式覆蓋優先。 |
| bim-streaming-server/source/extensions/…/host_native_conversion_service.py | 修正 host-native service_root 預設落點(避免多一層 bim-streaming-server/)。 |
| bim-streaming-server/source/extensions/…/conversion_authority.py | export_job_id / source_rvt_artifact_id 改為 optional(None/空字串允許)。 |
| bim-streaming-server/scripts/start-streaming-server.ps1 | 新增 -PublicIp auto 自動解析 LAN IPv4,並注入 Kit livestream primaryStream publicIp 設定。 |
| bim-review-coordinator/tests/config.test.ts | 新增 conversion API base 的 retired 8003 fallback/precedence 測試。 |
| bim-review-coordinator/src/config.ts | 統一 conversionApiBase 決策:優先 STREAMING_CONVERSION_API_BASE,忽略 retired 8003 預設。 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@web-viewer-sample/src/Window.tsx`:
- Line 297: Revert the change that passes the object directly to
AppStream.sendMessage by serializing the payload: update the call to
AppStream.sendMessage to pass JSON.stringify(message) instead of message so the
sendMessage API (AppStream.sendMessage) receives a string as required by the
WebRTC/data-channel contract; locate the invocation where
AppStream.sendMessage(message) is used and wrap the message with
JSON.stringify(message).
🪄 Autofix (Beta)
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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 477e2112-d558-4aaa-b176-b5fdcce31d23
📒 Files selected for processing (11)
bim-review-coordinator/src/config.tsbim-review-coordinator/tests/config.test.tsbim-streaming-server/scripts/start-streaming-server.ps1bim-streaming-server/source/extensions/ezplus.bim_review_stream.messaging/ezplus/bim_review_stream/messaging/conversion_authority.pybim-streaming-server/source/extensions/ezplus.bim_review_stream.messaging/ezplus/bim_review_stream/messaging/host_native_conversion_service.pybim-streaming-server/source/extensions/ezplus.bim_review_stream.messaging/ezplus/bim_review_stream/messaging/ifc2usdc_powershell_adapter.pybim-streaming-server/tests/test_conversion_authority_api.pybim-streaming-server/tests/test_host_native_conversion_service.pydocs/verification/2026-05-19-introduce-host-native-conversion-authority-service.mdweb-viewer-sample/src/AppStream.tsxweb-viewer-sample/src/Window.tsx
| return; | ||
| } | ||
| AppStream.sendMessage(JSON.stringify(message)); | ||
| AppStream.sendMessage(message); |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
@nvidia/omniverse-webrtc-streaming-library sendMessage API format
💡 Result:
The sendMessage API in the @nvidia/omniverse-webrtc-streaming-library is used to send custom messages from a web client to a streaming Omniverse Kit application [1][2][3]. Format Requirements: The sendMessage method expects a string argument [3]. To ensure compatibility with the Kit application—specifically when using extensions like omni.kit.livestream.messaging—it is standard practice to pass a JSON-serialized string [3][4]. Implementation Example: To send a message, define your message object, convert it to a JSON string, and pass it to the AppStreamer.sendMessage method [3][4]: // Define the message object const message = { event_type: "your_event_type", payload: { key: "value" } }; // Send the JSON-stringified message AppStreamer.sendMessage(JSON.stringify(message)); Key Considerations: 1. Data Channel: Messages are transmitted over the WebRTC data channel established by the AppStreamer [4]. 2. Handling Incoming Messages: To receive messages on the client side, you must register a handler (typically named onCustomEvent) within the stream configuration passed to AppStreamer.setup [5][3]. 3. Kit-Side Integration: On the Omniverse Kit application side, these messages are typically processed by extensions such as omni.kit.livestream.messaging, which expects structured JSON data [6][3][4]. Ensure your message structure aligns with the expectations of the specific Kit extension you are communicating with [3].
Citations:
- 1: https://docs.omniverse.nvidia.com/services/latest/services/web-streaming-library/overview.html.md
- 2: https://docs.omniverse.nvidia.com/ov-web-sdk/latest/web-streaming-library/overview.html
- 3: https://github.com/NVIDIA-Omniverse/web-viewer-sample
- 4: https://docs.omniverse.nvidia.com/kit/docs/kit-app-template/latest/docs/streaming.html
- 5: https://docs.omniverse.nvidia.com/ovas/latest/developer/web-development/connect_stream.html
- 6: https://docs.omniverse.nvidia.com/kit/docs/omni.kit.livestream.webrtc/latest/Overview.html
Revert the sendMessage argument back to JSON.stringify(message).
Line 297 changes from AppStream.sendMessage(JSON.stringify(message)) to AppStream.sendMessage(message). The sendMessage API expects a string argument, and all NVIDIA documentation and examples explicitly require passing a JSON-serialized string. Passing the object directly breaks the messaging contract and will fail at the library level when the WebRTC data channel attempts to transmit the message.
🤖 Prompt for 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.
In `@web-viewer-sample/src/Window.tsx` at line 297, Revert the change that passes
the object directly to AppStream.sendMessage by serializing the payload: update
the call to AppStream.sendMessage to pass JSON.stringify(message) instead of
message so the sendMessage API (AppStream.sendMessage) receives a string as
required by the WebRTC/data-channel contract; locate the invocation where
AppStream.sendMessage(message) is used and wrap the message with
JSON.stringify(message).
摘要
驗證
python -m pytest tests/test_conversion_authority_api.py tests/test_host_native_conversion_service.py -q:22 passed。npm test(bim-review-coordinator):147 passed。npm run build(bim-review-coordinator):passed。npm run build(web-viewer-sample):passed,僅 Vite large chunk warning。openspec validate introduce-host-native-conversion-authority-service --strict:passed。git diff --check:passed,僅 Windows LF/CRLF 提示。storage/許良宇圖書館建築_2026.ifc完成 external IFC-ready intake -> host-native IFC to USDC -> coordinator review session -> web viewer WebRTC 觀看;Playwright evidence 已記錄於docs/verification/2026-05-19-introduce-host-native-conversion-authority-service.md。已知風險 / 注意
mapped_count=0、coverage_ratio=0.0。127.0.0.1signaling/media 會讓 StreamSDK media candidate 失敗。detect-changes已在 commit 前執行,但 linked worktree 下仍回No changes detected,所以本 PR 以 git diff、測試、build 與 E2E evidence 補足 scope 驗證。.env或任何 secret 檔;secret scan 只命中 token/accessToken 欄位名稱與既有 dev placeholder。Summary by CodeRabbit
New Features
Improvements
Documentation