-
Notifications
You must be signed in to change notification settings - Fork 66
feat(adapters/openclaw): surface nemoclaw onboarding OTel trace artifacts (#5193) #5198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
fa9dca1
e386948
e6304fe
be7f441
10548b9
202cb83
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1541,6 +1541,118 @@ def _model_router_live() -> dict: | |
| return result | ||
|
|
||
|
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The adapter surfaces NemoClaw onboarding OTel trace artifacts (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) through the detect() method, but this observability capability is not documented in the Runtime and Session Observability requirement. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The adapter surfaces NemoClaw onboarding OTel trace artifacts (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) through the detect() method, but this functionality is not documented in the Runtime and Session Observability blueprint. |
||
| def _nemoclaw_onboard_trace() -> dict: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The OpenClaw adapter now surfaces NemoClaw onboarding OTel trace metadata (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) through the detect() method, but this functionality is not documented in the Runtime and Session Observability requirement or its corresponding blueprint. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The OpenClaw adapter now surfaces NemoClaw onboarding OTel trace metadata (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) through the detect() method, but this functionality is not documented in the Runtime and Session Observability requirement. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The OpenClaw adapter now surfaces NemoClaw onboarding OTel trace metadata through the detect() method, but this functionality is not documented in the Runtime and Session Observability blueprint. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The OpenClaw adapter now surfaces NemoClaw onboarding OTel trace metadata (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) through the detect() method, but this functionality is not documented in the Runtime and Session Observability blueprint. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The OpenClaw adapter now surfaces NemoClaw onboarding OTel trace metadata (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) through the detect() method, but this functionality is not documented in the Runtime and Session Observability requirement. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The OpenClaw adapter now surfaces NemoClaw onboarding OTel trace metadata (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) through the detect() method, but this observability capability is not documented in the Runtime and Session Observability requirement. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The OpenClaw adapter now surfaces NemoClaw onboarding OTel trace metadata (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) through the detect() method, but this observability capability is not documented in the Runtime and Session Observability blueprint. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The OpenClaw adapter now surfaces NemoClaw onboarding OTel trace metadata (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) through the detect() method, but this observability capability is not documented in the Runtime and Session Observability requirement. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The OpenClaw adapter now surfaces NemoClaw onboarding OTel trace metadata (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) through the detect() method, but this functionality is not documented in the Runtime and Session Observability blueprint. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The OpenClaw adapter now surfaces NemoClaw onboarding OTel trace metadata (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) through the detect() method, but this new observability capability is not documented in the Runtime and Session Observability requirement. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The OpenClaw adapter now surfaces NemoClaw onboarding OTel trace metadata (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) through the detect() method, but this functionality is not documented in the Runtime and Session Observability blueprint. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The OpenClaw adapter now surfaces NemoClaw onboarding OTel trace metadata (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) through the detect() method, but this capability is not documented in the Runtime and Session Observability requirement. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The OpenClaw adapter now surfaces NemoClaw onboarding OTel trace metadata (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) through the detect() method, but this functionality is not documented in the Runtime and Session Observability blueprint. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The OpenClaw adapter now surfaces NemoClaw onboarding OTel trace artifacts (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) through the detect() method's metadata, but this functionality is not documented in the Runtime and Session Observability requirement. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The OpenClaw adapter now surfaces NemoClaw onboarding OTel trace artifacts (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) through the detect() method's metadata, but this functionality is not documented in the Runtime and Session Observability blueprint. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The OpenClaw adapter surfaces NemoClaw onboarding OTel trace artifacts (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) through the detect() method's metadata, but this observability capability is not documented in the Runtime and Session Observability requirement. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The OpenClaw adapter surfaces NemoClaw onboarding OTel trace artifacts (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) through the detect() method, but this functionality is not documented in the Runtime and Session Observability blueprint. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The OpenClaw adapter now surfaces NemoClaw onboarding OTel trace metadata (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) through the detect() method's metadata, but this new observability capability is not documented in the Runtime and Session Observability requirement. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The OpenClaw adapter now surfaces NemoClaw onboarding OTel trace metadata (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) through the detect() method, but this functionality is not documented in the Runtime and Session Observability blueprint. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The OpenClaw adapter now surfaces NemoClaw onboarding OTel trace metadata (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) through the detect() method, but this observability capability is not documented in the Runtime and Session Observability requirement. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The OpenClaw adapter now surfaces NemoClaw onboarding OTel trace metadata through the detect() method, but this functionality and the specific implementation details are not documented in the Runtime and Session Observability blueprint. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The OpenClaw adapter now surfaces NemoClaw onboarding OTel trace metadata (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) through the detect() method's meta field, but this observability capability is not documented in the Runtime and Session Observability requirement. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The OpenClaw adapter now surfaces NemoClaw onboarding OTel trace metadata (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) through the detect() method, but this functionality is not documented in the Runtime and Session Observability blueprint. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The new _nemoclaw_onboard_trace() helper function implements multi-format OTel trace processing (both flat harness and resource_spans shapes) with path resolution via NEMOCLAW_TRACE_FILE, NEMOCLAW_TRACE_DIR, and .e2e/traces/trace.json fallback, extracting worst-case span status and error phase names, but these implementation details are not documented in the Runtime and Session Observability blueprint. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The OpenClaw adapter now surfaces NemoClaw onboarding OTel trace metadata (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) through the detect() method's meta field, but this observability capability is not documented in the Runtime and Session Observability requirement. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The OpenClaw adapter now surfaces NemoClaw onboarding OTel trace metadata (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) through the detect() method, but this functionality and the trace ingestion mechanism are not documented in the Runtime and Session Observability blueprint. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The code now surfaces NemoClaw onboarding OTel trace observability data (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) through the OpenClaw adapter's detect() method metadata, but this capability is not documented in the Runtime and Session Observability requirement. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The implementation now surfaces NemoClaw onboarding OTel trace metadata through the detect() method, but this functionality—including the path resolution mechanism (NEMOCLAW_TRACE_FILE/NEMOCLAW_TRACE_DIR/.e2e/traces fallback) and multi-format trace processing—is not documented in the blueprint. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The OpenClaw adapter surfaces NemoClaw onboarding OTel trace metadata (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) through the detect() method, but this observability capability is not documented in the Runtime and Session Observability requirement. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The OpenClaw adapter surfaces NemoClaw onboarding OTel trace metadata (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) through the detect() method, but this functionality and the trace ingestion mechanism are not documented in the Runtime and Session Observability blueprint. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The OpenClaw adapter surfaces NemoClaw onboarding OTel trace metadata (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) through the detect() method, but this observability capability is not documented in the Runtime and Session Observability requirement. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The new _nemoclaw_onboard_trace() helper function implements NemoClaw onboarding OTel trace artifact surfacing (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) with multi-format trace processing and path resolution (NEMOCLAW_TRACE_FILE/NEMOCLAW_TRACE_DIR/.e2e/traces fallback), but this functionality is not documented in the Runtime and Session Observability blueprint. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The OpenClaw adapter surfaces NemoClaw onboarding OTel trace metadata (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) through the detect() method, but this observability capability is not documented in the Runtime and Session Observability requirement. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The new _nemoclaw_onboard_trace() helper implements NemoClaw onboarding OTel trace artifact surfacing with path resolution (NEMOCLAW_TRACE_FILE/NEMOCLAW_TRACE_DIR/.e2e/traces fallback), multi-format trace processing, and status ranking, but this implementation is not documented in the Runtime and Session Observability blueprint. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The OpenClaw adapter now surfaces NemoClaw onboarding OTel trace metadata (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) through the detect() method, but this observability capability is not documented in the Runtime and Session Observability requirement. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The new _nemoclaw_onboard_trace() helper function surfaces NemoClaw onboarding OTel trace artifacts with path resolution (NEMOCLAW_TRACE_FILE/NEMOCLAW_TRACE_DIR/.e2e/traces fallback) and multi-format trace processing, but this functionality is not documented in the Runtime and Session Observability blueprint. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The OpenClaw adapter now surfaces NemoClaw onboarding OTel trace metadata (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) through the detect() method, but this observability capability is not documented in the Runtime and Session Observability requirement. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The new _nemoclaw_onboard_trace() helper function surfaces NemoClaw onboarding OTel trace artifacts with path resolution (NEMOCLAW_TRACE_FILE/NEMOCLAW_TRACE_DIR/.e2e/traces fallback) and multi-format trace processing, but this functionality is not documented in the Runtime and Session Observability blueprint. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The OpenClaw adapter now surfaces NemoClaw onboarding OTel trace metadata (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) through the detect() method, but this observability capability is not documented in the Runtime and Session Observability requirement. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The new _nemoclaw_onboard_trace() helper function surfaces NemoClaw onboarding OTel trace artifacts with path resolution (NEMOCLAW_TRACE_FILE/NEMOCLAW_TRACE_DIR/.e2e/traces fallback) and multi-format trace processing, but this functionality is not documented in the Runtime and Session Observability blueprint's trace context inspection section. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The OpenClaw adapter surfaces NemoClaw onboarding OTel trace metadata (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) through the detect() method, but this observability capability is not documented in the Runtime and Session Observability requirement. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The new _nemoclaw_onboard_trace() helper surfaces NemoClaw onboarding OTel trace artifacts with multi-format trace processing (flat harness shape and resource_spans export) and path resolution (NEMOCLAW_TRACE_FILE/NEMOCLAW_TRACE_DIR/.e2e/traces fallback), but this functionality is not documented in the Runtime and Session Observability blueprint. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The OpenClaw adapter surfaces NemoClaw onboarding OTel trace metadata (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) through the detect() method, but this observability capability is not documented in REQ-OBS-RSO-002 (Inspect trace context). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The _nemoclaw_onboard_trace() helper surfaces NemoClaw onboarding OTel trace artifacts (nemoclawOnboardTraceStatus/SpanCount/Errors/SlowSpans) with path resolution (NEMOCLAW_TRACE_FILE/NEMOCLAW_TRACE_DIR/.e2e/traces fallback) and multi-format trace processing (flat harness shape and resource_spans export), but these capabilities are not documented in the blueprint's trace context inspection section. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The OpenClaw adapter surfaces NemoClaw onboarding OTel trace metadata (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) through the detect() method, but REQ-OBS-RSO-002 (Inspect trace context) does not specify NemoClaw-specific trace handling or these metadata fields. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The _nemoclaw_onboard_trace() helper implements NemoClaw onboarding OTel trace artifact surfacing with path resolution (NEMOCLAW_TRACE_FILE/NEMOCLAW_TRACE_DIR/.e2e/traces fallback) and multi-format trace processing, but this functionality is not documented in the Runtime and Session Observability blueprint. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The OpenClaw adapter surfaces NemoClaw-specific onboarding OTel trace metadata (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) through the detect() method, but REQ-OBS-RSO-002 (Inspect trace context) does not document this NemoClaw-specific observability capability or these metadata fields. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The _nemoclaw_onboard_trace() helper implements NemoClaw onboarding OTel trace artifact surfacing with path resolution (NEMOCLAW_TRACE_FILE/NEMOCLAW_TRACE_DIR/.e2e/traces fallback) and surfaces nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, and nemoclawOnboardSlowSpans, but this functionality is not documented in the Runtime and Session Observability blueprint. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The OpenClaw adapter surfaces NemoClaw-specific onboarding OTel trace metadata (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) through the detect() method, but REQ-OBS-RSO-002 (Inspect trace context) does not document this NemoClaw-specific observability capability or these metadata fields. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The _nemoclaw_onboard_trace() helper implements NemoClaw onboarding OTel trace artifact surfacing with path resolution (NEMOCLAW_TRACE_FILE/NEMOCLAW_TRACE_DIR/.e2e/traces fallback) and surfaces nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, and nemoclawOnboardSlowSpans, but this functionality is not documented in the Runtime and Session Observability blueprint's trace context inspection section. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. REQ-OBS-RSO-002 (Inspect trace context) does not document the NemoClaw-specific onboarding OTel trace metadata fields (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) that the code now surfaces through the OpenClaw adapter's detect() method. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The _nemoclaw_onboard_trace() helper surfaces NemoClaw onboarding OTel trace artifacts (nemoclawOnboardTraceStatus/SpanCount/Errors/SlowSpans) with path resolution and multi-format trace processing, but this capability is not documented in the blueprint's trace context inspection section. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The OpenClaw adapter surfaces NemoClaw-specific onboarding OTel trace metadata (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) through the detect() method, but REQ-OBS-RSO-002 (Inspect trace context) does not document this NemoClaw-specific observability capability or these metadata fields. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The _nemoclaw_onboard_trace() helper implements NemoClaw onboarding OTel trace artifact surfacing (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) with path resolution (NEMOCLAW_TRACE_FILE/NEMOCLAW_TRACE_DIR/.e2e/traces/trace.json fallback) and multi-format trace processing (flat harness shape and resource_spans export), but this functionality is not documented in the blueprint's trace context inspection section. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The OpenClaw adapter surfaces NemoClaw-specific onboarding OTel trace metadata (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) through the detect() method, but REQ-OBS-RSO-002 (Inspect trace context) does not document this NemoClaw-specific observability capability or these metadata fields. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The _nemoclaw_onboard_trace() helper implements NemoClaw onboarding OTel trace artifact surfacing with path resolution (NEMOCLAW_TRACE_FILE/NEMOCLAW_TRACE_DIR/.e2e/traces/trace.json fallback) and multi-format trace processing, but this functionality is not documented in the blueprint's trace context inspection section. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The code surfaces NemoClaw-specific onboarding OTel trace metadata (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) through the detect() method, but REQ-OBS-RSO-002 (Inspect trace context) does not document this NemoClaw-specific observability capability or specify these metadata fields. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The _nemoclaw_onboard_trace() helper implements NemoClaw onboarding OTel trace artifact surfacing with path resolution (NEMOCLAW_TRACE_FILE/NEMOCLAW_TRACE_DIR/.e2e/traces/trace.json fallback) and surfaces nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, and nemoclawOnboardSlowSpans, but this functionality is not documented in the blueprint's trace context inspection section. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The code surfaces NemoClaw onboarding OTel trace metadata (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) through the detect() method's meta output, but REQ-OBS-RSO-002 (Inspect trace context) does not document this NemoClaw-specific observability capability or these metadata fields. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The _nemoclaw_onboard_trace() helper implements NemoClaw onboarding OTel trace artifact surfacing with multi-format trace processing (flat harness shape and standard OTel resource_spans export) and path resolution (NEMOCLAW_TRACE_FILE/NEMOCLAW_TRACE_DIR/.e2e/traces/trace.json), but this functionality is not documented in the Runtime and Session Observability blueprint's trace context inspection section. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The _nemoclaw_onboard_trace() helper implements NemoClaw onboarding OTel trace artifact surfacing with path resolution and multi-format trace processing (flat harness shape and standard OTel resource_spans export), but this functionality is not documented in the blueprint's trace context inspection section. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. REQ-OBS-RSO-002 (Inspect trace context) does not document the NemoClaw onboarding OTel trace metadata fields (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) that the code now surfaces through the OpenClaw adapter's detect() method. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The _nemoclaw_onboard_trace() helper implements NemoClaw onboarding OTel trace artifact surfacing with path resolution (NEMOCLAW_TRACE_FILE/NEMOCLAW_TRACE_DIR/.e2e/traces/trace.json fallback) and surfaces nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, and nemoclawOnboardSlowSpans, but this functionality is not documented in the blueprint's trace context inspection section. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. REQ-OBS-RSO-002 (Inspect trace context) does not document the NemoClaw onboarding OTel trace metadata fields (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) that the code now surfaces through the OpenClaw adapter's detect() method. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The _nemoclaw_onboard_trace() helper implements NemoClaw onboarding OTel trace artifact surfacing with path resolution (NEMOCLAW_TRACE_FILE/NEMOCLAW_TRACE_DIR/.e2e/traces/trace.json fallback) and surfaces nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, and nemoclawOnboardSlowSpans, but this capability is not documented in the blueprint's trace context inspection section. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. REQ-OBS-RSO-002 (Inspect trace context) does not document the NemoClaw onboarding OTel trace metadata fields (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) that the code surfaces through the OpenClaw adapter's detect() method. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The _nemoclaw_onboard_trace() helper implements NemoClaw onboarding OTel trace artifact surfacing with path resolution (NEMOCLAW_TRACE_FILE/NEMOCLAW_TRACE_DIR/.e2e/traces/trace.json fallback) and surfaces nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, and nemoclawOnboardSlowSpans, but this functionality is not documented in the blueprint's trace context inspection section. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. REQ-OBS-RSO-002 (Inspect trace context) does not document the NemoClaw onboarding OTel trace metadata fields (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) that the code surfaces through the OpenClaw adapter's detect() method. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The _nemoclaw_onboard_trace() helper implements NemoClaw onboarding OTel trace artifact surfacing with path resolution (NEMOCLAW_TRACE_FILE/NEMOCLAW_TRACE_DIR/.e2e/traces/trace.json fallback) and surfaces nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, and nemoclawOnboardSlowSpans, but this functionality is not documented in the blueprint's trace context inspection section. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The code surfaces NemoClaw onboarding OTel trace metadata fields (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) through the OpenClaw adapter's detect() method, but REQ-OBS-RSO-002 (Inspect trace context) does not document this NemoClaw-specific trace observability capability or specify these metadata fields. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The _nemoclaw_onboard_trace() helper implements NemoClaw onboarding OTel trace artifact surfacing with path resolution (NEMOCLAW_TRACE_FILE/NEMOCLAW_TRACE_DIR/.e2e/traces/trace.json fallback) and multi-format trace processing, but this functionality is not documented in the blueprint's trace context inspection section. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. REQ-OBS-RSO-002 (Inspect trace context) does not document the NemoClaw-specific onboarding OTel trace metadata fields (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) that the code surfaces through the OpenClaw adapter's detect() method. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The _nemoclaw_onboard_trace() helper implements NemoClaw onboarding OTel trace artifact surfacing with path resolution (NEMOCLAW_TRACE_FILE/NEMOCLAW_TRACE_DIR/.e2e/traces/trace.json fallback) and surfaces nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, and nemoclawOnboardSlowSpans, but this functionality is not documented in the blueprint's trace context inspection section. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. REQ-OBS-RSO-002 (Inspect trace context) specifies presenting available trace-related activity records but does not document the NemoClaw-specific onboarding OTel trace metadata fields (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) that the code surfaces through the OpenClaw adapter's detect() method. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The blueprint's trace context inspection section does not document the _nemoclaw_onboard_trace() helper, which implements NemoClaw onboarding OTel trace artifact surfacing with path resolution (NEMOCLAW_TRACE_FILE/NEMOCLAW_TRACE_DIR/.e2e/traces/trace.json fallback) and surfaces nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, and nemoclawOnboardSlowSpans. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. REQ-OBS-RSO-002 (Inspect trace context) specifies presenting available trace-related activity records but does not document the NemoClaw-specific onboarding OTel trace metadata fields (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) that the code surfaces through the OpenClaw adapter's detect() method. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The blueprint's trace context inspection section does not document the _nemoclaw_onboard_trace() helper, which implements NemoClaw onboarding OTel trace artifact surfacing with path resolution (NEMOCLAW_TRACE_FILE/NEMOCLAW_TRACE_DIR/.e2e/traces/trace.json fallback) and surfaces nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, and nemoclawOnboardSlowSpans. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. REQ-OBS-RSO-002 (Inspect trace context) specifies presenting available trace-related activity records but does not document the NemoClaw-specific onboarding OTel trace metadata fields (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) that the code surfaces through the OpenClaw adapter's detect() method. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The blueprint's trace context inspection section does not document the _nemoclaw_onboard_trace() helper, which implements NemoClaw onboarding OTel trace artifact surfacing with path resolution (NEMOCLAW_TRACE_FILE/NEMOCLAW_TRACE_DIR/.e2e/traces/trace.json fallback) and surfaces nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, and nemoclawOnboardSlowSpans. |
||
| """Read NemoClaw onboarding OTel trace artifacts (#5193). | ||
|
|
||
| When ``NEMOCLAW_TRACE`` is set the harness writes OpenTelemetry-style spans | ||
| for each onboarding phase (e.g. ``nemoclaw.onboard.phase.gateway``, | ||
| ``nemoclaw.onboard.phase.inference``) including span status (OK/ERROR/UNSET), | ||
| duration_ms, events, sanitised attributes, and a ``summary.slowest_spans`` | ||
| list. ClawMetry surfaces the worst-case status, error phase names, and the | ||
| slowest-span summary so a failed or slow onboarding step is diagnosable from | ||
| the dashboard rather than silently invisible. | ||
|
|
||
| Path resolution (first match wins): | ||
| 1. ``NEMOCLAW_TRACE_FILE`` env var. | ||
| 2. ``NEMOCLAW_TRACE_DIR/trace.json``. | ||
| 3. ``.e2e/traces/trace.json`` (harness default, relative to cwd). | ||
|
|
||
| Handles both the flat harness shape ``{spans:[...], summary:{...}}`` and the | ||
| standard OTel ``resource_spans`` export. Returns ``{}`` when | ||
| ``NEMOCLAW_TRACE`` is unset/disabled or no file is found. Never raises. | ||
| """ | ||
| import json as _json | ||
|
|
||
| trace_env = os.environ.get("NEMOCLAW_TRACE", "") | ||
| if not trace_env or trace_env.lower() in ("0", "false", "no"): | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The implementation includes error detection via span-status ranking (ERROR/UNSET/OK), error phase name extraction, and slowest_spans capping at 5, but these observability design details are not documented in the blueprint's approach to trace context inspection. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The implementation includes error detection via span-status ranking (ERROR/UNSET/OK), error phase name extraction from ERROR spans, and slowest_spans capping at 5, but these observability design details and trace processing strategy are not documented in the blueprint's approach to trace context inspection. |
||
| return {} | ||
|
|
||
| candidates = [] | ||
| tf = os.environ.get("NEMOCLAW_TRACE_FILE", "") | ||
| if tf: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The implementation includes error detection via span-status ranking (ERROR/UNSET/OK), error phase name extraction, and slowest_spans capping at 5, but these observability design details and trace processing strategy are not documented in the blueprint's approach to trace context inspection. |
||
| candidates.append(tf) | ||
| td = os.environ.get("NEMOCLAW_TRACE_DIR", "") | ||
| if td: | ||
| candidates.append(os.path.join(td, "trace.json")) | ||
| candidates.append(os.path.join(".e2e", "traces", "trace.json")) | ||
|
|
||
| data = None | ||
| for path in candidates: | ||
| try: | ||
| with open(path, "r", encoding="utf-8", errors="replace") as fh: | ||
| data = _json.load(fh) | ||
| break | ||
| except (OSError, ValueError): | ||
| continue | ||
| except Exception: | ||
| continue | ||
|
|
||
| if data is None or not isinstance(data, dict): | ||
| return {} | ||
|
|
||
| try: | ||
| spans: list = [] | ||
| if "spans" in data: | ||
| raw = data["spans"] | ||
| if isinstance(raw, list): | ||
| spans = raw | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The implementation includes error detection via span-status ranking (ERROR/UNSET/OK), error phase name extraction, and slowest_spans capping at 5, but these observability design details are not documented in the blueprint's approach to trace context inspection. |
||
| elif "resource_spans" in data: | ||
| for rs in data.get("resource_spans", []): | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The implementation includes specific observability design details (error detection via span-status ranking with ERROR/UNSET/OK priorities, error phase name extraction from ERROR spans, slowest_spans output capped at 5 entries, support for both flat harness and resource_spans OTel trace formats) that are not documented in the blueprint's approach to trace context inspection. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The implementation includes specific observability design details (error detection via span-status ranking with ERROR/UNSET/OK priorities, error phase name extraction from ERROR spans, slowest_spans output capped at 5 entries, support for both flat harness and resource_spans OTel trace formats) that are not documented in the blueprint's approach to trace context inspection. |
||
| for ss in (rs.get("scope_spans") or rs.get("scopeSpans") or []): | ||
| spans.extend(ss.get("spans", [])) | ||
|
|
||
| _STATUS_RANK = {"ERROR": 2, "UNSET": 1, "OK": 0} | ||
| # OTel status codes: 0 = UNSET, 1 = OK, 2 = ERROR (the JSON export | ||
| # writes ``{"code": N}``; some exporters write ``STATUS_CODE_OK``). | ||
| _CODE_TO_STATUS = {0: "UNSET", 1: "OK", 2: "ERROR"} | ||
|
|
||
| def _norm_status(raw) -> str: | ||
| if isinstance(raw, dict): | ||
| raw = raw.get("code", raw.get("status_code", "UNSET")) | ||
| if isinstance(raw, bool): | ||
| return "UNSET" | ||
| if isinstance(raw, (int, float)): | ||
| return _CODE_TO_STATUS.get(int(raw), "UNSET") | ||
| text = str(raw or "UNSET").upper().strip() | ||
| if text.startswith("STATUS_CODE_"): | ||
| text = text[len("STATUS_CODE_"):] | ||
| return text if text in _STATUS_RANK else "UNSET" | ||
|
|
||
| worst_rank = -1 | ||
| worst_status = "UNSET" | ||
| error_names: list = [] | ||
|
|
||
| for span in spans: | ||
| if not isinstance(span, dict): | ||
| continue | ||
| status = _norm_status(span.get("status", "UNSET")) | ||
| rank = _STATUS_RANK[status] | ||
| if rank > worst_rank: | ||
| worst_rank = rank | ||
| worst_status = status | ||
| if status == "ERROR": | ||
| name = span.get("name") or span.get("spanName") or "" | ||
| if name: | ||
| error_names.append(str(name)) | ||
|
|
||
| result: dict = {} | ||
| if spans: | ||
| result["nemoclawOnboardTraceStatus"] = worst_status | ||
| result["nemoclawOnboardTraceSpanCount"] = len(spans) | ||
| if error_names: | ||
| result["nemoclawOnboardTraceErrors"] = error_names[:10] | ||
|
|
||
| summary = data.get("summary") | ||
| if isinstance(summary, dict): | ||
| slow = summary.get("slowest_spans") | ||
| if isinstance(slow, list) and slow: | ||
| result["nemoclawOnboardSlowSpans"] = slow[:5] | ||
|
|
||
| return result | ||
| except Exception: | ||
| return {} | ||
|
|
||
|
|
||
| def _parse_proxy_config_model_list(content: str) -> Optional[List[str]]: | ||
| """Extract model names from a LiteLLM-style proxy-config YAML (#2960). | ||
|
|
||
|
|
@@ -2451,6 +2563,13 @@ def detect(self) -> DetectResult: | |
| # fleet views know whether autonomous skill actions are gated by | ||
| # human approval. Returns {} on installs without the key. | ||
| meta.update(_workshop_approval_config()) | ||
| # NemoClaw onboarding OTel trace artifacts (#5193): surfaces | ||
| # nemoclawOnboardTraceStatus/SpanCount/Errors/SlowSpans when | ||
| # NEMOCLAW_TRACE is set and the harness wrote a trace file. | ||
| # Returns {} when disabled or file absent — no guard needed. | ||
| _ot = _nemoclaw_onboard_trace() | ||
| if _ot: | ||
| meta.update(_ot) | ||
| return DetectResult( | ||
| name=self.name, | ||
| display_name=self.display_name, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,226 @@ | ||
| """Tests for issue #5193 — nemoclaw: onboarding OTel trace artifacts not ingested. | ||
|
|
||
| Verifies that _nemoclaw_onboard_trace() reads the trace file written by the | ||
| NemoClaw harness (NEMOCLAW_TRACE_FILE / NEMOCLAW_TRACE_DIR / .e2e/traces/trace.json) | ||
| and surfaces nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, | ||
| nemoclawOnboardTraceErrors, and nemoclawOnboardSlowSpans on DetectResult.meta. | ||
|
|
||
| Fingerprint: hgap-1f53053124 (used to dedupe — keep it in the body). | ||
| """ | ||
| from __future__ import annotations | ||
|
|
||
| import importlib | ||
| import json | ||
| import os | ||
| import sys | ||
|
|
||
| import pytest | ||
|
|
||
|
|
||
| @pytest.fixture(autouse=True) | ||
| def _restore_sys_modules(): | ||
| saved = sys.modules.get("clawmetry.adapters.openclaw") | ||
| yield | ||
| if saved is None: | ||
| sys.modules.pop("clawmetry.adapters.openclaw", None) | ||
| else: | ||
| sys.modules["clawmetry.adapters.openclaw"] = saved | ||
|
|
||
|
|
||
| def _reload_adapter(): | ||
| import clawmetry.adapters.openclaw as oc_mod | ||
| importlib.reload(oc_mod) | ||
| return oc_mod | ||
|
|
||
|
|
||
| def _write_trace(path, spans, summary=None): | ||
| data: dict = {"spans": spans} | ||
| if summary is not None: | ||
| data["summary"] = summary | ||
| os.makedirs(os.path.dirname(path), exist_ok=True) | ||
| with open(path, "w") as fh: | ||
| json.dump(data, fh) | ||
|
|
||
|
|
||
| def test_disabled_when_env_not_set(monkeypatch): | ||
| """Returns {} when NEMOCLAW_TRACE is absent.""" | ||
| monkeypatch.delenv("NEMOCLAW_TRACE", raising=False) | ||
| oc = _reload_adapter() | ||
| assert oc._nemoclaw_onboard_trace() == {} | ||
|
|
||
|
|
||
| def test_disabled_when_env_zero(monkeypatch): | ||
| """Returns {} when NEMOCLAW_TRACE=0 (explicitly disabled).""" | ||
| monkeypatch.setenv("NEMOCLAW_TRACE", "0") | ||
| oc = _reload_adapter() | ||
| assert oc._nemoclaw_onboard_trace() == {} | ||
|
|
||
|
|
||
| def test_returns_empty_when_file_missing(monkeypatch, tmp_path): | ||
| """Returns {} gracefully when trace file does not exist — never raises.""" | ||
| monkeypatch.setenv("NEMOCLAW_TRACE", "1") | ||
| monkeypatch.setenv("NEMOCLAW_TRACE_FILE", str(tmp_path / "no_such_file.json")) | ||
| monkeypatch.delenv("NEMOCLAW_TRACE_DIR", raising=False) | ||
| monkeypatch.chdir(tmp_path) # prevents fallback to .e2e/traces/trace.json | ||
| oc = _reload_adapter() | ||
| assert oc._nemoclaw_onboard_trace() == {} | ||
|
|
||
|
|
||
| def test_ok_spans_surface_status_and_count(monkeypatch, tmp_path): | ||
| """All-OK spans produce status=OK and the correct span count.""" | ||
| trace_file = tmp_path / "trace.json" | ||
| _write_trace(str(trace_file), [ | ||
| {"name": "nemoclaw.onboard.phase.gateway", "status": "OK", "duration_ms": 120}, | ||
| {"name": "nemoclaw.onboard.phase.inference", "status": "OK", "duration_ms": 340}, | ||
| ]) | ||
| monkeypatch.setenv("NEMOCLAW_TRACE", "1") | ||
| monkeypatch.setenv("NEMOCLAW_TRACE_FILE", str(trace_file)) | ||
| monkeypatch.delenv("NEMOCLAW_TRACE_DIR", raising=False) | ||
| oc = _reload_adapter() | ||
| result = oc._nemoclaw_onboard_trace() | ||
| assert result["nemoclawOnboardTraceStatus"] == "OK" | ||
| assert result["nemoclawOnboardTraceSpanCount"] == 2 | ||
| assert "nemoclawOnboardTraceErrors" not in result | ||
|
|
||
|
|
||
| def test_error_span_surfaces_status_and_name(monkeypatch, tmp_path): | ||
| """An ERROR span sets worst-case status=ERROR and includes the phase name.""" | ||
| trace_file = tmp_path / "trace.json" | ||
| _write_trace(str(trace_file), [ | ||
| {"name": "nemoclaw.onboard.phase.gateway", "status": "OK", "duration_ms": 80}, | ||
| {"name": "nemoclaw.onboard.phase.inference", "status": "ERROR", "duration_ms": 5000}, | ||
| ]) | ||
| monkeypatch.setenv("NEMOCLAW_TRACE", "1") | ||
| monkeypatch.setenv("NEMOCLAW_TRACE_FILE", str(trace_file)) | ||
| monkeypatch.delenv("NEMOCLAW_TRACE_DIR", raising=False) | ||
| oc = _reload_adapter() | ||
| result = oc._nemoclaw_onboard_trace() | ||
| assert result["nemoclawOnboardTraceStatus"] == "ERROR" | ||
| assert result["nemoclawOnboardTraceSpanCount"] == 2 | ||
| assert "nemoclaw.onboard.phase.inference" in result["nemoclawOnboardTraceErrors"] | ||
|
|
||
|
|
||
| def test_slowest_spans_forwarded_from_summary(monkeypatch, tmp_path): | ||
| """summary.slowest_spans is forwarded as nemoclawOnboardSlowSpans (capped at 5).""" | ||
| slow = [ | ||
| {"name": "nemoclaw.onboard.phase.inference", "duration_ms": 4200}, | ||
| {"name": "nemoclaw.onboard.phase.gateway", "duration_ms": 900}, | ||
| ] | ||
| trace_file = tmp_path / "trace.json" | ||
| _write_trace(str(trace_file), [ | ||
| {"name": "nemoclaw.onboard.phase.inference", "status": "OK", "duration_ms": 4200}, | ||
| ], summary={"slowest_spans": slow}) | ||
| monkeypatch.setenv("NEMOCLAW_TRACE", "1") | ||
| monkeypatch.setenv("NEMOCLAW_TRACE_FILE", str(trace_file)) | ||
| monkeypatch.delenv("NEMOCLAW_TRACE_DIR", raising=False) | ||
| oc = _reload_adapter() | ||
| result = oc._nemoclaw_onboard_trace() | ||
| assert result["nemoclawOnboardSlowSpans"] == slow | ||
|
|
||
|
|
||
| def test_trace_dir_env_resolves_to_trace_json(monkeypatch, tmp_path): | ||
| """NEMOCLAW_TRACE_DIR is used as a directory and trace.json is appended.""" | ||
| trace_dir = tmp_path / "traces" | ||
| trace_dir.mkdir() | ||
| _write_trace(str(trace_dir / "trace.json"), [ | ||
| {"name": "nemoclaw.onboard.phase.gateway", "status": "OK", "duration_ms": 50}, | ||
| ]) | ||
| monkeypatch.setenv("NEMOCLAW_TRACE", "1") | ||
| monkeypatch.delenv("NEMOCLAW_TRACE_FILE", raising=False) | ||
| monkeypatch.setenv("NEMOCLAW_TRACE_DIR", str(trace_dir)) | ||
| oc = _reload_adapter() | ||
| result = oc._nemoclaw_onboard_trace() | ||
| assert result["nemoclawOnboardTraceStatus"] == "OK" | ||
| assert result["nemoclawOnboardTraceSpanCount"] == 1 | ||
|
|
||
|
|
||
| def test_resource_spans_otel_export_format(monkeypatch, tmp_path): | ||
| """Standard OTel resource_spans export shape is parsed correctly (snake_case keys).""" | ||
| trace_file = tmp_path / "trace.json" | ||
| data = { | ||
| "resource_spans": [ | ||
| { | ||
| "scope_spans": [ | ||
| { | ||
| "spans": [ | ||
| {"name": "nemoclaw.onboard.phase.gateway", "status": "OK"}, | ||
| {"name": "nemoclaw.onboard.phase.inference", "status": "ERROR"}, | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| with open(str(trace_file), "w") as fh: | ||
| json.dump(data, fh) | ||
| monkeypatch.setenv("NEMOCLAW_TRACE", "1") | ||
| monkeypatch.setenv("NEMOCLAW_TRACE_FILE", str(trace_file)) | ||
| monkeypatch.delenv("NEMOCLAW_TRACE_DIR", raising=False) | ||
| oc = _reload_adapter() | ||
| result = oc._nemoclaw_onboard_trace() | ||
| assert result["nemoclawOnboardTraceStatus"] == "ERROR" | ||
| assert result["nemoclawOnboardTraceSpanCount"] == 2 | ||
| assert "nemoclaw.onboard.phase.inference" in result["nemoclawOnboardTraceErrors"] | ||
|
|
||
|
|
||
| def test_resource_spans_camel_case_scope_spans(monkeypatch, tmp_path): | ||
| """Standard OTel resource_spans export with camelCase scopeSpans key is parsed correctly.""" | ||
| trace_file = tmp_path / "trace.json" | ||
| data = { | ||
| "resource_spans": [ | ||
| { | ||
| "scopeSpans": [ | ||
| { | ||
| "spans": [ | ||
| {"name": "nemoclaw.onboard.phase.gateway", "status": "OK"}, | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| with open(str(trace_file), "w") as fh: | ||
| json.dump(data, fh) | ||
| monkeypatch.setenv("NEMOCLAW_TRACE", "1") | ||
| monkeypatch.setenv("NEMOCLAW_TRACE_FILE", str(trace_file)) | ||
| monkeypatch.delenv("NEMOCLAW_TRACE_DIR", raising=False) | ||
| oc = _reload_adapter() | ||
| result = oc._nemoclaw_onboard_trace() | ||
| assert result["nemoclawOnboardTraceStatus"] == "OK" | ||
| assert result["nemoclawOnboardTraceSpanCount"] == 1 | ||
|
|
||
|
|
||
| def test_otel_export_shape_with_status_code_objects(monkeypatch, tmp_path): | ||
| """Standard OTel JSON export: resource_spans/scope_spans and {code: N} status.""" | ||
| trace_file = tmp_path / "trace.json" | ||
| data = {"resource_spans": [{"scope_spans": [{"spans": [ | ||
| {"name": "nemoclaw.onboard.phase.gateway", "status": {"code": 1}}, | ||
| {"name": "nemoclaw.onboard.phase.inference", "status": {"code": 2}}, | ||
| {"name": "nemoclaw.onboard.phase.sandbox", "status": "STATUS_CODE_OK"}, | ||
| {"name": "nemoclaw.onboard.phase.unknown", "status": "weird-value"}, | ||
| ]}]}]} | ||
| with open(trace_file, "w") as fh: | ||
| json.dump(data, fh) | ||
| monkeypatch.setenv("NEMOCLAW_TRACE", "1") | ||
| monkeypatch.setenv("NEMOCLAW_TRACE_FILE", str(trace_file)) | ||
| monkeypatch.delenv("NEMOCLAW_TRACE_DIR", raising=False) | ||
| oc = _reload_adapter() | ||
| out = oc._nemoclaw_onboard_trace() | ||
| assert out["nemoclawOnboardTraceStatus"] == "ERROR" | ||
| assert out["nemoclawOnboardTraceSpanCount"] == 4 | ||
| assert out["nemoclawOnboardTraceErrors"] == ["nemoclaw.onboard.phase.inference"] | ||
|
|
||
|
|
||
| def test_unrecognised_status_strings_report_unset_not_raw(monkeypatch, tmp_path): | ||
| """Status is always one of OK/ERROR/UNSET, never an arbitrary raw string.""" | ||
| trace_file = tmp_path / "trace.json" | ||
| _write_trace(str(trace_file), [ | ||
| {"name": "nemoclaw.onboard.phase.gateway", "status": "bogus"}, | ||
| ]) | ||
| monkeypatch.setenv("NEMOCLAW_TRACE", "1") | ||
| monkeypatch.setenv("NEMOCLAW_TRACE_FILE", str(trace_file)) | ||
| monkeypatch.delenv("NEMOCLAW_TRACE_DIR", raising=False) | ||
| oc = _reload_adapter() | ||
| out = oc._nemoclaw_onboard_trace() | ||
| assert out["nemoclawOnboardTraceStatus"] == "UNSET" | ||
| assert "nemoclawOnboardTraceErrors" not in out |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
REQ-OBS-RSO-002 (Inspect trace context) does not document the NemoClaw-specific onboarding OTel trace metadata fields (nemoclawOnboardTraceStatus, nemoclawOnboardTraceSpanCount, nemoclawOnboardTraceErrors, nemoclawOnboardSlowSpans) that the code surfaces through the OpenClaw adapter's detect() method.