-
Notifications
You must be signed in to change notification settings - Fork 182
ROB-2136 increase prometheus tool limit #1025
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
|
Caution Review failedThe pull request is closed. WalkthroughIntroduces ToolInvokeContext across core, tools, plugins, and tests; updates tool invocation signatures to use context; centralizes token-limit utilities; adds token-based counting and truncation for tool outputs; adjusts tool result formatting to include params; refactors Prometheus tools to token-based sizing and structured responses; updates tests accordingly. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant U as ToolCallingLLM
participant T as Tool
participant C as ToolInvokeContext
participant L as LLM
participant Lim as ContextWindowLimiter
participant Tok as TokenCounter
U->>U: get_max_token_count_for_single_tool(LLM)
U->>C: Build context (tool_number, user_approved, llm, max_token_count)
U->>T: invoke(params, context=C)
activate T
T->>T: _invoke(params, context) [tool-specific]
T-->>U: StructuredToolResult
deactivate T
U->>Tok: count_tool_response_tokens(LLM, result)
Tok-->>U: token_count
U->>Lim: prevent_overly_big_tool_response(result, LLM)
Lim-->>U: possibly adjusted result (ERROR if over limit)
U-->>U: format_tool_result_data(result) incl. Params used
U-->>U: as_tool_call_message(content=formatted)
sequenceDiagram
autonumber
participant P as PodLoggingTool
participant C as ToolInvokeContext
participant L as LLM
participant Tr as truncate_logs
P->>P: fetch logs (params)
P->>Tr: truncate_logs(result, L, C.max_token_count, params)
Tr->>L: count_tokens_for_message(...)
alt tokens > limit
Tr->>Tr: iterative truncation with prefix
Tr-->>P: shortened result
else
Tr-->>P: original result
end
P-->>Caller: StructuredToolResult
Estimated code review effort🎯 4 (Complex) | ⏱️ ~75 minutes Possibly related PRs
Suggested labels
Suggested reviewers
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (66)
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 |
No description provided.