Skip to content

fix: typed steer/abort rejection codes + status-list truncation marker (#84) - #94

Merged
rz1989s merged 2 commits into
mainfrom
fix/84-typed-rejections-truncation-marker
Aug 30, 2026
Merged

rz1989s merged 2 commits into
mainfrom
fix/84-typed-rejections-truncation-marker

Conversation

@rz1989s

@rz1989s rz1989s commented Aug 30, 2026

Copy link
Copy Markdown
Member

Closes #84. Both items are contract-safe additions to the frozen RPC surface (zero new error codes, no renames).

Typed steer/abort rejections

  • New SessionRejectionError (src/engine/session-rejection.ts) with a reason discriminant: steer-unsupported | already-processing | already-aborted.
  • The two deterministic throw sites (toLiveHandle, wrapPiSession) throw it with byte-identical message text — anything matching on strings keeps working.
  • steerVerb/abortVerb match on the type first; the substring checks ("not supported" / "already") survive as a back-compat fallback for third-party ChildSession implementations bubbling bare Errors.

Status-list truncation marker

  • status list replies add "truncated": N only when the registry exceeds LIST_CAP=25 (absent at ≤25 — at-cap boundary pinned); single-runId lookups never carry it.

Verification

803/803 tests (+5), typecheck clean. Review: approve (typed-first order verified adversarial-wording-safe; census clean; boundary pinned per review NIT).

#84)

SessionRejectionError (src/engine/session-rejection.ts) carries a reason
discriminant (steer-unsupported | already-processing | already-aborted).
The two deterministic throw sites (toLiveHandle, wrapPiSession) now throw
it with UNCHANGED message text; RpcServer.steerVerb/abortVerb match on
the type first and keep the message-substring checks as a back-compat
fallback for third-party ChildSession implementations. Frozen error enum
untouched.

statusVerb adds "truncated": N to the reply ONLY when the registry
exceeds LIST_CAP (additive field; absent when everything fits). Single-
runId lookups never carry it.
@rz1989s
rz1989s merged commit 624479c into main Aug 30, 2026
1 check passed
@rz1989s
rz1989s deleted the fix/84-typed-rejections-truncation-marker branch August 30, 2026 08:20
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.

RPC polish: typed steer/abort rejection codes + status-list truncation marker

1 participant