fix(ai): align conversation execution and query tool contracts - #782
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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 |
f612504 to
8679bbb
Compare
|
The latest updates on your projects. Learn more about Unkey Deploy
|
|
@greptileai Please review final head 8679bbb before staging merge. This conversation slice is rebased onto the merged native Autumn billing and query-discovery changes. It preserves server-derived billing access, fail-closed behavior, rate limits, and actual executed-model accounting while using one native conversation runner and validated nullable query inputs. Terra and Luna both retain requested OpenAI reasoning effort. Fresh root lint, 33 type/build tasks, 27 test tasks, 52 focused native tests and 11 actual API HTTP tests pass. Independent review confirmed all 20 paths match the tested integration and do not touch the merged Insights settlement fix. |
Greptile SummaryDashboard, MCP, and Slack now use one shared conversation agent with model-specific settings and full tool access. Query inputs accept strict-provider nulls, while billing records the model that actually ran.
Confidence Score: 4/5The runtime changes look safe, but the new mock-based tests break an explicit repo rule and must change before merge. The shared runner keeps the existing access, billing, retry, and tool checks. The only accepted issue is the banned mock test setup. Files Needing Attention: Important Files Changed
Sequence DiagramsequenceDiagram
actor User
participant API as Dashboard / MCP / Slack
participant Access as Auth, rate, billing
participant Config as Model config
participant Agent as Shared conversation agent
participant Model as Selected model
participant Tools as Agent tools
participant Query as Query planner
participant Usage as Usage billing
User->>API: Send conversation request
API->>Access: Check identity, site access, rate, allowance
alt Request is blocked
Access-->>User: Return error before model work
else Request is allowed
API->>Config: Select model and provider options
Config->>Agent: Build one native tool loop
Agent->>Model: Send messages and all available tools
opt Model calls get_data
Model->>Tools: Call get_data with nullable fields
Tools->>Tools: Normalize null to defaults
Tools->>Access: Check website access
Tools->>Query: Build and run valid queries
Query-->>Model: Return rows and query errors
end
opt Model calls another tool
Model->>Tools: Call discovery, read, or mutation tool
Tools->>Access: Apply tool permission and confirmation checks
Tools-->>Model: Return tool result
end
Model-->>Agent: Return answer and token usage
Agent->>Usage: Bill the selected execution
Agent-->>User: Return or stream answer
end
Reviews (1): Last reviewed commit: "fix(ai): align conversation execution an..." | Re-trigger Greptile |
Conversational requests such as “Thanks, what is our retention?” could lose every tool through keyword filtering. MCP data calls also repeatedly supplied a preset and explicit dates together, while dashboard Balanced reasoning sent Anthropic options to the configured OpenAI model.
Use one native ToolLoopAgent setup for dashboard and shared MCP/Slack execution, derive provider options from the selected model, attribute billing to the actual model, and expose the existing analytics discovery/schema tools without keyword gating. Make optional internal MCP data inputs nullable on the wire and normalize them with Zod before the unchanged query planner. Keep strict generation; disabling it alone did not fix the observed failures. The dashboard default reasoning label now reflects provider defaults.
Validation:
Integration: rebased onto staging with the Autumn-only billing changes from #788. Server-derived included-chat access, legacy credit denial, rate limits, and usage accounting remain authoritative across dashboard, MCP, and Slack. Terra and Luna both preserve selected low/medium/high reasoning effort. The combined source passes fresh root lint, 33 type/build tasks, 27 test tasks, 52 focused native SDK tests and 11 actual API HTTP tests. A fresh configured review is requested on the final head. Broader tool exposure increases context cost; the discovery fallback from #783 is already on staging. No new database schema or investigation loop. AI-assisted implementation and review under the maintainer workflow.