[Fix] Websocket and Log Viewer - #107
Conversation
Also, the websocket closure was postponed for when inactive and now yields to the event loop every 200 records intead of whole batch
|
Tick the box to add this pull request to the merge queue (same as
|
|
/gemini review |
|
@coderabbitai review full |
|
✅ Action performedFull review finished. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughThe websocket now marks completed runs, drains trailing messages, and yields during large log batches. The logging subsystem propagates the created run ID to the HTTP server and connected viewers through SSE. The viewer creates backend download links and limits queued and retained logs. The HTTP server removes its log-download endpoint and file-path handling. Tests cover completion state, handler calls, and log-record forwarding. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
Comment |
This is not related to the issue being fixed.
bf49694
into
project-chip:v2.15.1-cli-develop
Fix: project-chip/certification-tool#1072
Depends on Backends: project-chip/certification-tool-backend#347
Description
Companion fix to the backend PR for #1072. Two independent problems remained on the CLI side even after the backend stopped stalling and truncating logs:
--log-streaming) would freeze during large runs: it received log lines faster than it could render them, so its internal queue grew into a multi-minute backlog. The view looked "stuck," even though the connection was healthy — it was just always showing stale content instead of what was happening right now. Since this viewer is the only place users can see SDK trace output live (used to decide how to answer test prompts), a stale view is effectively as broken as no view.Changes
is still sending isn't dropped.
ever-growing backlog that only "catches up" long after the test has already finished. This does not affect the saved log file or the full downloadable log, only what's shown live. (An earlier version of this fix hid raw SDK trace content from
the live view entirely to solve the freeze — that broke the actual reason the live viewer exists, since it's the only place to read trace context while answering a test prompt. This version keeps everything live and fixes the actual backlog
instead.)
log-download endpoint (the same one the web UI's download has always used successfully). This is the standard fix for this kind of problem — never serve a "download" from a transient process; point at wherever the artifact durably lives.
Verified
Watched the live viewer through two full
TC-ACE-2.4runs: content stays current throughout (brief freezes), and the CLI's saved log matches the backend's copy.