get2knowio / get2knowio/airframe

Wire Kimi $web_search native tool (TOOLS_NATIVE)

Open
#17 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

## Summary

Wire Kimi's hosted `$web_search` builtin-function to the portable `Feature.TOOLS_NATIVE` surface, so `KimiRuntime` serves `NativeCapability.WEB_SEARCH` through `session(native_tools=[NativeTool.web_search()])` — matching what Claude (`WebSearch`/`WebFetch`), Copilot (`fetch_webpage`), and OpenCode (`websearch`/`webfetch`) already do.

This was deliberately deferred when wiring Copilot + OpenCode (see PR for "wire native web tools into Copilot + OpenCode adapters"). Kimi has real blockers the other adapters don't, captured below.

## Current state

`KimiRuntime.supported_native_tools()` returns `frozenset()` and `Feature.TOOLS_NATIVE` is absent from `SUPPORTED_FEATURES`. The `session()` method already accepts `native_tools=` and calls `_resolve_native_tools(...)` (which raises `UnsupportedFeatureError` while the feature is declined). `KimiSession` does not accept/store `native_tools`.

## Blockers to resolve

1. **No verified SDK channel.** `KimiSession._ensure_sdk_session` builds `Session.create(work_dir=, model=, yolo=, thinking=, mcp_configs=, skills_dir=)` — there is no visible tools / builtin-function parameter for enabling `$web_search`. The kimi-agent-sdk surface for hosted builtins needs to be discovered before this can be wired (env flag? a `Config` field? a `builtin_functions=`/`tools=` kwarg on `Session.create`?).
2. **Thinking interaction.** Kimi's `$web_search` reportedly requires thinking disabled. The translation/injection must reconcile this with the per-call `thinking=` mode (e.g. raise a clear error, or force-disable with a debug log).
3. **Not co-installable with Claude / not in `[all]`.** `kimi-agent-sdk` requires Python ≥3.12 and pins `mcp<1.17`, which conflicts with `claude-agent-sdk`'s `mcp>=1.23`. So the airframe dev env (which has Claude) can't import `kimi_agent_sdk`, and `runtime_for("kimi")` raises `ImportError` there. This means the wiring ships with **structural conformance tests only** unless run in a dedicated Kimi venv.

## Acceptance criteria

- [ ] Confirm the kimi-agent-sdk surface for enabling the hosted `$web_search` builtin.
- [ ] Add `Feature.TOOLS_NATIVE` to `KimiRuntime.SUPPORTED_FEATURES`; set `SUPPORTED_NATIVE_TOOLS = frozenset({NativeCapability.WEB_SEARCH})`; return it from `supported_native_tools()`.
- [ ] Capture the `_resolve_native_tools(...)` result in `session()` and thread it into `KimiSession`; translate `WEB_SEARCH` → `$web_search` and inject into the SDK call.
- [ ] Handle the thinking-disabled requirement explicitly.
- [ ] Structural conformance contracts pass (already re-exported in `tests/test_kimi_conformance.py`); add an SDK-mocked unit test asserting `$web_search` is enabled once the surface is known.
- [ ] Update `docs/capabilities.md` (Kimi `TOOLS_NATIVE` row), `docs/adapters/kimi.md`, and `CHANGELOG.md`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.