Repository navigation
feat(setup): register DeepSeek Harness through setup, doctor and uninstall - #1929
Conversation
…stall DeepSeek Harness registers MCP clients through a Cordis YAML patch sequence in the home patch rather than a server table, so setup could not configure it and users had to append the documented entry by hand. Add a dsh client: the home patch $DSH_HOME/cordis.patch.yml (~/.dsh/cordis.patch.yml when unset) is parsed as a patch list, the REA entry owns the stable rea-mcp id, and setup appends or replaces exactly that entry while preserving unrelated patches and comments in place. Doctor reports the registration through the same entry, and uninstall removes it, dropping insert operations it emptied. Skill destinations follow ~/.agents/skills ($DSH_AGENTS_HOME/skills when configured), the home the rest of the client machinery already uses. Fixes morluto#1839
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9a8ff02678
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
baron
left a comment
There was a problem hiding this comment.
Source verdict: REQUEST_CHANGES for three independently reproduced P2 defects in the DSH configuration boundary (inline below). Reviewed the complete seven-file diff and setup/doctor/uninstall, registration identity/environment, path/skill, and native-verifier consumers. Existing discussion was treated only as leads.
Pinned checkout: /private/tmp/rea-pr1929-review.BL3dcN; detached HEAD 9a8ff02678f8650ea18b48b5602f68beffa0a5d0; current base 0485cd3bce29c977bae05a4fdce5436f3e3d7913; merge base dfe31172ca0a090be3f40bc134f54d69c08e31d8. Full git status --porcelain=v1 output is empty. Primary checkout remained clean at the same base SHA.
Validation on isolated Node 24.18.0 / npm 11.16.0: locked npm ci; focused DSH and existing client lifecycle suites PASS (52/52); npm run typecheck PASS; touched-code oxlint PASS with existing complexity/size warnings; touched-code oxfmt PASS; test discovery PASS (862 files); diff whitespace check PASS. Public CLI scratch-home runs confirmed dry-run non-mutation, exact backup, env loss, disabled false-health/no-op setup, and uninstall. Production-boundary cases confirmed provider-map loss and relocation; upstream pinned pure patch function confirmed resulting order/scope semantics.
Unrun: real installed DSH/native-client MCP invocation (no dsh executable present), Windows/Linux native runs, real analysis providers/live model, package verification/pack, docs check and full PR gate. Upstream source/pure-function checks are not real-provider verification.
Independent hosted/integration snapshot: PR OPEN, MERGEABLE, mergeStateStatus BLOCKED; Static checks FAILED and several jobs queued/in progress. These are not counted as source defects; failure logs were unavailable while the overall run remained active. No merge, source edit, commit, push, label creation, draft/state change, or other PR mutation performed.
…rations Address review: the DSH entry discarded discovered provider overrides; config.env is now emitted and retained like the other dialects. An entry carrying the rea-mcp id under a wrong or missing package name, or duplicated entries, reads back as absent so setup rewrites exactly one canonical entry instead of reporting unchanged. Doctor now requires serverName rea and stdio transport before calling a DSH registration aligned, and the Harness skill identifier in the docs matches the installed reverse-engineer-anything skill.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2f422bb7ca
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Address review: a later direct { id, config } operation replaces the
row's config under the native patch DSL, so the registration view now
applies patches in order instead of only reading insert operations;
doctor reports the effective command rather than the inserted one.
Setup rewrites exactly one canonical entry: duplicate id-matching rows
collapse to the first, direct patches to the entry are dropped from the
document and from the edited YAML, and uninstall removes them with the
entry. The client-location test fixture now clears DSH_HOME and
DSH_AGENTS_HOME so a developer environment cannot point the suite at
real Harness homes.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 304df1a0a7
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…y state Serialize now edits the first insertion carrying rea-mcp in place, so a grouped entry keeps its scope, neighbors, and comments instead of moving to a fresh root-level insertion, and later carrying insertions and direct patches collapse away. Entry-level disabled state projects into the registration the doctor and setup compare, so a disabled row reads as stale and the repair re-enables it. A direct-only registration no longer suppresses the canonical insert append, and an update retains the registration environment. Duplicate entries collapse across operations, not only within one.
|
Thanks for the thorough review and the reproductions against the built CLI. All three findings are addressed: the first landed in 2f422bb, and the remaining gaps are fixed in 302d8ca with new boundary coverage in
One deliberate policy to flag: a repair re-enables the row by dropping the entry-level disabled flag, on the grounds that REA owns this row's activation. If you would rather setup refuse to touch a disabled row and require an explicit enable decision, say the word and I will switch it. Verification on top of your harness notes: full filesystem boundary suite on Linux (1260 passed, 47 skipped), typecheck, oxlint, and oxfmt clean. |
|
Codex, your direct-only append finding is fixed in 302d8ca: dropping a direct |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 302d8caf0d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…epairs A wrong-package row still reads back as a server record carrying its environment and caller fields, projected with a package marker the alignment path treats as stale, instead of vanishing and dropping config.env from the repair. A direct Cordis patch without a preceding insertion configures nothing, so a direct-only registration reads as absent even when its config matches and the repair appends the insert. Caller-owned config fields beyond the REA-owned keys, such as the cwd the native verifier sets, survive a refresh instead of being silently dropped.
|
All three findings are fixed in ba1ada2, each with a boundary test.
Verified on Linux: full filesystem boundary suite (1261 passed, 47 skipped) plus typecheck, oxlint, and oxfmt. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ba1ada202b
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
A refresh rebuilt Harness config from parsed values, so a caller !!js expression was written back as a literal. Owned keys are now overlaid on the winning config node and other nodes stay in place. Two already-aligned rea-mcp insertions read as stale, so setup collapses them to one row, and the bundled skill lists dsh with the other clients.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c3a93b66b9
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Knip reports DshConfigurationFormat as an unused export. The format union does not depend on that alias.
A refresh replaced the whole env map, so a caller !!js value was written back as a literal. Environment entries now stay in place unless the value changed. A comment-only cordis.patch.yml parses as an empty patch list and keeps those comments when the registration is appended. Docs describe plain rea uninstall, which scans supported clients and has no --client flag.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 078860fbe5
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Uninstall removes a rea-mcp row even when the launcher is stale or the patch never established a server record. A non-boolean disabled value, including a Cordis expression, reads as stale. Expression text on a known environment setting is not validated as a literal path, so a refresh can keep the tag.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: be257fce76
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
An anchored insert followed by an alias parses as two rea-mcp rows, but the YAML edit kept the alias, so readback stayed duplicated and setup restored the file. Aliases that resolve to the owned entry are now dropped, including an alias of the entry inside one insert. Aliases of other patches stay.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f6a10a6a85
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
An insert value that aliases another entry list still loaded a second rea-mcp row after the operation-level alias collapse. That alias is now dropped once the anchored list is rewritten. A config: *cfg map is resolved and cloned before the refresh, so a caller !!js field on the aliased map is not rewritten as a plain literal.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9ec51ab4bf
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
An insert alias whose anchor is not another insert is copied so unrelated rows stay while the owned row is rewritten. An aliased entry id is resolved before ownership checks, and an environment alias of an unchanged !!js scalar is left in place.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3e5ba53efb
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
An env alias is cloned before a refresh so tagged values are not rebuilt as literals, and expression-key scans follow aliases before path checks. Insert aliases that carry REA are recorded before uninstall empties their anchor, so the later alias is dropped instead of dangling.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0e86a88b36
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Winning-config walks resolve a root alias before patch order, so a replayed direct config's !!js env is not validated as a literal path. Root aliases that own rea-mcp are recorded before uninstall empties their anchor. An insert whose only owned member is an external alias is cloned so Cordis tags survive. Docs state dsh is not in npm 6.4.0.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c57c0f4037
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
A root alias whose anchor is not a loaded operation is copied and only the owned row is edited, so unrelated rows stay active. Entry id aliases become a scalar before their anchor patch is dropped. Root-alias ownership follows insert-list aliases, so a replay is removed instead of dangling after uninstall.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4b3c0d65c1
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 215f700548
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 19afb0c6cf
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d8ec70069e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 533bce20c7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8d63bbd05f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| : []; | ||
| const direct = !isSeq(inserted) && targetId === DSH_ENTRY_ID; | ||
| if (ownedRows.length > 0 && targetId) | ||
| throw new ConfigurationError( | ||
| "Cannot establish the target group for a Cordis REA insertion from the home patch alone", |
There was a problem hiding this comment.
Keep group-owned rows available to uninstall
When cordis.patch.yml uses a valid group-targeted operation such as id: tools with an insert row whose ID is rea-mcp, this throw aborts parseClientConfiguration before carriesEntry is available. The plain rea uninstall path therefore reports the DSH config as invalid and leaves the known-owned row in place, even though setup's inability to establish whether the group is active does not make removing that stable-ID row unsafe; retain the ownership facts and reject the operation only from the setup/editability path.
AGENTS.md reference: AGENTS.md:L19-L19
Useful? React with 👍 / 👎.
| const ownedRows = isSeq(inserted) | ||
| ? inserted.items.flatMap((entry, index) => | ||
| this.#id(entry) === DSH_ENTRY_ID ? [index] : [], | ||
| ) |
There was a problem hiding this comment.
Reject expression-backed inserts as unknown
When a Cordis patch uses insert: !!js ... (or a !!js entry inside a literal insert) and Harness evaluates it to a row with id: rea-mcp, this non-sequence fallback records ownedRows as empty rather than unknown. Setup then appends a second literal row and passes readback using only that row, while plain uninstall can skip the dynamic registration or remove only the added literal; reject expression-backed structural values instead of treating them as foreign or absent.
AGENTS.md reference: AGENTS.md:L19-L19
Useful? React with 👍 / 👎.
Summary
Fixes #1839.
rea setup --client dsh,rea doctor --client dshandrea uninstall --client dshnow manage the DeepSeek Harness registration. Until now REA documented the manual Cordis YAML patch but could not configure, diagnose or remove it.Problem and expected behavior
Harness registers MCP clients through a Cordis YAML patch sequence in the home patch, not a
mcpServerstable, so none of the existing client formats applied. The issue asks for the standard setup and doctor workflow: register without hand-editing, diagnose aligned/stale registrations, and maintain or remove the registration without touching unrelated entries.Change and scope
dshclient in the supported registry. The configuration file is the home patch$DSH_HOME/cordis.patch.yml(~/.dsh/cordis.patch.ymlwhen unset); the home patch applies to every Harness profile, so no per-profile edit is needed. Skill destinations follow~/.agents/skills($DSH_AGENTS_HOME/skillswhen configured), matching the existing shared skill home.DshCordisPatchowns the format: the patch list is parsed as a YAML operation sequence, REA owns exactly one stable entry id (rea-mcp), setup appends or replaces that entry, and serialization edits the existing YAML document in place so user comments and unrelated patches survive an update. Uninstall removes the entry and drops insert operations it emptied.id: rea-mcp,name: "@deepseek-ai/dsh-mcp-client",config: { serverName: rea, transport: stdio, command, args }.docs/installation.mdgains the table row and replaces the manual-append instructions with the setup workflow.No MCP server, catalog or provider behavior changes.
Verification
Locally verified on Windows against the installed DeepSeek Harness 0.2.0-rc.2; fork PRs currently receive no CI check runs in this repository, so results below are from this machine:
setup --client dsh --yesinto an isolatedDSH_HOMEthat already held a user patch with comments appended therea-mcpinsert with the absolutenode.exeandrea.mjspaths, preserving the user patch and its comment verbatim;doctor --client dsh --jsonreportsregistration:dsh ok:true classification:healthy;dsh --profile headlesswith that home loads the patch and spawns the REA MCP client without complaint (the run stops at the model stage withMISSING_CREDENTIAL, expected without a configured API key, and a seeded unrelatedother-serverentry produced the only spawn error, proving the user's patches still apply).vitestboundary suitedshClientConfiguration.test.ts: path resolution withDSH_HOME/DSH_AGENTS_HOME, append-with-preservation, idempotent rerun (unchanged), doctoraligned, uninstall restores the user patch, stale-entry replacement without duplication, absent-file creation and empty-on-uninstall.clientLifecycledetection updated for the new client.tsc --noEmitclean,oxlint/oxfmtclean on the touched files,npm run docs:checkpasses.clientLifecyclefailures on this Windows host are pre-existing onmain(verified by stashing the change) and unrelated.