• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stacklok / toolhive / 20723541866 / 1
50%
main: 50%

Build:
DEFAULT BRANCH: main
Ran 05 Jan 2026 05:31PM UTC
Files 417
Run time 29s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

05 Jan 2026 05:26PM UTC coverage: 50.532% (+0.08%) from 50.457%
20723541866.1

push

github

web-flow
Automatic type coercion for composite tool template expansion (#3139)

This PR fixes issue #3113 where numeric and boolean parameters in composite tools are converted to strings during Go template expansion, causing validation failures in backend tools.

Problem
When composite tool workflows use template expansion (e.g., {{.params.issue_number}}), Go's text/template package always outputs strings. This means a parameter like issue_number: 3113 becomes the string "3113" after expansion, causing backend tools to fail validation when they expect an integer.

Solution
Introduced a new pkg/vmcp/schema package that provides automatic type coercion based on the backend tool's InputSchema. After template expansion, arguments are coerced back to their expected types (integer, number, boolean) before being sent to the backend.

We have some other logic for coercing outputs into the intended types. I attempted to refactor this, but there's enough differences (e.g. unmarshalling strings, default values) that sharing complicates the implementation. Given we don't need to touch the output code right now, I'll leave it as is for now with a note on eventually consolidating.

Changes
New Package: pkg/vmcp/schema/

schema.go - TypeCoercer interface and MakeSchema() factory
primitive.go - Coercion for string/integer/number/boolean types
object.go - Recursive coercion for nested objects
array.go - Coercion for typed array elements
Key Design Decisions:

Immutable value receivers - Schema types use value receivers since they're immutable after creation
Passthrough for unknown schemas - MakeSchema() always returns a valid TypeCoercer; callers don't need nil checks
Partial coercion - If one property fails to coerce, others still succeed; failed values retain their original type
Single declarative test - One table-driven test covers all coercion cases
Modified:

pkg/vmcp/composer/workflow_engine.go - Integrates schema coercion after template expansion
test/integration/vmcp/h... (continued)

28797 of 56988 relevant lines covered (50.53%)

59.36 hits per line

Source Files on job 20723541866.1
  • Tree
  • List 417
  • Changed 6
  • Source Changed 6
  • Coverage Changed 6
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 20723541866
  • 9f1a2230 on github
  • Prev Job for on main (#20722504093.1)
  • Next Job for on main (#20724399380.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc