Skip to content

fix(dsh): preserve config and forward daemon credentials - #1606

Merged
rohitg00 merged 2 commits into
mainfrom
fix/integration-runtime-e2e-20261023
Oct 23, 2026
Merged

rohitg00 merged 2 commits into
mainfrom
fix/integration-runtime-e2e-20261023

Conversation

@rohitg00

@rohitg00 rohitg00 commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

Preserve patch operations and neighboring Harness plugins and customized MCP settings when reconnecting AgentMemory. Forward the daemon URL and secret at Harness startup without storing credentials, and document the optional hooks bridge dependencies and authentication limits.

Validated with 24 adapter tests, the full repository suite (3,868 passed, 4 skipped), and repeated forced installs through the built CLI. Earlier integration testing used real dsh 0.2.1-rc.2 against iii 0.22.1 and 0.24.6. The scripted model exercised MCP save/recall and local hook capture; a freshly packed runtime also preserved the project filter.

Summary by CodeRabbit

  • New Features

    • DeepSeek Harness connections now use the server URL and secret from startup environment variables, defaulting to a local URL. Secrets are not written into the generated configuration.
    • Forced refreshes preserve unrelated plugins and customized connection settings while updating managed entries.
  • Bug Fixes

    • Invalid or unsupported configuration files now produce an error without being modified. Duplicate managed entries are removed without affecting unrelated entries.
  • Documentation

    • Added setup guidance for optional hooks, authentication, saved credentials, remote capture limitations, and checking MCP and automatic capture.

@vercel

vercel Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
agentmemory Ready Ready Preview Oct 23, 2026 12:50pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 09d26515-b395-43b4-85b8-a8d83d8d69bf
📥 Commits

Reviewing files that changed from the base of the PR and between 75ce197 and 5e85eba.

📒 Files selected for processing: 2
  • src/cli/connect/dsh.ts
  • test/connect-dsh.test.ts
🚧 Files skipped from review as they are similar to previous changes: 1
  • src/cli/connect/dsh.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

📝 Walkthrough

The DSH connector now parses and updates cordis.patch.yml as YAML, recognizes managed MCP and hooks entries structurally, and resolves MCP settings through process environment expressions. The PR adds DSH setup documentation and tests for preservation, replacement, validation, and environment handling.

Changes: DSH Connector

Layer / File(s) Summary
YAML patch management
src/cli/connect/dsh.ts, test/connect-dsh.test.ts
The connector parses the patch as a YAML sequence, identifies managed entries by their fields, and upserts entries. MCP URL and secret values use !!js environment expressions. Tests cover YAML preservation, environment evaluation, and invalid documents.
Installation and setup
src/cli/connect/dsh.ts, test/connect-dsh.test.ts, docs/dsh.md
Installation detects and verifies MCP and hooks entries structurally. Tests cover hooks installation and preservation of customized entries. The guide describes setup, hooks, credentials, and server configuration.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 5e85e

No actionable issue is established for the YAML patch and setup changes; the PR is mergeable after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly summarizes the main changes: preserving DSH configuration and forwarding daemon credentials.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@devin-ai-integration devin-ai-integration Bot 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.

Devin Review found 1 potential issue.

Devin Review

Comment thread src/cli/connect/dsh.ts
Comment on lines +152 to 155
if (wantHooks && (!hasHooks || opts.force)) {
const hooksPath = installHooksFile(home);
next = stripBlock(next, HOOKS_MARKER);
next = appendBlock(next, hooksBlock(hooksPath));
next = upsertBlock(next, HOOKS_MARKER, hooksBlock(hooksPath));
p.log.info(`Hook manifest: ${hooksPath}`);

@devin-ai-integration devin-ai-integration Bot Oct 23, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Partial reconnect leaves hooks inactive

When the MCP row is missing but the hooks row remains, --with-hooks skips installHooksFile. A missing manifest stays missing, so reconnect reports success without restoring automatic capture.

Learn more

The hooks row points to a separate manifest containing the commands that launch capture scripts. If the MCP row has been removed but the hooks row remains, install proceeds instead of returning already-wired. The new condition skips installHooksFile in that path, even when the manifest has been deleted. The earlier install path regenerated the manifest whenever a reconnect proceeded with hooks enabled.

Example: A user retains an agentmemory-hooks insert row, removes the MCP insert row, and loses agentmemory.hooks.json. Running connect dsh --with-hooks writes the MCP row and reports success, but the bridge still cannot read its manifest.

Recommended fix: When wantHooks is true and the install proceeds because hasMcp is false, restore the manifest even if hasHooks is true. Keep the existing hooks insert row intact unless --force is set or the row is absent.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

coderabbitai[bot]

This comment was marked as resolved.

@rohitg00
rohitg00 merged commit 70517d2 into main Oct 23, 2026
14 checks passed
@rohitg00
rohitg00 deleted the fix/integration-runtime-e2e-20261023 branch October 23, 2026 13:28

This branch was successfully deployed

1 active deployment
Preview — 5e85ebaa Deployed Oct 23, 2026 by vercel[bot]
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