You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(dsh): show DSH hooks as partial when a profile is missing the hooks package - #37446
Orca adds a line to DeepSeek Harness (DSH) config asking it to load a hooks package. Orca never installs that package, so DSH can't load it. Orca still said the DSH hooks were "installed", even though no DSH events were reaching it. Orca now checks each DSH profile for the package. If a profile doesn't have it, Orca says the integration isn't working and tells you how to fix it.
What Changed
Before:orca agent hooks status (and the install result) said dsh: installed whenever Orca's own files were in place. Meanwhile DSH printed failed to import: ERR_MODULE_NOT_FOUND ... @deepseek-ai/dsh-hooks-claude-code on every start, and Orca received no DSH session events.
After: once Orca's own files are complete, DshHookService also checks every $DSH_HOME/profiles/<name> that has a package.json. Each one must have both @deepseek-ai/dsh-hooks-claude-code and its peer @deepseek-ai/dsh-hook-protocol in the profile's own node_modules. If either is missing, the status is partial and the detail names each broken profile, the packages it lacks, and the pnpm add <pkg>@<dsh version> fix. If the profiles directory exists but can't be read, the status is also partial, with a detail saying so.
No profiles yet: if DSH hasn't created any profiles, the status stays installed, because there is nothing to check yet.
CLI: the text output of orca agent hooks status/on/off now prints the detail for partial and error statuses, for every agent. Before, the reason only appeared in --json.
The package name in the patch row and in the new check now comes from one shared constant.
Why
The root cause: DshHookService.getStatus decided "installed" from Orca's own patch and hook files only. It never checked whether DSH could load the package the row names.
I checked where DSH actually loads the package from, using a real DSH 0.2.1-rc.5 install in a scratch DSH_HOME:
With no packages, DSH fails on the executor.
With only the executor installed, it fails on @deepseek-ai/dsh-hook-protocol. The DSH engine ships every other peer of the executor, but not that one.
With both in the profile's node_modules, the row loads.
A copy in $DSH_HOME/node_modules does not work, because it can't reach the engine's peers.
So the check looks at exactly what DSH needs: both packages, in each profile's own node_modules.
Alternatives I didn't take:
Running dsh to probe the profile: slow, needs credentials, and the status check is synchronous.
Following Node's parent-directory lookup: it would report installed in the $DSH_HOME/node_modules case, which DSH rejects.
Having Orca install the packages itself was left out on purpose. That would mean running pnpm inside the user's DSH profiles and picking the release channel that matches the installed DSH (npm latest is the old, incompatible 0.0.1 line). That is a separate product decision.
N/A. Nothing in the app UI changes. The change shows up in orca agent hooks status output and the hook status detail. Real output against a DSH 0.2.1-rc.5 profile with no packages:
partial These DSH profiles cannot load Orca's hooks, so their sessions send no events to Orca: /tmp/dsh-repro-sta11034/home/profiles/headless (missing @deepseek-ai/dsh-hooks-claude-code, @deepseek-ai/dsh-hook-protocol). Run `pnpm add @deepseek-ai/dsh-hooks-claude-code@<dsh version> @deepseek-ai/dsh-hook-protocol@<dsh version>` in each profile directory (npm latest is an older, incompatible line).
Testing
macOS, using a real DSH install (@deepseek-ai/[email protected]) in a scratch DSH_HOME with a scratch HOME. I compared DshHookService.getStatus() with DSH's own startup warning in each package state:
New regression test in src/main/dsh/hook-service.test.ts. It fails on main and passes with the fix.
Ran the DSH tests, the dependent tests, pnpm check:code-quality:changed, pnpm check:react-doctor:changed and pnpm check:changed.
Windows was not run by hand. The paths go through path.join, and I confirmed that path.win32.join turns the scoped package name into backslash segments.
I manually tested these changes locally
Automated tests added/updated, or explained why not below
Risk
Low. Users whose DSH profiles lack the packages now see dsh: partial instead of installed. Today that is every DSH user who hasn't added the packages by hand. Nothing reads the state to retry or reinstall. The only consumers are the CLI output and the install result, and telemetry is only recorded on thrown errors. Orca writes nothing new to disk. The check is one readdirSync plus up to three existsSync calls per profile, and runs only at startup reconcile, on settings toggles and from CLI commands. Revert the PR to back it out.
Level: Low
AI Disclosure
Review
Codex and a Claude reviewer each ran one round. Codex found nothing. Claude raised three P3s, all fixed:
the detail claimed "no DSH events" even when only some profiles were broken;
an unreadable profiles directory was treated as "no profiles";
skip details made the CLI output noisy.
A simplify pass moved the check into buildStatus's installed branch.
Agent skill upstream boundary
Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.
Notes
Remote SSH and WSL:installRemote still returns installed. Its result is only logged, and nothing displays remote hook state, so a remote check would be code nobody reads.
Mobile and folder workspaces: not affected.
Security: reads only file existence under the user's own DSH_HOME, and runs no subprocess.
Waiting for blessing (new status copy, and CLI text now prints the detail for partial/error statuses for every agent). To try it from worktree /Users/kelvinamoaba/orca/workspaces/orca/dsh-hooks-missing-executor:
HOME=/tmp/dsh-try-home DSH_HOME=/tmp/dsh-try npx tsx -e "import { DshHookService } from './src/main/dsh/hook-service'; console.log(new DshHookService().install())" prints state: 'partial' with the missing packages for web
Add node_modules/@deepseek-ai/{dsh-hooks-claude-code,dsh-hook-protocol}/package.json under that profile and run it again: installed.
Checklist
This PR is small and focused
I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
I stated the risk: what could break, for whom, and how to back it out
Before/after screenshots or videos attached for UI changes, or N/A with reason
Self-reviewed for correctness, security, and performance
Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Repository UI
Review profile: CHILL
Plan: Advanced
Run ID: 5dd5c58c-a01d-435a-8615-6afd0adc2664
Commits
Reviewing files that changed from the base of the PR and between 1ce7960 and c28deec.
Files selected for processing: 5
src/cli/handlers/agent-hooks.ts
src/main/dsh/dsh-home-patch.ts
src/main/dsh/dsh-hook-packages.ts
src/main/dsh/hook-service.test.ts
src/main/dsh/hook-service.ts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
Walkthrough
The DSH hook package names are centralized, and DSH profiles are checked for the required packages. Hook status reports missing packages as partial, and the CLI formatter displays details for partial and error statuses. A test covers missing and installed package states.
Severity of issue fixed: Medium
Merge Risk: Low · up to c28de
The suggested package-install command requires users to replace its version placeholders before it will work. This is a bounded issue to fix or accept before merging.
Pre-merge checks: 4 · 1
Failed checks: 1 warning
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta…
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks: 4 passed
Check name
Status
Explanation
Title check
The title clearly and concisely describes the main change: reporting DSH hooks as partial when a profile lacks the required hooks package.
Linked Issues check
Issue #30272 requires Orca to expose the silent DSH hook failure. describeDshProfilesMissingHookPackages checks each profile with package.json for both required packages in that profile's own `nod…
Out of Scope Changes check
The changed production files all support issue #30272. They implement package validation, status propagation, shared package naming, and user-visible CLI details. The test change verifies the required…
Description check
The pull request description is complete and follows the repository template. It explains the user impact, implementation, rationale, linked issue, testing, visual proof, risks, compatibility consider…
Full details: Linked Issues check
Explanation
Issue #30272 requires Orca to expose the silent DSH hook failure. describeDshProfilesMissingHookPackages checks each profile with package.json for both required packages in that profile's own node_modules, reports missing packages or an unreadable profiles directory, and preserves installed when no profiles exist or all checks pass. DshHookService maps these findings to partial. The CLI now prints details for partial and error states. The shared executor constant keeps the patch row and validation target consistent. The added regression test covers partial and installed states. Package installation remains outside this status-detection objective.
Full details: Out of Scope Changes check
Explanation
The changed production files all support issue #30272. They implement package validation, status propagation, shared package naming, and user-visible CLI details. The test change verifies the required behavior. No unrelated product behavior or package installation change is included.
Full details: Description check
Explanation
The pull request description is complete and follows the repository template. It explains the user impact, implementation, rationale, linked issue, testing, visual proof, risks, compatibility considerations, AI review, and rollback. The standard command checklist is not fully checked, but the description documents the validation commands that were run and states that CI may cover the remaining commands.
Full details: Docstring Coverage
Explanation
Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 5 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
Finishing Touches
Generate docstrings
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
The reason will be displayed to describe this comment to others. Learn more.
Minor · Functional Correctness · Quick win
Report a non-directory profiles path as partial.
If profiles exists as a regular file, readdirSync fails with ENOTDIR. isDefinitiveAbsence classifies that error as absence, so this function returns null and DshHookService reports installed. Treat only a missing profiles path as “no profiles to check”; report ENOTDIR as a directory error. (raw.githubusercontent.com)
Node.js fs.existsSync behavior when permission denied or path is not traversable current user, applicable Node.js documentation
Result:
Sources consulted:
- File system | Node.js v26.13.0 Documentation — https://nodejs.org/api/fs.html
- node/doc/api/fs.md at main · nodejs/node · GitHub — https://github.com/nodejs/node/blob/main/doc/api/fs.md?plain=1
- Permissions | Node.js 26.13.0 Documentation — https://beta.docs.nodejs.org/permissions
- File system | Node.js v26.5.1 Documentation — https://nodejs.org/download/release/v26.5.1/docs/api/fs.html
- …and 21 more
Report inaccessible profiles as incomplete.
When a listed profile cannot be traversed, existsSync(join(profileDir, 'package.json')) treats the access failure like absence and filters the profile out. broken can then be empty, causing buildStatus to report installed without checking that profile. Distinguish definitive absence from other statSync errors and return a non-null detail for inaccessible profiles.
Suggested fix
-import { existsSync, readdirSync } from 'node:fs'+import { existsSync, readdirSync, statSync } from 'node:fs'
import { join } from 'node:path'
@@
- const broken = entries- .map((profile) => join(profilesDir, profile))- .filter((profileDir) => existsSync(join(profileDir, 'package.json')))+ const profileDirs: string[] = []+ for (const profile of entries) {+ const profileDir = join(profilesDir, profile)+ try {+ statSync(join(profileDir, 'package.json'))+ } catch (error) {+ if (isDefinitiveAbsence(error)) continue+ return `Could not read the DSH profile ${profileDir}`+ }+ profileDirs.push(profileDir)+ }+ const broken = profileDirs
.map((profileDir) => ({
profileDir,
return `These DSH profiles cannot load Orca's hooks, so their sessions send no events to Orca: ${list}. Run \`pnpm add ${install}\` in each profile directory (npm latest is an older, incompatible line).`
The displayed command is not executable as written. Copying it into sh or bash produces a shell parse error before pnpm runs. State that users must replace <dsh version> with the installed DSH version.
Suggested fix
- return `These DSH profiles cannot load Orca's hooks, so their sessions send no events to Orca: ${list}. Run \`pnpm add ${install}\` in each profile directory (npm latest is an older, incompatible line).`+ return `These DSH profiles cannot load Orca's hooks, so their sessions send no events to Orca: ${list}. Run \`pnpm add ${install}\` in each profile directory, replacing \`<dsh version>\` with the installed DSH version (npm latest is an older, incompatible line).`
Committable suggestion
IMPORTANT
Review the replacement and indentation, then test before committing.
return`These DSH profiles cannot load Orca's hooks, so their sessions send no events to Orca: ${list}. Run \`pnpm add ${install}\` in each profile directory (npm latest is an older, incompatible line).`
return`These DSH profiles cannot load Orca's hooks, so their sessions send no events to Orca: ${list}. Run \`pnpm add ${install}\` in each profile directory, replacing \`<dsh version>\` with the installed DSH version (npm latest is an older, incompatible line).`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ELI5
Orca adds a line to DeepSeek Harness (DSH) config asking it to load a hooks package. Orca never installs that package, so DSH can't load it. Orca still said the DSH hooks were "installed", even though no DSH events were reaching it. Orca now checks each DSH profile for the package. If a profile doesn't have it, Orca says the integration isn't working and tells you how to fix it.
What Changed
orca agent hooks status(and the install result) saiddsh: installedwhenever Orca's own files were in place. Meanwhile DSH printedfailed to import: ERR_MODULE_NOT_FOUND ... @deepseek-ai/dsh-hooks-claude-codeon every start, and Orca received no DSH session events.DshHookServicealso checks every$DSH_HOME/profiles/<name>that has apackage.json. Each one must have both@deepseek-ai/dsh-hooks-claude-codeand its peer@deepseek-ai/dsh-hook-protocolin the profile's ownnode_modules. If either is missing, the status ispartialand the detail names each broken profile, the packages it lacks, and thepnpm add <pkg>@<dsh version>fix. If the profiles directory exists but can't be read, the status is alsopartial, with a detail saying so.installed, because there is nothing to check yet.orca agent hooks status/on/offnow prints the detail forpartialanderrorstatuses, for every agent. Before, the reason only appeared in--json.Why
The root cause:
DshHookService.getStatusdecided "installed" from Orca's own patch and hook files only. It never checked whether DSH could load the package the row names.I checked where DSH actually loads the package from, using a real DSH 0.2.1-rc.5 install in a scratch
DSH_HOME:@deepseek-ai/dsh-hook-protocol. The DSH engine ships every other peer of the executor, but not that one.node_modules, the row loads.$DSH_HOME/node_modulesdoes not work, because it can't reach the engine's peers.So the check looks at exactly what DSH needs: both packages, in each profile's own
node_modules.Alternatives I didn't take:
dshto probe the profile: slow, needs credentials, and the status check is synchronous.installedin the$DSH_HOME/node_modulescase, which DSH rejects.Having Orca install the packages itself was left out on purpose. That would mean running pnpm inside the user's DSH profiles and picking the release channel that matches the installed DSH (npm
latestis the old, incompatible 0.0.1 line). That is a separate product decision.Linked Issue
Fixes #30272
Linear: STA-11034
Visual Proof
N/A. Nothing in the app UI changes. The change shows up in
orca agent hooks statusoutput and the hook status detail. Real output against a DSH 0.2.1-rc.5 profile with no packages:Testing
macOS, using a real DSH install (
@deepseek-ai/[email protected]) in a scratchDSH_HOMEwith a scratchHOME. I comparedDshHookService.getStatus()with DSH's own startup warning in each package state:Cannot find package '@deepseek-ai/dsh-hooks-claude-code'partial, both packages namedCannot find package '@deepseek-ai/dsh-hook-protocol'partial, protocol namedpnpm add)installedNew regression test in
src/main/dsh/hook-service.test.ts. It fails on main and passes with the fix.Ran the DSH tests, the dependent tests,
pnpm check:code-quality:changed,pnpm check:react-doctor:changedandpnpm check:changed.Windows was not run by hand. The paths go through
path.join, and I confirmed thatpath.win32.jointurns the scoped package name into backslash segments.I manually tested these changes locally
Automated tests added/updated, or explained why not below
Risk
Low. Users whose DSH profiles lack the packages now see
dsh: partialinstead ofinstalled. Today that is every DSH user who hasn't added the packages by hand. Nothing reads the state to retry or reinstall. The only consumers are the CLI output and the install result, and telemetry is only recorded on thrown errors. Orca writes nothing new to disk. The check is onereaddirSyncplus up to threeexistsSynccalls per profile, and runs only at startup reconcile, on settings toggles and from CLI commands. Revert the PR to back it out.Level: Low
AI Disclosure
Review
Codex and a Claude reviewer each ran one round. Codex found nothing. Claude raised three P3s, all fixed:
A simplify pass moved the check into
buildStatus's installed branch.Agent skill upstream boundary
Notes
Remote SSH and WSL:
installRemotestill returnsinstalled. Its result is only logged, and nothing displays remote hook state, so a remote check would be code nobody reads.Mobile and folder workspaces: not affected.
Security: reads only file existence under the user's own
DSH_HOME, and runs no subprocess.Waiting for blessing (new status copy, and CLI text now prints the detail for
partial/errorstatuses for every agent). To try it from worktree/Users/kelvinamoaba/orca/workspaces/orca/dsh-hooks-missing-executor:mkdir -p /tmp/dsh-try/profiles/web && echo '{}' > /tmp/dsh-try/profiles/web/package.jsonHOME=/tmp/dsh-try-home DSH_HOME=/tmp/dsh-try npx tsx -e "import { DshHookService } from './src/main/dsh/hook-service'; console.log(new DshHookService().install())"printsstate: 'partial'with the missing packages forwebnode_modules/@deepseek-ai/{dsh-hooks-claude-code,dsh-hook-protocol}/package.jsonunder that profile and run it again:installed.Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)