fix(tunnel): extract JSON log lines instead of double-wrapping#141
Conversation
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 33 minutes and 21 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
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 |
✅ Deploy Preview for devsydev canceled.
|
|
If you're new to commit signing, there are different ways to set it up: Sign commits with
|
When the inner agent logs JSON (Format: json), TunnelLogStreamer.logLine() was wrapping the entire JSON string as a message field, producing double-encoded output. Now logLine() detects JSON log lines, extracts the message and level fields, and logs them directly. Plain text lines continue to work as before.
7114826 to
3c99a69
Compare
Summary
When the inner agent logs JSON (
Format: json),TunnelLogStreamer.logLine()was wrapping the entire JSON string as a message field, producing double-encoded JSON output.extractLogLevel()also didn't handle JSON format.Now
logLine()detects JSON log lines by attemptingjson.Unmarshal, extracts themessage/msgandlevelfields, and logs the message text directly at the correct level — matching thejsonLinepattern used inpkg/log/jsonstream.go. Plain text log lines continue to work as before (backward compatible).Adds regression tests covering JSON passthrough, level normalization (
trace→debug,warning→warn,fatal→error), plain text fallback, empty/whitespace handling, and JSON-without-message edge case.