Skip to content

Conversation

@nherment
Copy link
Contributor

No description provided.

@coderabbitai
Copy link

coderabbitai bot commented Aug 29, 2025

Walkthrough

Adds a new ToolApprovalDecision model and extends HolmesChatParams and HolmesChatRequest with enable_tool_approval and tool_decisions; passes those fields through in holmes_chat. No other logic, error handling, or control-flow changes.

Changes

Cohort / File(s) Summary
Core models (params)
src/robusta/core/model/base_params.py
Added ToolApprovalDecision model with tool_call_id: str, approved: bool, modified_params: Optional[Dict[str, Any]] = None. Extended HolmesChatParams with enable_tool_approval: bool = False and tool_decisions: Optional[List[ToolApprovalDecision]] = None.
Reporting models (Holmes)
src/robusta/core/reporting/holmes.py
Imported ToolApprovalDecision; extended HolmesChatRequest with enable_tool_approval: bool = False and tool_decisions: Optional[List[ToolApprovalDecision]] = None.
Playbook integration
src/robusta/core/playbooks/internal/ai_integration.py
Updated holmes_chat to pass enable_tool_approval and tool_decisions into HolmesChatRequest construction; call signature otherwise unchanged.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant Caller
  participant AI_Int as ai_integration.holmes_chat
  participant Req as reporting.holmes.HolmesChatRequest
  participant Holmes as Holmes Service

  Caller->>AI_Int: holmes_chat(ask, history, model, stream, enable_tool_approval, tool_decisions)
  AI_Int->>Req: Construct HolmesChatRequest(..., enable_tool_approval, tool_decisions)
  Note right of Req: Request carries tool approval fields
  AI_Int->>Holmes: POST /holmes/chat with HolmesChatRequest
  Holmes-->>AI_Int: Stream/response
  AI_Int-->>Caller: Return stream/response
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The pull request has no description provided by the author. There is no contextual information explaining the purpose or scope of the changes. This absence prevents reviewers from quickly understanding the intent and impact of the modifications. Please add a brief description summarizing the changes, their rationale, and any relevant details to help reviewers understand the purpose and impact of this pull request.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title Check ✅ Passed The pull request title accurately captures the main change of adding support for tool approval fields in the Holmes integration. It concisely reflects the modifications to the chat parameters and request models without unnecessary detail. The use of the ROB-1933 prefix aligns with project conventions and does not hinder clarity.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch rob-1933_holmes_tool_approval_workflow

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6a3143a and 0bd0522.

📒 Files selected for processing (1)
  • src/robusta/core/playbooks/internal/ai_integration.py (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/robusta/core/playbooks/internal/ai_integration.py
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: run_tests
  • GitHub Check: run_tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@nherment nherment marked this pull request as ready for review August 29, 2025 06:07
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
src/robusta/core/playbooks/internal/ai_integration.py (2)

293-299: Propagate tool-approval fields to issue_chat as well

HolmesIssueChatRequest inherits HolmesChatRequest, so these fields are supported. Forward them for consistency.

         holmes_req = HolmesIssueChatRequest(
             ask=params.ask,
             conversation_history=params.conversation_history,
             investigation_result=params.context.investigation_result,
             issue_type=params.context.issue_type,
             model=params.model,
+            enable_tool_approval=params.enable_tool_approval,
+            tool_decisions=params.tool_decisions if params.enable_tool_approval else None,
         )

426-432: Propagate tool-approval fields to workload_health_chat

HolmesWorkloadHealthRequest inherits HolmesChatRequest; pass the new fields for parity.

         holmes_req = HolmesWorkloadHealthRequest(
             ask=params.ask,
             conversation_history=params.conversation_history,
             workload_health_result=params.workload_health_result,
             resource=params.resource,
             model=params.model,
+            enable_tool_approval=params.enable_tool_approval,
+            tool_decisions=params.tool_decisions if params.enable_tool_approval else None,
         )
🧹 Nitpick comments (1)
src/robusta/core/playbooks/internal/ai_integration.py (1)

343-349: Type-compat note if duplication remains

If ToolApprovalDecision stays duplicated, Pydantic may not coerce between the two classes when nesting. Convert to dict to be safe (prefer dedup as suggested).

-            tool_decisions=params.tool_decisions if params.enable_tool_approval else None,
+            tool_decisions=(
+                [td.dict() for td in params.tool_decisions] if params.enable_tool_approval and params.tool_decisions else None
+            ),
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 350448b and 4f39d21.

📒 Files selected for processing (3)
  • src/robusta/core/model/base_params.py (2 hunks)
  • src/robusta/core/playbooks/internal/ai_integration.py (1 hunks)
  • src/robusta/core/reporting/holmes.py (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/robusta/core/reporting/holmes.py (1)
src/robusta/core/model/base_params.py (1)
  • ToolApprovalDecision (185-190)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: run_tests
  • GitHub Check: run_tests

@nherment nherment requested a review from moshemorad August 29, 2025 10:13
@nherment nherment requested a review from arikalon1 October 3, 2025 10:52
aantn
aantn previously approved these changes Oct 3, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

♻️ Duplicate comments (1)
src/robusta/core/playbooks/internal/ai_integration.py (1)

351-353: Consider conditionally passing tool_decisions.

As noted in a previous review, passing tool_decisions when enable_tool_approval is False may create server-side ambiguity. Consider passing tool_decisions only when the approval feature is enabled.

Based on past review comments, apply this diff:

             ask=params.ask,
             conversation_history=params.conversation_history,
             model=params.model,
             stream=params.stream,
             additional_system_prompt=params.additional_system_prompt,
             enable_tool_approval=params.enable_tool_approval,
-            tool_decisions=params.tool_decisions,
+            tool_decisions=params.tool_decisions if params.enable_tool_approval else None,
         )
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4f39d21 and 6a3143a.

📒 Files selected for processing (3)
  • src/robusta/core/model/base_params.py (2 hunks)
  • src/robusta/core/playbooks/internal/ai_integration.py (1 hunks)
  • src/robusta/core/reporting/holmes.py (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/robusta/core/model/base_params.py
  • src/robusta/core/reporting/holmes.py
🧰 Additional context used
🪛 Ruff (0.13.2)
src/robusta/core/playbooks/internal/ai_integration.py

347-347: Duplicate keyword argument "ask"

(invalid-syntax)


348-348: Duplicate keyword argument "conversation_history"

(invalid-syntax)


349-349: Duplicate keyword argument "model"

(invalid-syntax)


350-350: Duplicate keyword argument "stream"

(invalid-syntax)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: run_tests
  • GitHub Check: run_tests
  • GitHub Check: Deploy docs

@nherment nherment merged commit 53bd62c into master Oct 6, 2025
6 checks passed
@nherment nherment deleted the rob-1933_holmes_tool_approval_workflow branch October 6, 2025 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants