You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit ed942e2
Browse filesBrowse the repository at this point in the historyBrowse files
self._raw_session = raw_session # private — never exposed
@@ -189,7 +189,7 @@ class SessionHandle:
189
189
```
190
190
191
191
-`Types:MUST:4` — **MUST** keep `_raw_session` private: no public attribute, no accessor returning it (`sdk_adapter/types.py:74,83`).
192
-
-`Types:MUST:5` — **MUST** expose only `on(handler) → unsubscribe`, `await send(prompt, *, attachments=None)`, `await abort()`, plus the attribute `session_id: str` (`sdk_adapter/types.py:86-120`).
192
+
-`Types:MUST:5` — **MUST** expose only `on(handler) → unsubscribe`, `await send(prompt, *, attachments=None)`, `await abort()`, `await wait_for_disconnect()`, plus the attribute `session_id: str`. The connection waiter uses an injected public SDK `ping` callable and raises only for real transport failures; it must never convert elapsed time into failure or expose the raw client/session.
193
193
-`Types:MUST:6` — **MUST NOT** expose lifecycle (`connect` / `disconnect` / `destroy` / `close`) on the handle; lifecycle is owned by the `client.session()` async context manager in `sdk_adapter/client.py`.
194
194
-`Types:MUST:7` — **MUST** assign `session_id` exactly once in `__init__` from the raw SDK session (`copilot.session.CopilotSession.session_id`); provider code MUST NOT reassign it. Callers **SHOULD** treat it as read-only — `__slots__` constrains attribute names but does not block reassignment of declared slots; a `__setattr__` guard or `frozen` dataclass is tracked as a code-level follow-up.
Copy file name to clipboardExpand all lines: contracts/sdk-protection.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,11 +65,11 @@ The provider MUST bound the abort call by `session.abort_timeout_seconds`. If ab
65
65
66
66
### SHOULD-2: Idle Timeout (Safety Bound Only)
67
67
68
-
The provider SHOULD NOT use `session.idle_timeout_seconds` for the main idle wait. SDK API calls can take 60+ seconds for complex operations (e.g., agent delegation). Use the caller's request timeout instead.
68
+
The provider MUST NOT impose a default elapsed-time deadline on healthy generation. `defaults.timeout` is `None`; an explicit per-call `_timeout_seconds` or provider `timeout` value still sets a deadline. An explicit per-call `None` disables an inherited deadline. The provider MUST NOT use `session.idle_timeout_seconds` for the main idle wait.
69
69
70
70
The `idle_timeout_seconds` config is retained for abort operations only.
**Implementation:**one outer `asyncio.timeout(timeout)` with `None` by default; await `idle_event.wait()` directly. The SDK `send()`RPC has a genuine unlimited default. A public SDK `ping()` watcher detects actual connection errors after submission without assigning a ping deadline. Slow pings are not failures. On explicit cancellation or deadline expiration, abort native work, unsubscribe handlers, cancel/join the connection watcher and stream consumer, then disconnect. Existing bounded abort/disconnect/close cleanup remains in force.
0 commit comments