Skip to content

[Task] Harden Kimi/Moonshot protocol compatibility for tool calls #377

@Astro-Han

Description

@Astro-Han

Goal

PawWork should send Kimi/Moonshot-compatible tool-call requests in a shape their APIs accept, without changing unrelated provider behavior or adding model-specific behavior patches.

Scope

In scope:

  • Guard empty message content before provider requests where it can break Kimi/Moonshot-compatible endpoints.
  • Keep the existing Moonshot/Kimi $ref schema sanitizer behavior, including preserving root $defs / definitions.
  • Add conservative missing type normalization for Kimi/Moonshot tool schema properties.
  • Ensure Kimi-like provider/model aliases are covered by the compatibility path.
  • Add targeted regression tests in the provider transform test suite.

Out of scope:

Relevant files or context

Likely files:

  • packages/opencode/src/provider/transform.ts
  • packages/opencode/test/provider/transform.test.ts
  • packages/opencode/src/provider/pawwork-providers.ts

Context:

Verification

  • Add regression coverage for empty content handling.
  • Add regression coverage for $ref sibling cleanup while preserving root $defs / definitions.
  • Add regression coverage for missing property type normalization.
  • Add coverage that Kimi-like aliases enter the compatibility path.
  • Run the targeted provider transform test file.
  • Confirm unrelated provider paths are not changed by the new tests or implementation.

Execution mode

Agent should investigate and propose a plan first.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High priorityharnessModel harness, prompts, tool descriptions, and session mechanicstaskNarrow execution, audit, spike, migration, tracking, or upstream follow-up work

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions