Skip to content

Commit eb67677

Browse files
committed
docs(client): document the per-call signal on every client method
#3178's Done-when: the public client docs list `signal`, including the already-aborted refusal (`dispatched: 'no'`), the mid-flight cancel (`reason: 'request_canceled'`), and the promise that an abort never takes the timeout path's runner cleanup or daemon reset.
1 parent 69a5ae9 commit eb67677

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎website/docs/docs/client-api.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,15 @@ Results are daemon-shaped objects with typed known fields, so command semantics
238238

239239
A failed interaction rejects with the same error the CLI prints. Read `error.details.dispatched` before you retry; [Commands](./commands.md) explains the two values.
240240

241+
Every client call accepts `signal?: AbortSignal` to cancel that one call:
242+
243+
```ts
244+
const controller = new AbortController();
245+
await client.interactions.press({ ref: '@e12', signal: controller.signal });
246+
```
247+
248+
A signal that is already aborted rejects the call without sending anything (`error.details.dispatched: 'no'`). Aborting while the request is in flight closes that request's connection, the daemon marks the request canceled, and the promise rejects with the typed canceled-request error (`error.details.reason: 'request_canceled'`, `error.details.dispatched: 'unknown'`). The daemon and the session stay alive for other requests. An abort is never a timeout: it never triggers the timeout path's runner cleanup or daemon reset.
249+
241250
```ts
242251
await client.command.wait({
243252
text: 'Continue',

0 commit comments

Comments
 (0)