Skip to content

Provide an API/hook to close streams after INPUT_REQUIRED / AUTH_REQUIRED #990

Description

@bianjp

Summary

Follow-up to #975 / #989.

After #756, interrupted states keep the stream open by design, and #989 correctly deprecated the misleading isFinal overloads on requiresInput / requiresAuth. We still need a supported way for server embeddings to complete the stream after emitting INPUT_REQUIRED / AUTH_REQUIRED.

Why

With SSE, only the server can complete the stream. The client can’t cleanly close it (dropping the connection still leaves server-side resources open until timeout). SSE is also one-way, so after INPUT_REQUIRED the client must send follow-up input via a new request anyway — keeping the original stream open doesn’t help that path, and unclosed connections become costly under load.

Prior discussion

Ask

Please consider adding an explicit close/hook API (exact shape TBD). Default can remain “stream stays open” per #756.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions