Skip to content

feat: add first-class support for Tencent Hunyuan 3 (hy3)#4

Open
jatmn wants to merge 2 commits into
mainfrom
feat/hy3-support
Open

feat: add first-class support for Tencent Hunyuan 3 (hy3)#4
jatmn wants to merge 2 commits into
mainfrom
feat/hy3-support

Conversation

@jatmn

@jatmn jatmn commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Summary

Add first-class support for hy3 (Tencent Hunyuan 3) — a 295B MoE model (21B active, 256K context) with hybrid thinking and native function calling, served over the OpenAI-compatible /chat/completions API.

Catalog (configs/model-families/hy3.toml)

  • 256K context, text-only modalities, parallel tool calls disabled.
  • Reasoning levels none/low/high (medium dropped; hy3 has no medium mode); default high.
  • Codex custom (apply_patch freeform) tools coerced to functions via as_function and reconstructed on return.
  • Broad family (hy3, priority 0) plus exact entry (hy3_exact, priority 10) covering hy3, hy3:free, hicap/hy3:free, tencent/hy3, tencent/hy3:free.

Runtime translation fixes (so hy3 is fully usable)

  • Reasoning output: chat_reasoning_text now also flattens provider reasoning_details arrays (OpenRouter shape) in addition to reasoning_content/reasoning, so hy3's chain-of-thought surfaces to Codex. (Previously dropped.)
  • Reasoning input: new transform field reasoning_effort_none_value remaps Codex noneno_think (config.rs, transform_morph.rs) so the provider receives a valid reasoning mode.

Docs / tests

  • Updated README.md and docs/model-family-catalogs.md tables and transform-field docs.
  • Added tests for the catalog match/metadata, reasoning_details extraction, and the noneno_think remap.

Validation

cargo fmt --check && cargo test --locked && cargo build --locked && git diff --check — all 130 tests pass.

Follow-up

A live smoke test (per docs/live-testing.md) against the actual hy3 gateway is recommended to confirm noneno_think behaves as expected on that specific backend.

jatmn added 2 commits July 11, 2026 21:40
Add a model-family catalog for hy3 (Tencent Hunyuan 3), a 295B MoE
model with hybrid thinking and native function calling served over the
OpenAI-compatible /chat/completions API.

Catalog (configs/model-families/hy3.toml):
- 256K context, text-only modalities, parallel tool calls disabled.
- Reasoning levels none/low/high (medium dropped); default high.
- Codex custom (apply_patch) tools coerced to functions via as_function.

Runtime translation fixes so hy3 is fully usable:
- Surface hybrid thinking to Codex by flattening provider
  reasoning_details arrays in chat_reasoning_text (response_codec.rs),
  in addition to reasoning_content/reasoning.
- Add transform field reasoning_effort_none_value and remap Codex
  none -> no_think (config.rs, transform_morph.rs) so the provider
  receives a valid reasoning mode.

Docs/README updated; tests added for the catalog, reasoning_details
extraction, and the none-value remap.

Validation:
cargo fmt --check && cargo test --locked && cargo build --locked && git diff --check
Address review findings from PR #4:

- Tighten the over-broad `hunyuan*3*` pattern to `hunyuan3*` so unrelated
  Hunyuan models (e.g. hunyuan-13b) no longer inherit hy3's transform
  (none->no_think remap and custom->function coercion).
- Add `hicap/hy3` to the README and docs model-family tables.
- Document that `medium` is advertised as unsupported (Codex selects from
  none/low/high) and is forwarded unchanged if a client sends it.
- Make `chat_reasoning_text` handle a non-array `reasoning_details` (string
  or object) and extract `text`/`summary`/`reasoning` keys instead of
  silently dropping reasoning.
- Harden `custom_tool_input` reconstruction: unwrap JSON-encoded strings and
  fall back to a single string field rather than forwarding the whole JSON
  object as an invalid apply_patch payload.
- Add `#[serde(default, deny_unknown_fields)]` to catalog structs so typos
  fail config loading instead of being silently ignored.
- Add tests for pattern over-match, exact-id transform inheritance, and
  reasoning/tool-input reconstruction.

Validated with `cargo fmt --check && cargo test --locked &&
cargo build --locked && git diff --check` (136 tests pass).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant