[NA] [BE] Reclassify system_tools/system_tools_deferred into the built_in_tools lane#7555
Draft
petrotiurin wants to merge 3 commits into
Draft
[NA] [BE] Reclassify system_tools/system_tools_deferred into the built_in_tools lane#7555petrotiurin wants to merge 3 commits into
petrotiurin wants to merge 3 commits into
Conversation
… lane These categories carry built-in tool schema (definition) cost, but were tagged bd_lane='static_overhead' at ingestion, landing under the "Static overhead" card in the AI-Spend breakdown instead of "Built-in tools". MCP's equivalent (mcp_tools_active) already shares bd_lane='mcp_servers' with its usage rows (tool_io), so mirror that: route these two categories to built_in_tools in lane()/bdLane(), keyed by tool_name (falling back to "(unattributed)" for the blank-tool_name deferred-tools reminder block) instead of the bare category string. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Contributor
⏱️ pre-commit per-hook timing
⏭️ 40 skipped (no matching files changed)
|
… regression - bdLane() now delegates to lane() for the shared dispatch table and only overrides the two intentional differences (mcp_tools_deferred/ mcp_server_instructions excluded; "unattributed" collapses to ""), so a future category addition can't update one table and forget the other. - Extend the new ingestion test with system_prompt/env_info blocks, asserting their lane()/bdLane() still resolve to static_overhead — a regression guard for the dispatch-table refactor, since the prior test only covered the two reclassified categories. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Contributor
Backend Tests - Integration Group 15 37 files - 1 37 suites - 1 2m 10s ⏱️ +10s Results for commit 9207790. ± Comparison against base commit f570882. This pull request removes 64 and adds 44 tests. Note that renamed tests count towards both.♻️ This comment has been updated with latest results. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Details
Built-in tool schema (definition) cost —
system_tools/system_tools_deferred— was taggedbd_lane='static_overhead'at ingestion, so it showed up under "Static overhead" in the AI-Spend breakdown instead of "Built-in tools". MCP's equivalent (mcp_tools_active) already sharesbd_lane='mcp_servers'with its usage rows (tool_io), needing zero special-case reporting code downstream. This mirrors that:lane()/bdLane()now route these two categories tobuilt_in_tools, andlabel()keys them bytool_name(falling back to"(unattributed)"for the blank-tool_name deferred-tools reminder block) instead of the bare category string — same astool_io.isDefinition()is unchanged (both categories stay1).Also dedupes
lane()/bdLane()'s near-identical category dispatch tables per review feedback:bdLane()now delegates tolane()and only overrides the two intentional differences (mcp_tools_deferred/mcp_server_instructionsexcluded from the breakdown;"unattributed"collapses to""), so a future category addition can't update one table and forget the other.Companion PRs:
ai-cost-backend(comet-ml/ai-cost-backend#33) removes the now-redundant display-only overlay that this made obsolete;opik-plugin-ai-spend(comet-ml/opik-plugin-ai-spend#42) updates the matching lane description text.Note: this only affects newly-ingested rows going forward. Existing
cipx_spend_blocksrows keep their historicalbd_lane='static_overhead'tag (no backfill included in this change).Change checklist
Issues
AI-WATERMARK
AI-WATERMARK: yes
Testing
CostIntelligenceIngestionTest.systemToolsLandInBuiltInToolsLanecovers a named-tool schema block, the blank-tool_name deferred-tools reminder block, and (regression guard) thatsystem_prompt/env_infostill resolve tostatic_overheadafter the dispatch-table dedup.Documentation
No documentation changes needed — this is an internal cost-attribution fix with no user-facing API/behavior change beyond which AI-Spend card the cost appears under.