Skip to content

feat: add minimal Kimi Code integration - #1964

Merged
PsiACE merged 3 commits into
oceanbase:masterfrom
jackie-cqz:fix/kimi-code-minimal-integration
Oct 13, 2026
Merged

PsiACE merged 3 commits into
oceanbase:masterfrom
jackie-cqz:fix/kimi-code-minimal-integration

Conversation

@jackie-cqz

@jackie-cqz jackie-cqz commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Which issue or RFC does this PR close?

Closes #1963.

Rationale for this change

Kimi Code users need a working PowerContext memory integration. This adds an experimental minimal profile through Kimi's native plugin, HTTP MCP and UserPromptSubmit hook.

What changes are included in this PR?

  • Add powercontext setup kimi-code and readonly powercontext doctor kimi-code. Setup installs from a local checkout into Kimi's managed plugin directory, preserves unrelated configuration and existing disablement, and retains the previous plugin for recovery if rollback fails.
  • Expose search_memory, remember_memory and get_artifact_revision. The plugin uses an explicitly configured existing Scope and runtime bearer-token environment variable.
  • Prepare and inject historical context, and optionally capture text prompts as Source. Automatic work has a four-second budget, continues ordinary tasks on failure, emits redacted diagnostics and does not retry writes with uncertain outcomes.
  • Keep setup and runtime endpoint validation consistent for the full IPv4 loopback range (127.0.0.0/8), and include repository-compliant license headers in the Jinja guidance templates. Regression tests cover automatic context/capture on 127.0.0.2, readonly diagnostics across the loopback range, and rejection of non-loopback plaintext endpoints.
  • Add generated routing guidance, English/Chinese documentation, capability declarations, behavior tests and opt-in real-host acceptance.

Are there any user-facing changes?

Users install the plugin from a local checkout and open a new Kimi session. One Kimi home uses one configured Scope. Explicit memory operations work without Generation; automatic memory creation requires the Server's Generation configuration and scheduler. This experimental profile does not include work handoff or expand the first-class setup wizard. No HTTP API or existing host contract changes.

How was this change tested?

  • 124 tests passed with a real Kimi Code 2.1.1 npm CLI, real PowerContext Server and SQLite; inference in this repeatable test is controlled:
    KIMI_CLI_BIN=<built main.mjs> uv run pytest tests/e2e/test_kimi_code_host.py tests/test_cli_kimi_code.py tests/test_cli_zcode.py tests/test_integration_manifest.py tests/test_guidance_installation.py tests/test_guidance_generation.py -q -p no:cacheprovider --basetemp=output/pytest-kimi-review-fix
    
  • Ten hook behavior tests passed:
    node --test integrations/kimi-code/plugins/powercontext/tests/plugin.test.mjs
    
  • Manual live acceptance on Windows with Kimi Code 2.1.1, Node 24.15.0 and the official DeepSeek OpenAI Chat Completions API (deepseek-v4-flash) passed native MCP save/exact revision read/search, real Source-to-Memory Generation with provenance, and a fresh-session final answer from injected memory without tool calls. Kimi and Server Generation both used live inference. The run used an isolated Kimi home, Scope and SQLite database.
  • Full pre-commit checks passed with SKIP=ty-check uv run --locked --no-sync prek run -a; type checking was run separately with ty check --python-platform linux and passed. Changed-file Windows type checks also passed. The default whole-repository Windows type check has existing errors involving POSIX-only APIs in unchanged code.
  • uv lock --locked, scripts/generate_integration_manifest_docs.py --check, scripts/integration_guidance_skills.py --check-generated, scripts/release_version.py --check and git diff --cached --check passed.

Other host versions/platforms, HTTPS ingress and TUI reload have not been qualified. The documentation site build was not run locally. Specs, credentials and local acceptance output are excluded from this PR.

AI usage statement

OpenAI Codex (GPT-6) assisted implementation, documentation and validation.

Copilot AI balanced review requested due to automatic review settings October 12, 2026 17:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@hidb4ai hidb4ai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed commit 38ae755. Please address the two P2 issues below before merging.

I independently exercised Kimi Code 2.1.1 on Linux with Node 24.21.0, a real PowerContext Server and isolated SQLite. A separate live qwen3.7-plus run verified native MCP save/exact revision readback/fresh-session search, Source-to-Memory generation with provenance, and a fresh-session answer from injected context without tool calls. HTTPS, TUI reload, other platforms and vector retrieval were not verified.

Comment thread integrations/kimi-code/plugins/powercontext/shared/runtime.mjs Outdated
Comment thread scripts/guidance_templates/hosts/kimi-code/SKILL.md.j2 Outdated
Copilot AI balanced review requested due to automatic review settings October 13, 2026 05:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@hidb4ai hidb4ai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@PsiACE PsiACE left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No blocking findings. The previous loopback-validation and template-license issues are resolved.

Copilot AI balanced review requested due to automatic review settings October 13, 2026 07:39

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@jackie-cqz
jackie-cqz requested review from PsiACE and hidb4ai and a balanced review from Copilot October 13, 2026 07:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@jackie-cqz
jackie-cqz requested a balanced review from Copilot October 13, 2026 08:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@PsiACE
PsiACE merged commit 8970a97 into oceanbase:master Oct 13, 2026
36 checks passed
@hidb4ai hidb4ai added the 1.4.0 v1.4.0 release tracking label Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.4.0 v1.4.0 release tracking

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add minimal Kimi Code integration

4 participants