Skip to content

Graceful close uses session.bye with no session.closed acknowledgement instead of spec session.close/session.closed (§6.7) #68

@nficano

Description

@nficano

Category: spec-conformance Severity: major
Location: src/arcp/_runtime/_handlers.py:88-90
Spec: ARCP v1.1 §6.7

What

Spec §6.7 states the client sends session.close and the runtime acknowledges with session.closed. The SDK uses a session.bye message type (client ops.py:221, server dispatch table server.py:338, registry _messages/__init__.py:35) and the runtime closes the transport without emitting any session.closed acknowledgement. A spec-conformant client sending session.close would be rejected as an unknown envelope type, and the documented session.closed ack is never produced.

Evidence

async def handle_bye(_runtime: ARCPRuntime, ctx: SessionContext, env: Envelope) -> None:
    SessionByePayload.model_validate(env.payload)
    await ctx.transport.close()

Proposed fix

Rename the close handshake to session.close/session.closed to match §6.7 and emit a session.closed acknowledgement before tearing down the transport (or amend the spec if session.bye is intentional).

Acceptance criteria

  • A client sending session.close receives a session.closed acknowledgement; the wire type names match §6.7.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions