Describe the bug
Related to #1450.
The DSH integration has three related reliability and observability gaps:
-
/pc doctor checks HTTP health and API routes, but does not verify whether the native DSH MCP client connected or registered the expected mcp__powercontext__* catalog. HTTP health can therefore appear healthy while the model has no PowerContext MCP tools.
-
The runtime acceptance tests do not yet form a complete dsh-context observation loop. They inspect proxy traffic, model requests, and persisted snapshot messages separately, but do not correlate MCP calls/results with PowerContext injection through DSH session events.
-
The agent/pre-step hook performs Scope resolution, context preparation, and prompt capture before calling downstream next(). If a later hook rejects or rewrites the step, PowerContext requests may already have been performed using the original message batch.
Steps to reproduce
Hook ordering
-
Start the DSH automatic-path test fixture with successful Scope, prepare, and capture responses.
-
Invoke runRecallPreStep with a downstream handler returning:
-
Inspect the PowerContext requests made during the invocation.
The current implementation enters recallThenCapture() before calling next(), so Scope resolution, prepare_context, and possibly Source capture happen before the step is known to be accepted.
MCP catalog diagnosis
- Start a PowerContext Server where the HTTP API and health endpoints are available.
- Make the
/mcp endpoint unavailable or cause MCP discovery to fail.
- Start DSH with the PowerContext plugin.
- Run
/pc doctor.
The current doctor output does not report MCP connection or catalog state, so it cannot distinguish a healthy HTTP Server from a usable MCP integration.
Runtime observation
- Enable the
dsh-context observer.
- Run a prompt that triggers automatic PowerContext recall and a native MCP operation.
- Inspect the resulting trace.
The current acceptance suite does not produce one correlated record containing the tool/call, tool/result, snapshot injection, session, turn, step, and call identifiers.
Expected behavior
/pc doctor reports MCP connection and catalog status separately from HTTP health.
- Missing or incomplete MCP discovery is reported explicitly.
- Runtime observation correlates:
- native
mcp__powercontext__* tool calls;
- corresponding tool results;
- PowerContext snapshot injection;
- session, turn, step, and call identifiers.
- The pre-step hook calls downstream
next() before performing PowerContext side effects.
- Rejected or failed downstream steps do not trigger prepare or capture.
- Accepted steps use the final downstream message batch and append at most one snapshot.
- Existing cancellation, fail-open behavior, Scope isolation, and diagnostic redaction remain unchanged.
Actual behavior
/pc doctor can report healthy HTTP/API state without confirming that MCP tools are available.
- The existing tests do not provide a complete
dsh-context acceptance trace.
- PowerContext lifecycle requests happen before downstream step admission.
- A downstream rejection skips injection, but earlier PowerContext requests may already have completed.
Environment
- OS: Windows
- PowerContext commit:
be27ce0c
- DSH plugin version:
0.0.2
- DSH SDK:
@deepseek-ai/dsh-sdk-client@0.1.2-rc.1
- Python: 3.14.0
- Node.js: v26.1.0
- Shell: PowerShell
Relevant validation commands:
pnpm --dir integrations/dsh/plugins/powercontext test:all
pnpm --dir integrations/dsh/plugins/powercontext/tests/runtime test
Are you willing to submit a PR to fix this bug?
Describe the bug
Related to #1450.
The DSH integration has three related reliability and observability gaps:
/pc doctorchecks HTTP health and API routes, but does not verify whether the native DSH MCP client connected or registered the expectedmcp__powercontext__*catalog. HTTP health can therefore appear healthy while the model has no PowerContext MCP tools.The runtime acceptance tests do not yet form a complete
dsh-contextobservation loop. They inspect proxy traffic, model requests, and persisted snapshot messages separately, but do not correlate MCP calls/results with PowerContext injection through DSH session events.The
agent/pre-stephook performs Scope resolution, context preparation, and prompt capture before calling downstreamnext(). If a later hook rejects or rewrites the step, PowerContext requests may already have been performed using the original message batch.Steps to reproduce
Hook ordering
Start the DSH automatic-path test fixture with successful Scope, prepare, and capture responses.
Invoke
runRecallPreStepwith a downstream handler returning:Inspect the PowerContext requests made during the invocation.
The current implementation enters
recallThenCapture()before callingnext(), so Scope resolution,prepare_context, and possibly Source capture happen before the step is known to be accepted.MCP catalog diagnosis
/mcpendpoint unavailable or cause MCP discovery to fail./pc doctor.The current doctor output does not report MCP connection or catalog state, so it cannot distinguish a healthy HTTP Server from a usable MCP integration.
Runtime observation
dsh-contextobserver.The current acceptance suite does not produce one correlated record containing the
tool/call,tool/result, snapshot injection, session, turn, step, and call identifiers.Expected behavior
/pc doctorreports MCP connection and catalog status separately from HTTP health.mcp__powercontext__*tool calls;next()before performing PowerContext side effects.Actual behavior
/pc doctorcan report healthy HTTP/API state without confirming that MCP tools are available.dsh-contextacceptance trace.Environment
be27ce0c0.0.2@deepseek-ai/dsh-sdk-client@0.1.2-rc.1Relevant validation commands:
pnpm --dir integrations/dsh/plugins/powercontext test:all pnpm --dir integrations/dsh/plugins/powercontext/tests/runtime testAre you willing to submit a PR to fix this bug?