Skip to content

[CTX-0056] fix(transport): separate connection ownership from request history - #118

Merged
Xuepoo merged 1 commit into
mainfrom
ctx-0056/fix-reconnect-counts
Sep 17, 2026
Merged

Xuepoo merged 1 commit into
mainfrom
ctx-0056/fix-reconnect-counts

Conversation

@Xuepoo

@Xuepoo Xuepoo commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Closes #106 (TERM-DEV-012). Reconnect admission previously fed cumulative request history into the per-connection cap and did not release connection ownership on terminal transport closure. IpcTransport now separates request telemetry from connection ownership:

  • connected: bool becomes active_connections: usize (0/1); isConnected() reflects live ownership.
  • connect() re-checks peer identity, reserves a connection exactly once on repeated connects, and reports TransportClosed without reopening a terminally closed stub.
  • sendRequest() releases ownership on terminal closure; recoverable full/rate failures keep existing ownership.
  • Rate limiter credit and request history survive reconnect.

Scope

  • src/transport.ts
  • tests/transport.test.ts
  • crates/devtools-client/src/transport.rs

Rust/TS parity is preserved; no wire, schema, capability, or protocol changes; no shared or endpoint-wide cap semantics introduced.

Evidence

  • Independent review APPROVE: CarryCtx CTX-0056 PX-0301/0302/0303; commander acceptance PX-0306.
  • Approved blobs unchanged: src/transport.ts abc7172549b5dba1e0009a52faf20747182445c0, tests/transport.test.ts 327a7c510ddcb04895df335ed8d684ef607ba55b, crates/devtools-client/src/transport.rs 6e4d6c22242c9e31210e1b6c0eb5b1b64495818f.
  • Diff vs base 7676f87 matches approved before/after diff SHA256 465f5a8736adaed751be5aea6f35b239cef4f3bb784ea09dfb9e8809f380f6cd.
  • Local gates: Prettier 3.9.6, oxlint 1.81.0, markdownlint-cli2 0.23.1, tsc 7.0.2, Bun 1.4.2 356/356, cargo 1.98.1 fmt/check/clippy -D warnings/test 79/79 (locked, offline), git diff --check, gitleaks clean.
  • Docs-sync: no impact per PX-0303 (no wire/protocol/privacy behavior change); bitty-ipc endpoint limit remains endpoint-owned.

Documentation

No canonical docs impact per independent review (PX-0303).

Residual risks

Local headless gates do not prove live-runtime interoperability; live dial semantics unchanged.

@Xuepoo Xuepoo added this to the v0.1.0 milestone Sep 17, 2026
@Xuepoo Xuepoo added area:devtools devtools area fix Bug fix P2 Priority: medium labels Sep 17, 2026
@Xuepoo
Xuepoo merged commit 8449dc9 into main Sep 17, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:devtools devtools area fix Bug fix P2 Priority: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TERM-DEV-012] Investigate historical request counts in reconnect admission

1 participant