Skip to content

promptStop should cancel already executing tool call futures #111

@bombaywalla

Description

@bombaywalla

To upvote this issue, give it a thumbs up. See this list for the most upvoted issues.

When a chat/promptStop is executed while a tool call is executing in its own future, we currently get an "Invalid state transition" (by design). ECA then waits for the future to complete. It would be good if the future could be cancelled - especially if the tool call is long-lived. However, it may be challenging since the future thread has to cooperate with the cancellation process. And we don't always have control over the implementation.

Steps to reproduce the behavior (in eca-emacs):

  1. Send a prompt like Please run the bash tool with a sleep of 10 secs followed by a 'ls'..
  2. Click on accept to allow the tool.
  3. Click on stop, to stop the prompt, while the tool is still running.
  4. Check the <eca:stderr:1> buffer. You should see an "Invalid state transition" exception.

What we'd like in this issue is just to be able to cancel the future - ideally in a clean way, but okay if not clean.
Secondarily, we want to allow the user to interrupt ECA from hanging on a long-lived call, but see #77 on background tasks and long-lived processes.
Minimally, get rid of the invalid state transition exception.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

Status

Ready

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions