Skip to content

CAMEL-24223: camel-jbang-mcp - Locale.ROOT cost formatting and model-specific disclaimer (follow-up) - #25167

Merged
oscerd merged 1 commit into
apache:mainfrom
oscerd:fix/CAMEL-24223-cost-estimate-locale-followup
Jul 28, 2026
Merged

CAMEL-24223: camel-jbang-mcp - Locale.ROOT cost formatting and model-specific disclaimer (follow-up)#25167
oscerd merged 1 commit into
apache:mainfrom
oscerd:fix/CAMEL-24223-cost-estimate-locale-followup

Conversation

@oscerd

@oscerd oscerd commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Motivation

Follow-up to CAMEL-24223 / #25052, which merged before these review refinements landed. Picks up the remaining points from that PR's review.

Changes

  • formatCost now uses Locale.ROOT for both branches. Previously String.format("$%.6f", cost) used the JVM default locale, so under a comma-decimal locale (e.g. French) the tool emitted $0,003000 — MCP clients that parse these strings would break. This is the substantive fix.
  • Model-specific disclaimer. The top-level disclaimer now states explicitly that token-based (LLM) components are priced as a specific model, not a provider-wide figure, and that Nova Lite / Haiku / local models (Ollama) cost far less, often ~zero — so the estimate is not misread as a real cost for those. Addresses davsclaus's concern about phantom costs for provider-agnostic components.
  • Tighter tests. shouldExtractSchemesCorrectly now uses containsExactlyInAnyOrder("file", "docling", "aws-bedrock", "aws2-s3") (catches both a false uri capture and a dropped file scheme), and shouldEstimateCostForAiPipeline pins the breakdown to exactly 3 priced components and asserts the computed aws-bedrock per-execution cost rather than only the count.

Testing

RouteCostEstimateToolsTest — 11 tests, all passing against current main.

Main-only (4.22.0), additive — no backport.

Claude Code on behalf of Andrea Cosentino (@oscerd).

🤖 Generated with Claude Code

…tighter tests

Addresses the remaining review points:

- formatCost now uses Locale.ROOT so the decimal separator is always '.'
  (a comma separator under e.g. a French locale would break MCP clients that
  parse the returned strings).
- The top-level disclaimer now states explicitly that token-based (LLM)
  components are priced as a specific model, not a provider-wide figure, and
  that Nova Lite / Haiku / local models (Ollama) cost far less, often ~zero —
  making clear these are specific-model estimates.
- shouldExtractSchemesCorrectly now uses containsExactlyInAnyOrder(file,
  docling, aws-bedrock, aws2-s3), catching both a false "uri" capture and a
  dropped "file" scheme; shouldEstimateCostForAiPipeline pins the breakdown to
  exactly 3 priced components and asserts the computed aws-bedrock per-execution
  cost rather than only the count.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Andrea Cosentino <ancosen@gmail.com>
@github-actions

Copy link
Copy Markdown
Contributor

🌟 Thank you for your contribution to the Apache Camel project! 🌟
🤖 CI automation will test this PR automatically.

🐫 Apache Camel Committers, please review the following items:

  • First-time contributors require MANUAL approval for the GitHub Actions to run
  • You can use the command /component-test (camel-)component-name1 (camel-)component-name2.. to request a test from the test bot although they are normally detected and executed by CI.
  • You can label PRs using skip-tests and test-dependents to fine-tune the checks executed by this PR.
  • Build and test logs are available in the summary page. Only Apache Camel committers have access to the summary.

⚠️ Be careful when sharing logs. Review their contents before sharing them publicly.

@github-actions github-actions Bot added the dsl label Jul 27, 2026

@gnodet gnodet left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Clean, well-targeted follow-up that addresses three review points from the predecessor PR (#25052): Locale.ROOT in formatCost prevents locale-dependent decimal separators breaking MCP clients, the disclaimer now clarifies model-specific pricing to avoid phantom-cost confusion, and test assertions are tightened to catch regressions more precisely.

Well-scoped follow-up — each change traces directly to a specific review comment on PR #25052. The expanded disclaimer text is a thoughtful balance: it gives concrete examples (Nova Lite, Haiku, Ollama) so users can calibrate, without becoming a pricing reference document.

This review was generated by an AI agent and may contain inaccuracies. Please verify all suggestions before applying.

Claude Code on behalf of Guillaume Nodet

@github-actions

Copy link
Copy Markdown
Contributor

🧪 CI tested the following changed modules:

  • dsl/camel-jbang/camel-jbang-mcp

🔬 Scalpel shadow comparison — Scalpel: 1 tested, 0 compile-only — current: 1 all tested

Maveniverse Scalpel detected 1 affected modules (current approach: 1).

Skip-tests mode would test 1 modules (1 direct + 0 downstream), skip tests for 0 (generated code, meta-modules)

Modules Scalpel would test (1)
  • camel-jbang-mcp

ℹ️ Shadow mode — Scalpel observes but does not affect test execution. Learn more

⚠️ Some tests are disabled on GitHub Actions (@DisabledIfSystemProperty(named = "ci.env.name")) and require manual verification:

  • dsl/camel-jbang/camel-jbang-mcp: 1 test(s) disabled on GitHub Actions

⚙️ View full build and test results

@oscerd
oscerd merged commit 1d9d9a5 into apache:main Jul 28, 2026
5 checks passed
@oscerd
oscerd deleted the fix/CAMEL-24223-cost-estimate-locale-followup branch July 28, 2026 07:26
@oscerd oscerd self-assigned this Jul 28, 2026
@oscerd oscerd added this to the 4.22.0 milestone Jul 28, 2026
@oscerd oscerd added the enhancement New feature or request label Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dsl enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants