Skip to content

Feat/add claude adapter#457

Draft
Enjoykkk wants to merge 4 commits into
TencentCloud:mainfrom
Enjoykkk:feat/add-claude-adapter
Draft

Feat/add claude adapter#457
Enjoykkk wants to merge 4 commits into
TencentCloud:mainfrom
Enjoykkk:feat/add-claude-adapter

Conversation

@Enjoykkk

Copy link
Copy Markdown

Description | 描述

本 PR 依赖 #316,当前仅用于提前展示 Claude Code 适配方案和代码,暂不请求合并。
#316 合并到 main 后,我会重新变基当前分支、更新 PR 差异并补充 CI 验证,再申请正式 Review。

基于 #316 提供的统一 Gateway Adapter,为 Claude Code 增加 TencentDB Agent Memory 适配能力。
主要内容:

  • 新增 Claude Code UserPromptSubmit Hook,自动调用 /recall 召回记忆。
  • 新增 Claude Code Stop Hook,自动调用 /capture 保存本轮对话。
  • SessionStart 阶段调用 health() 检查 Gateway 状态。
  • SessionEnd 阶段调用 endSession() 刷新会话记忆。
  • 增加跨进程 prompt cache,传递用户输入。
  • 增加 Claude Code transcript fallback,在 prompt cache 不可用时恢复本轮对话。
  • 统一由 hooks/memory.ts 分发四类 Claude Code 生命周期事件。
  • 增加 Claude Code 插件配置和使用文档。
  • 增加 Claude Code 专用测试和 Vitest 配置。

searchMemories()searchConversations()` 应基于 #372 提供的统一 MCP Server 实现,本 PR 不重复实现 MCP Server。

Related Issue | 关联 Issue

Related to #235

Dependency | 依赖关系

本 PR 依赖 #316 提供的统一 Gateway Adapter,当前基于 feat/cross-platform-adapter-235 开发

Change Type | 修改类型

  • Bug fix | Bug 修复
  • New feature | 新功能
  • Documentation update | 文档更新
  • Code optimization | 代码优化

Self-test Checklist | 自测清单

  • Verified locally | 本地验证通过
  • No existing features affected | 无影响现有功能
  • [ ]

Verification | 验证

$ npm test
Test Files 5 passed
Tests 70 passed

$ npm run build
结果:构建成功

$ npx vitest run --config claudecode-plugin/vitest.config.ts
Test Files 2 passed
Tests 11 passed

$ git diff --check
Passed

RerankerGuo and others added 4 commits June 30, 2026 20:40
Signed-off-by: Ziyang Guo <121015044+RerankerGuo@users.noreply.github.com>
Signed-off-by: Ziyang Guo <121015044+RerankerGuo@users.noreply.github.com>
Signed-off-by: Ziyang Guo <121015044+RerankerGuo@users.noreply.github.com>
Signed-off-by: Ke Wang <1002245584@qq.com>
@Enjoykkk Enjoykkk force-pushed the feat/add-claude-adapter branch from f0279ad to ac75751 Compare July 10, 2026 07:34
@YOMXXX

YOMXXX commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Duplicate/scope cleanup triage for #235:

Thanks for marking this as a preview rather than requesting merge. As it stands, this PR still carries the #316 shared Gateway client files plus Claude Code-specific plugin/hook files, while the PR body says it depends on #316 and should be rebased after #316 lands.

Recommendation: keep this out of active merge review until #316 and #372 are resolved. After that, rebase onto main and remove any duplicated #316 Gateway client / adapter-kit changes so the diff contains only the Claude Code-specific integration layer: lifecycle hook mapping, prompt/transcript fallback, plugin metadata, docs, and focused Claude Code tests. Search tools should continue to rely on the approved MCP bridge from #372 rather than adding another search path here.

This is a scope/dependency note rather than a rejection of the Claude Code adapter work.

@Enjoykkk Enjoykkk marked this pull request as draft July 10, 2026 12:10
@Enjoykkk

Copy link
Copy Markdown
Author

感谢说明和范围建议。

当前分支是基于 #316 的feat/cross-platform-adapter-235 分支开发的。经直接比较确认当前差异仅包含 Claude Code 平台专属内容,包括生命周期 Hook 映射、prompt cache、transcript fallback、插件元数据、文档和 Claude Code 专用测试;不包含 src/adapters/gateway-client 或 adapter-kit 的重复改动。

我会按建议将该 PR 保持为 Draft,暂不进入正式合并评审流程。待 #316#372 的处理结果明确后,我会将分支 rebase 到最新 main,仅保留 Claude Code 平台专属集成层。

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.

3 participants