Skip to content

Track experimental external DeepSeek Harness (dsh) adapter #621

Backlog

Description

@WhollyMindless

Note

🤖 gpt-6-astra responding on behalf of WhollyMindless

We are starting a DeepSeek Harness (dsh) adapter in an isolated repository under WhollyMindless's GitHub account. We will share the repository and concrete test results here once the initial implementation is ready for review. This tracks work in progress, not a supported integration or an agreed upstream delivery commitment.

This follows the original offer in #554 and the experimental public adapter API in #601. OpenCode, Pi and oh-my-pi provide existing implementations; the dsh adapter will consume the public API as a separate package, without private engine imports or sharing implementation code with another adapter.

Initial work:

  • Verify the installed dsh extension APIs, runtime, model access and lifecycle guarantees; record the exact tested release.
  • Pin the experimental engine/API revision and prove installation outside the engine checkout.
  • Implement shared memory tools, outgoing context injection and automatic capture through the existing engine gates, with explicit reporting for unsupported capabilities.
  • Preserve global and project-scoped memory ownership when sharing a store with the existing harnesses.
  • Test real dsh event dispatch, session isolation, provider failure/cancellation and cooperative shutdown, alongside deterministic local tests.

The public API is still under review. A distributable adapter release depends on an engine release exposing that API; an initial source/package experiment does not establish compatibility with other releases. We will report any contract or packaging gaps discovered rather than treating the API as stable.

The implementation will stay in its isolated repository while we establish feasibility. No new adapter implementation PR in this repository is proposed by this tracking issue.

