Skip to content

Fall back to one-shot Git I/O when Plumbing lacks duplex sessions #98

Description

@flyingrobots

Problem

GitObjectSessionPool.supports(protocol) currently treats an opener method's presence as proof that duplex sessions are available:

That is not sufficient for @git-stunts/plumbing. GitPlumbing always exposes openCatFileSession(), openMktreeSession(), and openFastImportSession(), but openSession() throws UnsupportedCapabilityError when the instance was constructed with a one-shot runner and no sessionRunner:

This surfaced in git-warp PR #764: a legacy BATS helper used new GitPlumbing({ runner: ShellRunnerFactory.create() }). git-cas selected the session path, then failed with:

UnsupportedCapabilityError: Runner does not support duplex command sessions

git-warp has moved that helper to GitPlumbing.createDefault(), but git-cas still overstates compatibility with valid one-shot Plumbing instances.

Desired behavior

When duplex sessions are explicitly unsupported, git-cas should use its existing one-shot paths:

  • writeTree() -> git mktree
  • object reads -> bounded one-shot cat-file paths
  • writeBlobs() -> bounded repeated hash-object writes

Do not fall back after arbitrary protocol, parse, corruption, timeout, or I/O failures. Those failures must remain visible. The fallback should be selected from an explicit capability signal or the narrowly typed pre-session UnsupportedCapabilityError.

Acceptance criteria

  • A Plumbing instance with opener methods but no duplex session capability is classified as one-shot-only.
  • writeTree(), representative object reads, and writeBlobs() work through existing one-shot paths with that instance.
  • A real session failure after a supported session begins is not silently retried one-shot.
  • Existing bounds, retry policy, error normalization, and close semantics remain intact.
  • Tests cover both a session-capable default Plumbing instance and a one-shot injected runner.
  • Capability detection does not add probe subprocesses such as git --version.

Scope note

This is deliberately deferred from the v6.5.3 session-coherence release. The downstream integration is unblocked by constructing Plumbing correctly; this issue is about preserving git-cas's advertised compatibility with lower-capability injected runners.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:runtimeRuntime portability or public API behaviorarea:storageStorage, Git objects, manifests, or persistencetype:designDesign doc or proof-plan worktype:sliceTurn-sized proof work under a goalpost

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions