fix(sidecar): let the stream sanitizer pass orchestrator route and circuit events - #1945
Conversation
…rcuit events Every provider_*/circuit_* line from the orchestrator was folded into omitted_unstructured_lines, so even the provider_exhausted WARNING that fires today never reached an artifact. Admit those templates field by field against bounded charsets, cut provider_attempt_failed before its free-text error_message, and accept both the default and the sidecar formatter log prefixes (keeping the timestamp for durations). Companion to #1943 and #1944. Refs #1935, #1939 Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Warning Review limit reachedNext included review available in 12 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (3)
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 |
|
Integration check (host 1): I formatted real Cause: the orchestrator's circuit counter is a float. Fix is one character class: |
…r output The orchestrator's circuit counters are floats (failures 0.0 += 1.0, circuit_reset_seconds 30.0), so the lines that reach stderr say failures=2.0 / reset_seconds=30.0; the integer-only pattern rejected both circuit_failure and circuit_opened. Found by rendering the templates through the sidecar's logging.Formatter, which the new test now does for all ten. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Fixed in |
# Conflicts: # CHANGELOG.md
|
Merged as Verified by the merging session's own run, not relayed. Because Authorization, cited at the act from the standing directive: "60-job ceiling에 막혀 있을 거라 일을 하기 어렵다면 60-job ceiling을 만드는 workflow issues를 추적해서 해소하세요. 이 상황은 Chicken-and-eggs 상황이므로 Bypass merge가 허용됩니다." This PR is the tracing half of that grant — it makes the ≈548 s-per-candidate slot burn behind today's noema/strix failures readable as a per-route timeline in the run artifact — and it structurally cannot validate itself (its own required run executes |
|
Precision on the negative-control sentence above: between the verified head |
…integration Conflict: tests/test_noema_orchestrator_workflow_contract.py -- both sides appended a test at end of file (this branch: the cancel-superseded-noema-runs job rationale pin; main: #1944's sidecar-evidence upload step contract). Kept both. noema-review.yml auto-merged. Gate after merge: 2941 passed, coverage 100%, interrogate 100%. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Verified in production: the first three post- |
… size contract) Signature 3: the first post-#1939 noema-review runs split 1/1; the failing run's policy report shows the diversified pool #1939 promised and still ends in a 502 after a ~548 s-per-route walk (host 1's arithmetic from source), so a base-merge push recovers pre-#1939 heads but does not shorten the post-#1939 walk; #1943/#1944/#1945 make the per-route timeline readable from the noema-sidecar-evidence artifact; the remaining lever is inside contextual-orchestrator. Signature 12: required-workflow-bootstrap exit 2 in ~5 s on "exceeds the size contract" -- the Contents API's 1 MiB inline ceiling on a patchless text file, fixed by #1946's Git Blobs API route. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BV96rXhqoR3tYZ9AeAVur4
Binds the current review workflows (#1943/#1944/#1945: sidecar trace and noema-sidecar-evidence artifact on failure) to this head's required runs. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BV96rXhqoR3tYZ9AeAVur4
Binds the sidecar pin bump to contextual-orchestrator@414f2297 (contextual-orchestrator#1081's retry-stacking fix, .github efb8926) and the #1943/#1944/#1945 workflows to this head's required runs; the previous head's Noema/Strix runs failed on the stalled-route loop that fix removes. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BV96rXhqoR3tYZ9AeAVur4
Binds the sidecar pin bump to contextual-orchestrator@414f2297 (contextual-orchestrator#1081's retry-stacking fix, .github efb8926) and the #1943/#1944/#1945 workflows to this head's required runs; the previous head's Noema/Strix runs failed on the stalled-route loop that fix removes. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BV96rXhqoR3tYZ9AeAVur4
…letion Binds the sidecar pin bump to contextual-orchestrator@414f2297 (contextual-orchestrator#1081's retry-stacking fix, .github efb8926) and the #1943/#1944/#1945 workflows to this head's required runs; the previous head's Noema/Strix runs failed on the stalled-route loop that fix removes. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BV96rXhqoR3tYZ9AeAVur4
…ence CHANGELOG.md: both new top entries kept, main's pin-bump entry first. Binds the sidecar pin bump to contextual-orchestrator@414f2297 (contextual-orchestrator#1081's retry-stacking fix, .github efb8926) and the #1943/#1944/#1945 workflows to this head's required runs; the previous head's Noema/Strix runs failed on the stalled-route loop that fix removes. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BV96rXhqoR3tYZ9AeAVur4
Third piece of the observability lane behind #1935 / #1939: #1943 turns on DEBUG logging in the sidecar process, #1944 ships the sanitized stderr when a Noema verdict fails, and this PR makes the sanitizer let the orchestrator's route and circuit events through. Any order works: without this PR the artifact only grows
omitted_unstructured_lines; without #1943 only the WARNING-level lines (provider_exhaustedand its two siblings, which already fire today) appear.What changes
scripts/ci/sanitize_contextual_orchestrator_sidecar_stream.py_LOG_PREFIX: strips either Python's defaultLEVEL:name:prefix or the fix(sidecar): record the orchestrator's per-attempt trace in the review sidecar's stderr #1943 formatter'sasctime LEVEL nameprefix; the timestamp (digits and punctuation only) is kept in front of the summary so per-route durations can be read as differences between lines._ORCHESTRATOR_EVENTS: ten anchored patterns copied fromcontextual_orchestrator/orchestrator.pyat the vendored pin2e414d15(:1337provider_attempt,:1351provider_attempt_failed,:1365provider_backoff,:1389provider_exhausted,:1458provider_rejected_permanent,:1397provider_no_retry_budget,:7988/:8003/:8010/:8021circuit_reset|failure|opened|cleared). Every field is matched against a bounded charset (agent_id[a-z][a-z0-9_]*,model[A-Za-z0-9_./:-]+, error types[A-Za-z_][A-Za-z0-9_.]*, numbers\d+(\.\d+)?);provider_attempt_failedis cut before its free-texterror_message=and re-emitted witherror_message=<omitted>._sanitize_orchestrator_event()+ one hook insanitize_line()after the existing structured patterns and before the fixed prefixes. Nothing else in the allowlist changes.tests/test_contextual_orchestrator_review_runtime_preflight.py:test_sidecar_stream_sanitizer_admits_orchestrator_route_events— all ten templates, both prefixes, timestamp retention, theerror_messagecut with a planted secret asserted absent, and four rejections (uppercase agent id, trailing free text after a complete template, a failed-attempt line without theerror_messageboundary, a known prefix with an unknown message).CHANGELOG.mdentry.Why
Every one of these lines was being folded into
omitted_unstructured_lines. That includesprovider_exhausted, which is a WARNING and therefore already in today's stderr: a route that burns its full retry budget (≈ 548 s at the current pin: orchestrator retry × client retry × 90 s per-recv timeout) leaves no trace in any artifact. Run33981136873walked six ready routes for 3122 s and ended in HTTP 502; the only diagnosis was the caller's one-line summary. With #1943 + #1944 + this, the failed-run artifact reads as a per-route timeline.Not claimed
route_attempt … outcome= duration_ms=event stays a later CO improvement.Verification
Full gate on
aae077acwithGITHUB_ACTIONS=true: 2897 passed / 1 skipped,coverage report --fail-under=100→ 100% (the sanitizer itself: 67 statements, 32 branches, 0 missed),interrogate→ 100%; the preflight/sanitizer suite (62 tests) passes; negative control: withmain's sanitizer swapped in the new test fails (1 failed), restored it passes.🤖 Generated with Claude Code