Skip to content

fix(cli): say when an agent is connected with MCP only - #1756

Merged
rohitg00 merged 7 commits into
mainfrom
fix/mcp-only-capture-notice
Nov 12, 2026
Merged

rohitg00 merged 7 commits into
mainfrom
fix/mcp-only-capture-notice

Conversation

@rohitg00

@rohitg00 rohitg00 commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

Agents connected with MCP only capture nothing automatically. Observations are stored only when the agent calls memory_save, and several users asked why nothing was saved.

  • connect prints one line after an MCP-only setup. It suggests --with-hooks only for adapters that can install hooks, points plugin-based agents at their plugin, and otherwise says the agent must call memory_save.
  • Each adapter declares its capture mode in an autoCapture field.
  • Status warns (no-hook-capture) when the server has no sessions and no capture activity. It uses the existing session count; no new storage.

Behavior change: a fresh install reports warn instead of ok until the first hook arrives. The second commit is only docs:sync output and can be dropped if it conflicts.

Found through docs-assistant questions from users.

Test notes: targeted tests pass. Full-suite failures seen locally (fs-watcher, observation-source, graph timeouts) also fail on a clean origin/main checkout under load.

Summary by CodeRabbit

  • New Features
    • Connection setup now explains when automatic capture requires hooks or a plugin, how to enable it, and when manual saving may be needed.
    • Status checks warn when there are no sessions or capture activity and suggest a next step.
  • Bug Fixes
    • Status checks now treat unreadable capture data as unavailable rather than reporting that capture is missing.
  • Documentation
    • Updated reported passing-test counts from 4,700+ to 4,800+ across documentation.
  • Tests
    • Added coverage for capture setup guidance and status warnings.

An agent connected with MCP only and no hooks captures nothing on its
own. Observations are stored only when the agent calls memory_save.
connect and status never said so, so users expected automatic capture.

connect now prints one line after an MCP-only setup. It names
--with-hooks only for adapters that can install hooks, points
plugin-based agents at their plugin, and otherwise says the agent
must call memory_save. Each adapter declares its capture mode in a
new autoCapture field; JSON MCP adapters with a hook installer get
"with-hooks" automatically.

The status report and the status command warn when the server has
no sessions and no capture activity, which means no hook has reached
it yet. Sessions come from hooks or imports, never from MCP calls,
so the existing session count is the signal. No new storage is added.

Signed-off-by: Rohit Ghumare <ghumare64@gmail.com>
Run npm run docs:sync after the MCP-only capture notice change.

Signed-off-by: Rohit Ghumare <ghumare64@gmail.com>
@vercel

vercel Bot commented Nov 11, 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 Nov 11, 2026 4:20pm UTC

Request Review

@coderabbitai

coderabbitai Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review
Walkthrough

The PR classifies automatic-capture modes for supported adapters, adds connection and status guidance when automatic capture is absent, and updates documented test counts across project and translated documentation.

Changes: Automatic Capture Guidance