Activity

  1. WhollyMindless commented on Nov 30, 2026

    @WhollyMindless
    ContributorAuthor

    Note

    🤖 gpt-6-astra responding on behalf of WhollyMindless

    The external dsh adapter is ready for an initial installation and integration trial. WhollyMindless has shared the repository location directly with @abogartz. We are keeping the repository and documentation links off this issue until the maintainer has had a chance to try it.

    The repository includes pinned installation instructions, a maintainer trial guide, and a reproducible installed-profile test (npm run test:profile) that needs no inference service or credentials.

    The implemented scope includes fourteen memory tools, project/global storage through the engine, outgoing context injection, background automatic capture, and scoped anchors in native compaction. Installed SDK-profile tests exercise native and PTC tool execution, restart/recall, project isolation, capture cancellation on exit, and repeated compaction. A separate live-provider trial also passed capture in both executor modes.

    The tested host is dsh 0.2.2-rc.5, with Node 24.15.0 and adapter API 0.1.0. Installation currently requires the pinned experimental engine source from #601; the npm release numbered 0.41.1 does not contain that API.

    This is an experimental trial, not full parity or stable support. The interactive web profile still needs validation; tool-result memory pulls, usage receipts and compaction-triggered extraction remain unimplemented. Normal turn-end capture is implemented, subject to the engine's gates and the documented host shutdown limits.

    Installation feedback and any public-API gaps found during integration would be useful before deciding the next delivery step.

  2. abogartz commented on Nov 30, 2026

    @abogartz
    Owner

    Review of WhollyMindless/dsh-self-improvement @ 317a08a

    Reviewed as a consumer of the experimental /host boundary. Cloned and run locally, not
    read-only.

    Verification performed

    Check Result
    npm ci && npm run check on Node 20.20.2 2 pass / 5 fail — every failure TypeError: Promise.withResolvers is not a function
    npm ci && npm run check on Node 22.23.4 7/7 pass, build and both typechecks included, 9.8 s
    Boundary audit (rg "from 'opencode-self-improvement" src/) 4 files, all type-only, all /host. No /status, no private path, no other adapter's implementation
    Engine handler guards beforeTool / afterTool / context / prompt / compact are all engine-guarded (src/runtime/events.ts:116,125,227,284,305), so await pendingPrompts… and await pending… cannot reject into dsh's prompt assembly or compaction path. This was the predicted breaker; it is not one
    Their CI (Adapter checks, Node 24.15.0, ubuntu + windows) success on the last four pushes — matches the README claim

    Two things are worth saying plainly before the findings. The lifetime verification in
    src/lifetime.ts:12-33 — package name and version, realpath of the standard entry point,
    SHA-256 of four audited bin/profile-boot artifacts, capture disabled rather than
    guessed on any mismatch — is stricter than anything the maintained in-tree adapters do.
    And the provider-error handling in src/capture.ts (fixed diagnostic strings, nothing
    forwarded even as Error.cause) is the right call for credentials that can echo through
    opaque provider messages.

    Findings

    1. Config.directory silently converts "refuse ownerless write" into "stamp to the
    configured repository", and it is undocumented. (highest priority)

    src/index.ts:139-142 forwards config.directory as the setup root. The engine turns
    that into instanceDir (src/runtime/setup.ts:80-81) and provisionally binds any
    session it cannot describe
    to it (src/identity/session-context.ts:91,179 →
    src/identity/repokey.ts:228-235), which then satisfies writeTarget
    (src/identity/repokey.ts:291-295).

    So with config.directory set, a dsh session with no header.cwd writes project memory
    to the configured repository instead of hitting refuseOwnerlessWrite
    (src/identity/session-context.ts:69-75). With it unset — the default — the refusal
    holds, which is why nothing currently fails.

    DEVELOPMENT.md's row "No fallback to adapter/process directory for an unknown session" is
    therefore true only under the default, and the field that changes it is invisible:
    rg 'config\.directory|directory:' README.md DEVELOPMENT.md docs/*.md returns nothing.
    Nothing in the suite pins the set case; the cross-process store test drives
    OPENCODE_MEMORY_DIR, not this field.

    Fix either way: drop Config.directory, or document the consequence next to the refusal
    rule and add the test that pins which of the two happens.

    2. The Node floor is a trap for the reader the README addresses.

    engines.node: ">=24.9.0", no engineStrict, no .nvmrc, and "Build and verify" opens
    with "Install Node and Git, then npm ci / npm run check". On Node 20 the result is
    five failures that read Promise.withResolvers is not a function with no hint of the
    version requirement. The baseline table does list 24.15.0, but nothing between cloning
    and the red suite says so. One of: an .nvmrc, engine-strict=true, or a version check
    that prints the floor before the suite runs.

    3. Capture availability cliff, and a missing receipt on one path.

    The artifact pin is a correctness win, but its failure mode is capture off with a single
    console warning plus an auto_capture_disabled evidence row. Which surface lets a user
    see that capture is disabled instead of noticing weeks later that nothing accumulated?

    Separately: engine.reportCaptureDisabled('dsh') runs after setupMemory resolves
    (src/index.ts:145), after the .catch that rethrows setup failures. An unverified
    launcher combined with a setup failure therefore records no disabled receipt at all.

    4. SkipReason is re-declared (src/capture.ts:15) instead of importing the engine's
    exported CaptureSkipReason.
    The public entry point exports that union; a second local
    copy is the drift surface the export exists to avoid.

    5. prepared: Set<string> in src/compaction.ts:8 never expires. pending clears on
    settle, prepared only on a matching compaction/end. A compaction that is aborted, or
    that dies between the llm/stream hook and its end event, leaves its session id in the
    set indefinitely.

    6. Question, not a defect: what bounds the post-answer join inside the 5-second
    ceiling?
    requestGrantMs: () => null (src/capture.ts:81) against a 5,000 ms
    whole-application shutdown ceiling and the engine's 60,000 ms default capture budget. The
    documented reasoning is accepted — shutdown aborts the signal, and provider time is not
    cleanup time. The uncovered direction is the near-miss: a capture whose answer arrives at
    about 4.9 s. What guarantees the local write joins in the remainder, and is there a case
    that a near-deadline capture persists? The profile test cancels an outstanding capture,
    which is the opposite side.

    Scope statements I checked and found accurate

    The claims that capture starts from a committed turn/end rather than
    agent/turn-stopping; that compaction bookkeeping completes only on a successful
    compaction/end; that anchors are appended after the replayed conversation instead of
    mutating the cached prefix; promptDependentCache: 'unknown' and
    shutdown: { cooperative: 'best-effort', forcedExit: 'no-cleanup' } as legal
    HostCapabilities values; and the README's admission that the pinned 0.41.1 npm release
    does not provide this API. Each was checked against the engine rather than taken from
    the prose.

  3. WhollyMindless commented on Nov 30, 2026

    @WhollyMindless
    ContributorAuthor

    Note

    🤖 gpt-6-astra responding on behalf of WhollyMindless

    We are working through these findings. The first change will remove the configured-directory fallback and add a regression test proving that an unresolved session cannot write into a configured repository. We will also make the Node requirement fail clearly, improve capture-disabled visibility and setup-failure reporting, use the exported capture skip type, and clean up aborted-compaction tracking.

    For the shutdown question, we will test the post-answer write/join path and document what the host deadline does and does not guarantee, without introducing a teardown timer. We will report the verified results here when the fixes are ready.

  4. WhollyMindless commented on Nov 30, 2026

    @WhollyMindless
    ContributorAuthor

    Note

    🤖 gpt-6-astra responding on behalf of WhollyMindless

    @abogartz The dsh review fixes and adapter-version tests are pushed in adapter commits 2bbde96 and 874be44, ready for recheck.

    • Ownership: removed Config.directory and its forwarding to engine setup. Native and packed-consumer tests supply the legacy field and prove an unresolved session's project write is refused and cannot appear in another session's recall.
    • Node requirement: added .nvmrc for the tested Node 24.15.0, explicit installation instructions, and a dependency-free check that rejects Node below 24.9 before build/tests load the SDK.
    • Capture visibility: native memory_status reports whether capture is enabled, explicitly disabled, or unavailable because the launcher could not be verified. The unverified-lifetime receipt now precedes setup; a forced setup failure tests that it is still recorded.
    • Public types: replaced the local skip-reason union with the exported CaptureSkipReason.
    • Compaction cleanup: abandoned preparation clears on abort, provider failure, early stream closure, a new compaction, turn end or session disposal. Tests reject stale completion, permit a fresh retry, and check that disposal removes abort listeners.

    For the shutdown question, a new test pauses actual filesystem publication after the model answer, starts disposal, verifies that it waits, then releases the write and verifies persistence. The packed adapter repeats this under plain Node. This proves the cooperative join, not a write-duration guarantee: dsh's five-second whole-application ceiling can still interrupt an accepted write. Responses arriving after cancellation are rejected. The documentation states that limit; no teardown timer was added.

    The version tests provide additional evidence for #601. Fresh processes running the packed adapter reject engine API versions 0.0.9, 0.1.1 and 0.2.0 before host/configuration access or store creation, with capture enabled and disabled. The actual published 0.41.1 artifact, which lacks /host, produces a fixed installation diagnostic. A fast guard checks that the adapter owns its literal expectation instead of copying the engine's advertised version.

    Validation at 874be44: all 9 native/package tests and 12 installed CLI scenarios pass locally; GitHub CI passed. Deliberate regressions confirmed that the ownership, compaction cleanup, post-answer join, independent version expectation, early rejection and installation diagnostic assertions catch the old/broken behavior.

    The engine remains pinned to the experimental #601 artifact. This does not establish a registry upgrade path or mixed-engine-version store compatibility. I also reproduced the Node helper issue from #601 as a runtime failure: after the API check, readMemoryCommand('repo-init') throws Bun is not defined under Node 24.15.0. Dsh currently does not call that helper, which explains why its native suite passes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions