Skip to content

docs(canon): record three unlisted divergences, correct two reasons (#861) - #878

Merged
Blind-Striker merged 2 commits into
masterfrom
docs/861-divergence-records
Nov 15, 2026
Merged

Blind-Striker merged 2 commits into
masterfrom
docs/861-divergence-records

Conversation

@Blind-Striker

Copy link
Copy Markdown
Collaborator

Closes #861

Documentation only. Every record cites upstream at the pin (v2.3.0, a6b15d33) and the SDK at this PR's base (b6061e0c), with its mechanism and a reversal trigger, in the divergence list of its own section of docs/architecture/client-runtime.md.

Recorded divergences

  1. Redirects are not followed (Construction and transport ownership). Upstream leaves fetch's default redirect: "follow"; the SDK's owned handlers disable redirects. The mechanism was observed, not assumed: Bun 1.4.4's fetch keeps Authorization on a same-origin redirect and drops it across origins, while .NET 11's SocketsHttpHandler drops it on a same-origin redirect too (its RedirectHandler clears the header on every redirect it follows). A followed redirect would reach its target without the credential.
  2. Terminal upgrades authenticate with the Authorization header (PTY WebSocket session). Upstream mints a ticket because the browser WebSocket API cannot set headers; ClientWebSocket.Options.SetRequestHeader exists on every shipped target.
  3. Batch-shim arguments are refused, not escaped (launcher, Windows table). Upstream's launcher spawns through cross-spawn 7.0.6 (bun.lock:2813), which quotes and caret-escapes, a second time only for paths matching node_modules/.bin/*.cmd. An escape's survival depends on percent and delayed expansion and on how often an arbitrary batch file re-parses its arguments (BatBadBut: CVE-2024-24576, CVE-2024-27980).

Corrected reasons (decisions unchanged)

  1. No process-exit hook (launcher, Linux and macOS table): the SDK's only child is the server, whose own exit hook ends the detached tool groups it tracks once its stdin lease ends.
  2. Strict registration readers (background service): the hard mechanism behind the pid rule. Upstream's promise client signals an unchecked pid, and on POSIX a pid of 0 or -1 signals the caller's process group or every process it may signal. Upstream's Effect client, which the CLI uses, already refuses a non-positive pid.

The legacy service-config rewrite is not recorded here: #213 adopts upstream's repair.

Review

A read-only review from another model family checked every citation and mechanism and reran both redirect probes. Its four findings (an overstated cross-spawn description, missing SDK-at-base citations for three items, the exit hook's tracking limit, and the signal semantics) are fixed in the second commit.

Checks and version impact

Markdown only, so no local check applies (quality-gates.md). No version impact.

…861)

Records the redirect rule, the header-authenticated terminal upgrade and the
batch-shim argument refusal in the divergence lists of their sections, each
with upstream at the pin, the SDK at the base, the mechanism and a reversal
trigger. Corrects the no-exit-hook reason (the server's own hook covers its
tool groups) and names the hard mechanism behind the strict pid rule.
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.

Canon: record three unlisted divergences and correct two divergence reasons

1 participant