Skip to content

feat(hooks): bridge TeamAI hooks into DeepSeek Harness - #689

Merged
jeff-r2026 merged 1 commit into
Tencent:mainfrom
dvd233:codex/fix/dsh-hook-adapter-623
Sep 23, 2026
Merged

jeff-r2026 merged 1 commit into
Tencent:mainfrom
dvd233:codex/fix/dsh-hook-adapter-623

Conversation

@dvd233

@dvd233 dvd233 commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

Fixes #623

What

  • Add a DeepSeek Harness hook adapter that reuses TeamAI's existing Claude-shaped built-in and team hook reconciliation.
  • Write the generated hook config and an official @deepseek-ai/dsh-hooks-claude-code Cordis patch under ~/.teamai/dsh/.
  • Print the exact --patch opt-in command, and clean the generated patch/config entries from teamai hooks remove and targeted uninstall.
  • Keep DSH user-scoped and avoid creating the bridge when ~/.dsh/ is not installed.

Why

DeepSeek Harness already ships the Claude hook bridge, but teamai init --agent dsh previously synced skills while silently skipping hooks and still reported that resources would auto-sync on session start. This change makes the supported integration explicit and preserves unrelated hook entries.

Validation

  • npm run typecheck — passed.
  • npm run build — passed.
  • npx vitest run src/__tests__/dsh-hooks.test.ts src/__tests__/omp-hooks.test.ts src/__tests__/opencode-hooks.test.ts — 49 passed.
  • git diff --check — passed.
  • Real Windows CLI verification in an isolated temporary HOME/repository: teamai init . --agent dsh --force generated and parsed the Claude hook JSON and Cordis patch; teamai hooks remove removed the patch; a second init followed by teamai uninstall --agent dsh --force removed the patch again.
  • The full npm test run reached 230/265 files and 3,516/3,620 tests; the 101 failures and 20 errors are existing Windows-environment assumptions involving POSIX path assertions, file modes, symlinks, and Git subprocess/socket fixtures. The new DSH suite passed 5/5.

A live DSH profile was not started because the dsh executable is not installed in this validation environment; the generated files were checked against the official bridge package contract.

@jeff-r2026 jeff-r2026 self-assigned this Sep 21, 2026
@github-actions

Copy link
Copy Markdown

Findings

  • [P1 blocking] src/dsh-hooks.ts:71 drops teamHookProjectRoot when calling the shared Claude reconciler. Because ~/.teamai/dsh/hooks.json is global, project-scoped team hooks are therefore ungated: they run outside their project, and reconciling a second project removes/replaces the first project’s entries. Forward the project root through DshHookReconcileOptions and add a two-project preservation test.
  • [P1 blocking] docs/usage-guide.md:1483 documents DSH hook support, but every README support matrix still marks DeepSeek Harness hooks unsupported (README.md:140 and all README.*.md variants). This violates the repository requirement to keep affected documentation and all README languages synchronized.
  • [P2 non-blocking] src/hooks.ts:1401 invokes DSH reconciliation unconditionally for removeAll. Since reconcileHooks() creates the config’s parent directory before determining nothing exists, teamai hooks remove creates an empty ~/.teamai/dsh/ even when ~/.dsh/ was never installed, contrary to the stated no-bridge-without-DSH behavior.

The PR description includes both a test plan and a real-CLI verification record, so no testing-description finding is required.

@jeff-r2026
jeff-r2026 merged commit 48b3dcb into Tencent:main Sep 23, 2026
10 checks passed
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.

[feat] dsh (DeepSeek Harness): no hook adapter, so init promises auto-sync that never happens

2 participants