Skip to content

feat(agent-hook-plugin): add the Qoder CLI host - #7580

Open
t0saki wants to merge 11 commits into
volcengine:mainfrom
t0saki:feat/qoder-cli-host
Open

t0saki wants to merge 11 commits into
volcengine:mainfrom
t0saki:feat/qoder-cli-host

Conversation

@t0saki

@t0saki t0saki commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Add Qoder CLI as a host of examples/agent-hook-plugin, following the CodeBuddy Code precedent. Qoder CLI loads native plugins in the Claude Code layout (.qoder-plugin/plugin.json, wrapped hooks/hooks.json, .mcp.json, skills/) and passes Claude Code-style hook payloads, so the integration is a host adapter, a transcript decoder and an installer path; recall, capture, the offline queue, credentials and the MCP proxy all come from examples/memory-plugin-shared/lib.

What a Qoder session gets:

  • SessionStart / UserPromptSubmit: profile and recall injected through hookSpecificOutput.additionalContext, verified to reach the model on Qoder CLI 1.1.88.
  • Stop / PreCompact / SessionEnd: incremental capture from the JSONL transcript into a qd-<session_id> session, committed by the same policy as CodeBuddy (threshold, before compaction, at session end).
  • PreToolUse: viking:// paths denied on file tools, with an mcp_call hint, since Qoder exposes plugin MCP tools lazily.
  • MCP + skills: the OpenViking MCP proxy and the four shared skills ship inside the plugin.

