Skip to content

feat(inference): add tool schema translation layer - #100

Merged
Svagtlys merged 8 commits into
developfrom
feature/tool-schema-translation-layer
Sep 23, 2026
Merged

Svagtlys merged 8 commits into
developfrom
feature/tool-schema-translation-layer

Conversation

@Svagtlys

@Svagtlys Svagtlys commented Sep 22, 2026 •

Copy link
Copy Markdown
Owner

Closes #78

Description

Translate MCP tool inventories (ToolInfo.input_schema) into OpenAI-compatible function tool definitions carried on CompletionRequest.tools, with mcp__<server>__<tool> dedupe and a reverse-routing map. Request-side only: response-side tool-call parsing lands with the agent loop.

Implementation

  • ToolDefinition model + CompletionRequest.tools field in the inference vocabulary
  • OpenAIAdapter._chat_kwargs wraps definitions into the {"type": "function", ...} wire envelope (absent when none/empty)
  • New pure octave.tools package: translate_tools() converts ServerToolInventory fleets into ProviderToolset (defs + routes), sanitizing/truncating exposed names to the OpenAI charset (^[a-zA-Z0-9_-]{1,64}$) and raising ToolNameCollisionError on collisions
  • JSON Schema bodies pass through verbatim minus $schema, deep-copied so inputs are never mutated
  • Neither octave.mcp nor octave.inference imports the other; SDK quarantine guarded by an AST hygiene test

References

  • Design doc: .agents/specs/2026-09-22-tool-schema-translation-design.md
  • Implementation plan: .agents/specs/2026-09-22-tool-schema-translation.md

Checklist

  • Tests passing (277 passed)
  • Lint clean (ruff + mypy strict)
  • Frontend builds (not applicable — no frontend changes)

@Svagtlys Svagtlys added this to the 1.0 — Initial Release milestone Sep 22, 2026
@Svagtlys Svagtlys added enhancement New feature or request area:inference Inference Engine Connector labels Sep 22, 2026
@Svagtlys Svagtlys self-assigned this Sep 22, 2026
@Svagtlys
Svagtlys marked this pull request as ready for review September 22, 2026 20:30
@Svagtlys
Svagtlys merged commit 87b5a32 into develop Sep 23, 2026
6 of 7 checks passed
@Svagtlys
Svagtlys deleted the feature/tool-schema-translation-layer branch September 23, 2026 06:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:inference Inference Engine Connector enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(inference): add tool schema translation layer

1 participant