Skip to content

Commit 11c8816

Browse files
alonelishclaude
andauthored
ROB-3820: Forward chat-analytics fields through holmes_issue_chat (#2075)
* Forward chat-analytics fields through holmes_issue_chat holmes_chat passes the full HolmesChatParams payload to /api/chat via params.dict() (b14f68d), so source_ref and the other analytics fields land on Holmes. holmes_issue_chat was missed: it built HolmesIssueChatRequest with five hand-picked fields, silently dropping source_ref, request_type, request_source, conversation_id, conversation_source, is_internal, meta, plus enable_tool_approval, tool_decisions, and additional_system_prompt. Slack/Teams threaded chats on an existing alert hit /api/issue_chat, which is why source_ref arrived from the relay populated and was stored as NULL in HolmesUsageEvents. Mirror the holmes_chat pass-through pattern: take params.dict() minus runner-only/structurally-handled fields and splat the rest, then add investigation_result and issue_type from params.context. Same client/server-upgrade-without-middleware-changes property the HolmesChat schemas docstring describes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Log chat-analytics fields before forwarding to Holmes Diagnostic log on both /api/chat and /api/issue_chat paths so we can verify what the runner actually forwards (source_ref, request_source, request_type, conversation_id, conversation_source, is_internal). If these show up in the runner log but land NULL in Holmes' usage events, the gap is downstream of the runner. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Log raw action_params keys for holmes_* actions at receiver Targeted info-level log at the websocket boundary to distinguish "relay didn't send source_ref" from "something downstream stripped it." Prints the full key list so we can see whether source_ref is present at all when the relay hands off to the runner, plus the analytics field values for direct comparison with the holmes_chat forwarding log line. Scoped to action names starting with holmes_ so the rest of the action traffic stays at debug verbosity. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> * Remove diagnostic logging — issue traced to relay The receiver-side and forwarding-side logs confirmed the relay was omitting source_ref and the other chat-analytics fields from the holmes_chat action_params on the Slack path. Fix lives in the relay repo, not here. Reverting the diagnostic log lines now that the investigation is done; keeping the holmes_issue_chat pass-through fix. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent b059129 commit 11c8816

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/robusta/core/playbooks/internal/ai_integration.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,12 +264,11 @@ def holmes_issue_chat(event: ExecutionBaseEvent, params: HolmesIssueChatParams):
264264
conversation_title = build_conversation_title(params)
265265
params_resource_kind = params.resource.kind or ""
266266
try:
267+
params_dict = params.dict(exclude={"holmes_url", "render_graph_images", "resource", "context"})
267268
holmes_req = HolmesIssueChatRequest(
268-
ask=params.ask,
269-
conversation_history=params.conversation_history,
269+
**params_dict,
270270
investigation_result=params.context.investigation_result,
271271
issue_type=params.context.issue_type,
272-
model=params.model,
273272
)
274273
result = requests.post(f"{holmes_url}/api/issue_chat", data=holmes_req.json())
275274
result.raise_for_status()

0 commit comments

Comments
 (0)