Skip to content

Support AbortSignal in harness invocations #3

Description

@oritwoen

What and why?

Harness.invoke() and listModels() only expose timeoutMs. A caller cannot cancel a run when the user aborts a turn, replaces a request, or asks to stop current work. Waiting for the fixed timeout or searching the global process table loses process ownership and risks terminating unrelated work.

Possible approach

Add signal?: AbortSignal to InvokeOptions and ListModelsOptions, pass it into the shared execution path, and define a consistent abort result distinct from timedOut. Cancellation should use the same process-tree cleanup contract as timeout handling and should settle within a documented bound.

Add tests for an already-aborted signal, cancellation during execution, and cancellation after completion.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions