Skip to content

[good first issue-platform adapt-OpenCode] Add durable TencentDB Agent Memory integration - #978

Draft
diqierjia wants to merge 1 commit into
TencentCloud:feat/server_teamfrom
diqierjia:codex/926-opencode-tool-memory
Draft

[good first issue-platform adapt-OpenCode] Add durable TencentDB Agent Memory integration#978
diqierjia wants to merge 1 commit into
TencentCloud:feat/server_teamfrom
diqierjia:codex/926-opencode-tool-memory

Conversation

@diqierjia

Copy link
Copy Markdown

Description

Adds a native OpenCode adapter for TencentDB Agent Memory with automatic L0/L1/Core/Skill recall, durable completed-turn capture, five native tools, fail-open behavior, and a source-first one-command installation flow that does not depend on an unpublished npm package.

Related Issue

Related to #926

Change Type

  • New adapter
  • Documentation
  • Tests and CI

What is covered

  • Official OpenCode tool() API and lifecycle hooks (chat.message, system transform, session.idle).
  • ISO timestamps and current Memory Gateway v3 envelopes/isolation fields.
  • Automatic cross-session L0 recall plus active conversation, atomic-memory, and Skill tools.
  • Ordered user/text/tool-call/tool-result capture, including multiple queued completed turns.
  • Durable per-pipeline outbox, cross-process filesystem claims, restart recovery, and repeated-idle deduplication.
  • Timeout, configuration validation, sensitive-data redaction, untrusted-memory boundaries, and fail-open logging.
  • English and Chinese user guides plus an OpenCode-readable self-install task.

Verification

Local deterministic checks:

npm run check       -> 9 files, 44 tests passed; typecheck and build passed
npm run e2e:local   -> nativeTools=5, capturedMessages=2,
                       repeatedIdleDeduplicated=true, crossSessionRecall=true
npm run pack:check  -> 54 files; source installer included
npm ls --depth=0    -> clean dependency tree
PowerShell parser   -> scripts/install-from-source.ps1 parsed successfully
git diff --check    -> passed

Isolated new-user acceptance on Windows:

OpenCode            1.18.18
Node.js             24.19.0
Gateway             http://127.0.0.1:18421 (isolated)
OpenCode host       http://127.0.0.1:18422 (isolated XDG config/data/state/cache)
SQLite              separate temporary data directory
Plugin load         passed after restart
L0 capture/search   passed across sessions
Automatic recall    passed in a new session without an explicit tool
L1 extraction       atomic count reached 1
L1 search           tdai_memory_search returned the extracted fact
Credential scan     0 retained occurrences
Cleanup             18421/18422 and temporary config/data removed; existing 18420 untouched

A redacted 15-second H.264 recording and sanitized logs are available for upload with the PR.

Self-test Checklist

  • Code follows repository conventions and uses the MIT license.
  • English and Chinese documentation are included.
  • Unit, contract, package, and real-host isolated acceptance checks pass.
  • No credentials or local test paths are committed.
  • Temporary test processes and data were cleaned up.

Additional Notes

The documented installation path is source-based while the package remains unpublished. Users fill one ignored Gateway .env file, then give OpenCode the checked-in self-install instruction; the installer builds the adapter, starts the local Gateway, installs the private loader, and verifies health without copying model keys into OpenCode configuration.

Signed-off-by: diqierjia <jiahongcheng61@gmail.com>
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