-
Notifications
You must be signed in to change notification settings - Fork 288
ROB-1933: add support for holmes tool approval fields #1910
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
Conversation
WalkthroughAdds 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
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
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ 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)
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 |
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.
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 wellHolmesIssueChatRequest 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_chatHolmesWorkloadHealthRequest 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 remainsIf 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.
📒 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
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.
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_decisionswhenenable_tool_approvalisFalsemay create server-side ambiguity. Consider passingtool_decisionsonly 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
📒 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
No description provided.