The installer path is --harness qoder: it assembles a self-contained plugin, registers it as a local marketplace and installs it with qodercli plugins install. An openviking marketplace added from GitHub to run the Claude Code plugin in Qoder (the workaround in #7569) is replaced, so the two never capture the same session twice. Every Qoder CLI build on PATH gets the plugin: qodercli in ~/.qoder and the CN build qoderclicn in ~/.qoder-cn; uninstall removes it from both.

Human Involvement

  • A human participated in the implementation or review loop
  • This PR was generated entirely by AI agents without human participation in the loop

Related Issue

Closes #7569

Supersedes the settings.json-merge approach of the draft #5752, which had no real-host run; this PR uses Qoder's native plugin system instead. Related: #6883 documents installing the Claude Code plugin into Qoder.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test update

Changes Made

  • refactor(agent-hook-plugin): move the JSONL parsing, unseen-turn cursor, tool-part rendering and capture commit policy from the CodeBuddy adapter into hosts/incremental-turn-capture.mjs, which the installer already keeps for every host; CodeBuddy keeps its exported names, no behaviour change.
  • feat(memory-plugin-shared): qoder harness key in HARNESS_KEYS (and the synced copies), qd- prefix for history import, skill sync targets.
  • feat(agent-hook-plugin): hosts/qoder.mjs (stages, envelope, guard, capture/commit), hosts/qoder-turns.mjs (transcript decoder), hosts/qoder/ (manifest, hooks, MCP config, skills, DESIGN.md with the host contract measured against qodercli 1.1.88), tests on sanitized real transcripts.
  • feat(installer): --harness qoder install / validate / uninstall (including the cached copy Qoder leaves behind), QODER_CONFIG_DIR; CodeBuddy and Qoder now share the local-marketplace install/validate/uninstall helpers; release channel lists gain qoder.
  • feat(installer) + fix(installer): the CN build via qoderclicn and ~/.qoder-cn / QODERCN_CONFIG_DIR; install, validate and uninstall run against every Qoder build on PATH, from one assembled marketplace.
  • docs: CodeBuddy Code and Qoder CLI get their own pages under Coding tools (20-codebuddy.md, 21-qoder.md, en/zh) instead of sections in Community Plugins, in the Cursor/TRAE page layout; overview rows, sidebar, {harness} enum and capability reference updated.
  • chore(plugins): patch bumps for every plugin the version gate requires; the Qoder manifest joins the PAIRED list.

Decoder rules: only human user records and assistant records count; per-block assistant records of one responseGroupId fold into one turn together with the tool results answering them; thinking is dropped; attachment records (including our own injected hook_output), sidechain and compact-summary records are skipped. Each -p run also ends an auxiliary session that has no transcript; its SessionEnd is a no-op.

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested this on the following platforms:
    • Linux
    • macOS
    • Windows

Unit and installer tests:

  • node --test examples/agent-hook-plugin/tests/*.test.mjs: 144 pass (30 new).
  • install-agent-hooks, plugin-config, import-history, release-marketplace: all pass, including the Qoder, Qoder CN-only and both-builds installer cases.
  • check-plugin-version-bumps.sh origin/main: all 7 plugins ok. bash -n install.sh, npm run check:docs, npm run test:theme (69 pass), npm run docs:build and check-built-anchors.py (21,130 links and anchors across 305 pages): pass.
  • install-tui.test.mjs has 5 failures that reproduce on a clean main worktree on the test machine (it auto-detects locally installed TRAE / DeepSeek Harness apps); unrelated to this change.

Real host, Qoder CLI 1.1.88 on macOS, model through Qoder's custom OpenAI-compatible provider, against an OpenViking Cloud instance:

  1. install.sh --harness qoder → qodercli plugins list shows openviking-memory@openviking v0.5.32 enabled.
  2. qodercli -p session: UserPromptSubmit recall assembled 8 entries and injected them; the MCP tools were listed to the model (a headless -p run with the default permission mode asks before calling them).
  3. Stop captured the user and assistant turns; the server shows the qd- session with total messages 2, commits 1; the auxiliary session's SessionEnd logged capture_unreadable and made no request.
  4. install.sh --uninstall --harness qoder removed the plugin, the local marketplace, Qoder's cached copy and the integration directory.

Checklist

  • My code follows the project's coding style
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Screenshots (if applicable)

Not applicable.

Additional Notes

  • Not exercised on a real host: the CN build qoderclicn (its handling is read from the shared Qoder bundle, where plugin layout and QODER_PLUGIN_ROOT are brand-independent), Linux and Windows, compaction in a long interactive session, and a model following the URI-guard deny into a successful mcp_call. hosts/qoder/DESIGN.md marks each claim as verified, documented or pending.
  • The Qoder IDE / JetBrains plugin uses a different hook system and is out of scope.

…ipt hosts

Move the JSONL parsing, unseen-turn cursor, tool-part text rendering and
the capture commit policy out of the CodeBuddy adapter into
hosts/incremental-turn-capture.mjs, which the installer already keeps for
every host, so a second Claude-Code-style host can reuse them instead of
copying them. CodeBuddy keeps its exported names as thin wrappers; no
behaviour change.
Accept a plugin.qoder section in ov.conf, give history import the qd-
session prefix, and sync the shared skills into the Qoder host.
Qoder CLI loads native plugins in the Claude Code layout (.qoder-plugin
manifest, wrapped hooks/hooks.json, .mcp.json, skills) and passes
CC-style hook payloads, so the adapter is a stages map plus an envelope:
SessionStart and UserPromptSubmit inject through
hookSpecificOutput.additionalContext, Stop/PreCompact/SessionEnd capture
from the JSONL transcript, and PreToolUse denies viking:// paths on file
tools with an mcp_call hint, since Qoder exposes plugin MCP tools lazily.

qoder-turns.mjs decodes the transcript: only human user records and
assistant records count, per-block assistant records of one
responseGroupId fold into one turn with the tool results answering them,
and attachments (including our own injected context), sidechain and
compact-summary records are skipped. A SessionEnd for an auxiliary
session with no transcript is a no-op.

hosts/qoder/DESIGN.md records the host contract measured against
qodercli 1.1.88. The decoder tests run on sanitized real transcripts.
--harness qoder assembles a self-contained plugin under
~/.openviking/agent-integrations/qoder, registers it as a local
marketplace and installs it with qodercli; uninstall removes the plugin,
the marketplace and the cached copy Qoder leaves behind. QODER_CONFIG_DIR
is honoured. The CodeBuddy and Qoder local-marketplace steps now share
install/validate/uninstall helpers instead of two copies. The release
channel lists gain the qoder harness.
Add a Qoder CLI section to Community Plugins in both languages, the
overview row, the {harness} value in the client configuration reference
and the capability reference rows.
The agent-hook plugin and the shared library changed, so every plugin
takes a patch bump as the version gate requires, and the Qoder manifest
joins the PAIRED list.
The same Qoder bundle ships a CN build as qoderclicn with its own config
root (~/.qoder-cn, QODERCN_CONFIG_DIR); plugin layout, hook payloads and
QODER_PLUGIN_ROOT are brand-independent. When only qoderclicn is on PATH,
the installer drives it and cleans its cache instead of ~/.qoder's.
Both are installed by the unified installer as native plugins on the
shared agent-hook runtime, like Cursor and TRAE, so they move out of
Community Plugins into numbered pages under Coding tools, with the same
install / verify / how it works / uninstall / troubleshooting layout.
The overview, sidebar and capability reference link to the new pages.
@t0saki
t0saki marked this pull request as ready for review November 13, 2026 10:20
Copilot AI balanced review requested due to automatic review settings November 13, 2026 10:20
Choosing qoderclicn only when qodercli was absent silently skipped the CN
build on machines with both, and left a CN install behind after
uninstall. Install, validate and uninstall now run against each Qoder
CLI on PATH with its own config root, from one assembled marketplace.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

A session-lock timeout can silently skip the terminal callback during normal exit, leaving captured messages uncommitted and blocking memory extraction until a later commit.

1 open issue
2 files not reviewed
  • examples/dsh-memory-plugin/package-lock.json: Generated file
  • examples/pi-coding-agent-extension/package-lock.json: Generated file
What changed in this PR

Adds Qoder CLI as a native host of agent-hook-plugin, reusing OpenViking’s shared memory runtime rather than requiring the Claude Code plugin workaround.

Changes:

  • Adds Qoder lifecycle hooks, transcript decoding, URI protection, an MCP proxy configuration, and four bundled skills.
  • Extends installation and distribution for Qoder, including CN CLI detection, and shares capture helpers with CodeBuddy.
  • Adds transcript fixtures and integration tests, dedicated English/Chinese documentation, and required plugin version bumps.
File Description
examples/​pi-coding-agent-extension/​package.json Bumps the plugin version.
examples/​pi-coding-agent-extension/​package-lock.json Aligns lockfile version metadata.
examples/​opencode-plugin/​package.json Bumps the plugin version.
examples/​memory-plugin-shared/​sync.mjs Adds Qoder skill synchronization targets.
examples/​memory-plugin-shared/​release-marketplace.test.mjs Includes Qoder in release-channel assertions.
examples/​memory-plugin-shared/​README.md Documents Qoder history-import support.
examples/​memory-plugin-shared/​plugin-config.test.mjs Tests Qoder configuration loading.
examples/​memory-plugin-shared/​lib/​config-schema.mjs Registers the Qoder harness key.
examples/​memory-plugin-shared/​install-tui.test.mjs Initializes Qoder selection state.
examples/​memory-plugin-shared/​install-agent-hooks.test.mjs Tests Qoder installation, cleanup, and CN support.
examples/​memory-plugin-shared/​import-history.test.mjs Checks Qoder session and peer mapping.
examples/​memory-plugin-shared/​import-history.mjs Adds Qoder aliases and qd- session IDs.
examples/​magpie-memory-plugin/​README.md Updates the unpublished version notice.
examples/​magpie-memory-plugin/​README_CN.md Updates the Chinese version notice.
examples/​magpie-memory-plugin/​package.json Bumps the plugin version.
examples/​dsh-memory-plugin/​package.json Bumps the plugin version.
examples/​dsh-memory-plugin/​package-lock.json Aligns lockfile version metadata.
examples/​codex-memory-plugin/​scripts/​shared/​config-schema.mjs Synchronizes the Qoder harness key.
examples/​codex-memory-plugin/​.codex-plugin/​plugin.json Bumps the plugin version.
examples/​claude-code-memory-plugin/​scripts/​shared/​config-schema.mjs Synchronizes the Qoder harness key.
examples/​claude-code-memory-plugin/​package.json Bumps the plugin version.
examples/​claude-code-memory-plugin/​.claude-plugin/​plugin.json Aligns the native manifest version.
examples/​agent-hook-plugin/​tests/​request-budget.test.mjs Checks CodeBuddy and Qoder hook budgets.
examples/​agent-hook-plugin/​tests/​qoder.test.mjs Tests guards, envelopes, capture, and commits.
examples/​agent-hook-plugin/​tests/​qoder-turns.test.mjs Tests transcript filtering and incremental cursors.
examples/​agent-hook-plugin/​tests/​fixtures/​qoder/​transcript-tooluse.jsonl Adds a tool-use transcript fixture.
examples/​agent-hook-plugin/​tests/​fixtures/​qoder/​transcript-subagent-skill.jsonl Adds skill and delegation transcript coverage.
examples/​agent-hook-plugin/​tests/​fixtures/​qoder/​transcript-compact.jsonl Adds a compaction transcript fixture.
examples/​agent-hook-plugin/​tests/​fixtures/​qoder/​subagent-explore.jsonl Adds a sidechain-filtering fixture.
examples/​agent-hook-plugin/​README.md Lists Qoder as a supported host.
examples/​agent-hook-plugin/​README_CN.md Adds Chinese Qoder setup guidance.
examples/​agent-hook-plugin/​plugin.json Updates the version and supported-host description.
examples/​agent-hook-plugin/​hosts/​zcode/​openviking.integration.json Aligns the integration version.
examples/​agent-hook-plugin/​hosts/​trae/​openviking.integration.json Aligns the integration version.
examples/​agent-hook-plugin/​hosts/​qoder/​skills/​ov-experience-memory/​SKILL.md Bundles the shared Experience memory skill.
examples/​agent-hook-plugin/​hosts/​qoder/​skills/​openviking-skills/​SKILL.md Bundles shared skill-management guidance.
examples/​agent-hook-plugin/​hosts/​qoder/​skills/​openviking-rule-search/​SKILL.md Bundles the shared Rule Search skill.
examples/​agent-hook-plugin/​hosts/​qoder/​skills/​openviking-memory/​SKILL.md Bundles shared memory-use guidance.
examples/​agent-hook-plugin/​hosts/​qoder/​runtime-index.mjs Exports the Qoder-only runtime registry.
examples/​agent-hook-plugin/​hosts/​qoder/​plugin.json Defines the native Qoder plugin manifest.
examples/​agent-hook-plugin/​hosts/​qoder/​hooks.json Registers six lifecycle and guard hooks.
examples/​agent-hook-plugin/​hosts/​qoder/​DESIGN.md Records measured host behavior and limitations.
examples/​agent-hook-plugin/​hosts/​qoder/​.mcp.json Configures the shared MCP proxy for Qoder.
examples/​agent-hook-plugin/​hosts/​qoder.mjs Implements Qoder event handling and capture policy.
examples/​agent-hook-plugin/​hosts/​qoder-turns.mjs Decodes Qoder transcripts into incremental turns.
examples/​agent-hook-plugin/​hosts/​kimicode/​openviking.integration.json Aligns the integration version.
examples/​agent-hook-plugin/​hosts/​kimicode/​kimi.plugin.json Aligns the native plugin version.
examples/​agent-hook-plugin/​hosts/​index.mjs Registers the Qoder adapter.
examples/​agent-hook-plugin/​hosts/​incremental-turn-capture.mjs Shares parsing, cursor, rendering, and commit helpers.
examples/​agent-hook-plugin/​hosts/​cursor/​openviking.integration.json Aligns the integration version.
examples/​agent-hook-plugin/​hosts/​codebuddy/​plugin.json Aligns the native plugin version.
examples/​agent-hook-plugin/​hosts/​codebuddy.mjs Reuses the shared commit policy.
examples/​agent-hook-plugin/​hosts/​codebuddy-turns.mjs Reuses shared transcript and rendering helpers.
docs/​zh/​configuration/​02-client.md Adds Qoder to harness-template documentation.
docs/​zh/​agent-integrations/​21-qoder.md Adds the Chinese Qoder integration guide.
docs/​zh/​agent-integrations/​20-codebuddy.md Adds a dedicated Chinese CodeBuddy guide.
docs/​zh/​agent-integrations/​16-capability-reference.md Documents Qoder capabilities and updates CodeBuddy details.
docs/​zh/​agent-integrations/​08-community-plugins.md Removes the relocated CodeBuddy section.
docs/​zh/​agent-integrations/​01-overview.md Links dedicated Qoder and CodeBuddy guides.
docs/​en/​configuration/​02-client.md Adds Qoder to harness-template documentation.
docs/​en/​agent-integrations/​21-qoder.md Adds the English Qoder integration guide.
docs/​en/​agent-integrations/​20-codebuddy.md Adds a dedicated English CodeBuddy guide.
docs/​en/​agent-integrations/​16-capability-reference.md Documents Qoder capabilities and updates CodeBuddy details.
docs/​en/​agent-integrations/​08-community-plugins.md Removes the relocated CodeBuddy section.
docs/​en/​agent-integrations/​01-overview.md Links dedicated Qoder and CodeBuddy guides.
docs/​.vitepress/​theme/​docs-sections.ts Adds both guides to documentation navigation.
.github/​scripts/​generate-channels-json.sh Publishes Qoder release-channel metadata.
.github/​scripts/​check-plugin-version-bumps.sh Checks Qoder manifest version alignment.
.github/​scripts/​build-plugin-downloads.sh Includes Qoder in downloadable release channels.

Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

[Feature]: Support qoder

2 participants