Layer / File(s) Summary
Declare capture modes and hook state
src/cli/connect/types.ts, src/cli/connect/*.ts, test/connect-capture-notice.test.ts, test/codex-connect-hooks.test.ts, test/connect-dsh.test.ts
Adds automatic-capture modes and reports hook installation state in connection results. Tests cover adapter modes and hook-state reporting.
Show capture guidance after connection
src/cli/connect/capture-notice.ts, src/cli/connect/index.ts, test/connect-capture-notice.test.ts
Adds mode-specific MCP-only notices. runAdapter logs a warning when a notice applies.
Report missing capture activity
src/functions/status.ts, src/cli.ts, src/capture/spool.ts, test/status.test.ts, test/capture-spool.test.ts
Adds a status warning when there are zero sessions and no capture activity. Unreadable capture data is marked unavailable and does not trigger the warning. The CLI checks session and capture status before displaying the warning.

Documented Counts

Layer / File(s) Summary
Update documented test and source-file counts
AGENTS.md, README.md, READMEs/README.*.md, scripts/docs-sync.state.json
Updates documented test counts from 4,700+ to 4,800+. The docs-sync state records 4,800+ tests and 260 source files.

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

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant runAdapter
  participant mcpOnlyCaptureNotice
  runAdapter->>mcpOnlyCaptureNotice: pass adapter, options, and connection result
  mcpOnlyCaptureNotice-->>runAdapter: return notice or null
  runAdapter->>runAdapter: log warning when notice exists
Loading

Possibly related issues

  • rohitg00/agentmemory#1635: The PR adds MCP-only capture guidance for agents without automatic capture.
  • rohitg00/agentmemory#1738: The PR adds a Codex hook-installation regression test and reports hook state, but does not test runtime hook entry points or add their typecheck.
  • rohitg00/agentmemory#1736: The PR directs MCP-only agents to memory_save, but does not fix its argument normalization.
  • rohitg00/agentmemory#1731: The PR adds an unreadable-spool status signal and tests unreadable spool handling, but does not establish that the issue’s drain unlink behavior is fixed.

Possibly related PRs

Merge Risk: Low · previous review 036d8

The change adds capture guidance and a status warning. Remaining problems are limited to wording and diagnostics: a warning may appear after a duplicate-only hook event, a working legacy DSH bridge may be reported as MCP-only, and spool read errors lack specific recovery advice. None of these is likely to cause serious failure.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.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. Documentat… 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 describes the primary CLI change: reporting when an agent connects with MCP without automatic capture.
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.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 11 functions across 22 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
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

devin-ai-integration[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

Adapters now report whether their hooks were installed. The connect
notice stays quiet only when hooks are confirmed, and it warns when
--with-hooks was passed but the hook install was skipped. DSH reports
hook rows it keeps in place.

connect codex --with-hooks on an already-wired config now installs the
hooks before it returns.

The no-hook warning in status needs a known capture state. A capture
check that timed out no longer triggers it, and the CLI reads the
capture endpoint so accepted, queued or spooled captures suppress it.

Signed-off-by: Rohit Ghumare <ghumare64@gmail.com>
@rohitg00

Copy link
Copy Markdown
Owner Author

Review-body findings:

  • Outside diff, src/cli/connect/codex.ts already-wired branch skips requested hooks: fixed in 396f069. That branch now installs the hooks when --with-hooks is passed, keeps the skip warning, and reports the hooks state. Regression test added in test/codex-connect-hooks.test.ts.
  • Docstring Coverage pre-merge check: not applied. This repo does not use code comments.

devin-ai-integration[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

A DSH hook row whose plugin file is gone no longer counts as installed.
The plugin-or-with-hooks notice keeps the plugin option when hooks fail.
The status check skips the diagnosis when the capture inbox is unreadable
and says capture was not observed yet instead of claiming it is off.
The CLI counts sessions across all agents and types the capture response.

Signed-off-by: Rohit Ghumare <ghumare64@gmail.com>
devin-ai-integration[bot]

This comment was marked as resolved.

coderabbitai[bot]

This comment was marked as resolved.

An unreadable capture inbox now reports capture-check-unavailable.
The spool summary flags read errors other than a missing file, and the
no-hook diagnosis is skipped while the spool cannot be read.
A legacy DSH bridge row counts as installed only while its manifest exists.
The no-hook message separates memories from observations and only offers
hooks or a plugin for agents that support them.

Signed-off-by: Rohit Ghumare <ghumare64@gmail.com>
coderabbitai[bot]

This comment was marked as resolved.

An unreadable spool now adds capture-check-unavailable, so status cannot
report that every check passed. The spool summary reads the primary file
directly, so an access error is not taken for an empty spool.
A legacy DSH bridge row no longer counts as installed hooks; the notice
points those users at the bundled plugin through --with-hooks.

Signed-off-by: Rohit Ghumare <ghumare64@gmail.com>
coderabbitai[bot]

This comment was marked as resolved.

When a spool cannot be read, the capture-check-unavailable fix now names
each spool path and asks the user to check that agentmemory can read it.

Signed-off-by: Rohit Ghumare <ghumare64@gmail.com>
@reevesc88

Copy link
Copy Markdown
Contributor

@codex review

@rohitg00
rohitg00 merged commit 816d31a into main Nov 12, 2026
23 of 24 checks passed
@rohitg00
rohitg00 deleted the fix/mcp-only-capture-notice branch November 12, 2026 11:36
rohitg00 added a commit that referenced this pull request Nov 12, 2026
Resolve the src/cli.ts import conflict by keeping the worker-connection
import from this branch and the hook-capture status imports from #1756.

Signed-off-by: Rohit Ghumare <ghumare64@gmail.com>
rohitg00 added a commit that referenced this pull request Nov 12, 2026
spoolSummary keeps this branch's unreadable count and takes the check
from #1756: a read error other than ENOENT on the spool file, a claim
or the spool folder counts as unreadable. The main-branch test now
expects counts instead of a boolean. Documented counts are re-synced.

Signed-off-by: Rohit Ghumare <ghumare64@gmail.com>

This branch was successfully deployed

1 active deployment
Preview — 8b4073c5 Deployed Nov 11, 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.

2 participants