Parent delivery index: #715. New first-party implementation/tests/automation are handwritten seeded .om; use existing compiler, runtime and migration owners. Reconcile current heads, PRs, comments, consumer pins and recovery archives before edits. No permanent Rust/C/.osc/Python implementation or hidden third-party inference engine. Qualify affected replacements before deleting superseded active code. Preserve live service, driver state, visibility and existing hardware coordination. Exact hashes, commands, raw results, negative controls and independent final-source review are required. Hardware NOT_RUN is not PASS.
Confirmed gap
Main server.rs blob c826703f67befa6538ed655bc58f35f074d716b4 rejects nonempty tools/functions. Existing agent tool execution is a different layer. This issue owns inference protocol generation/continuation, not executing tools or bypassing agent authorization.
Dependencies
The tokenizer trust issue linked in #715 must qualify first. Reuse #642/#712/#713 and Omega #666's structured-serving scope, and preserve #310's tool-output boundary.
Acceptance
- Publish explicit model/endpoint capability discovery for tools, tool_choice and response_format. Define supported auto/none/required/named choices and parallel_tool_calls; unsupported schema/mode combinations return a named error before generation.
- Implement native bounded schema handling for supported JSON types, oneOf/anyOf/allOf, type lists and local $ref with depth/size/cycle limits. No remote reference fetch. Do not confuse parsing JSON with validation or stringify every valid object/array.
- Validate chosen tool names/arguments against offered tools, preserve text/string semantics, and define schema dialect. Reject unsupported keywords explicitly instead of pretending complete JSON Schema support.
- Maintain per-sequence parser/constraint state. If constrained decoding is offered, apply constraints before every ordinary and speculative sample; rollback rejected grammar transitions consistently with #713. If a supported request cannot speculate safely, use explicit ordinary mode.
- Produce consistent buffered and SSE responses: stable tool-call IDs/indexes, valid incremental deltas, correct finish reasons, final complete JSON and usage. Truncation/cancel does not turn an incomplete call into an executable command.
- Roundtrip assistant call -> tool result -> continuation through the real endpoint with original trust boundaries, correct template tokens and state restoration; use inert test tools.
- Test union/ref schemas, ambiguous oneOf, nested arrays/objects, escaped strings, Unicode chunk boundaries, invalid/oversized arguments, unknown names, malicious control spellings, EOS at each boundary, required/none/named modes, multiple concurrent sessions and speculative rejection.
- Compare ordinary versus speculative constrained output validity and declared sampling behavior. Provide independent schema-oracle fixtures and negative controls, then physical 27B endpoint receipts; parser-only tests are not full-model completion.