Skip to content

bug:Turn state remains locked after prompt cancellation/interruption #115

Description

@Yangtze-Seventh

Summary

After a prompt is cancelled or interrupted, Raven sometimes keeps the previous turn marked as in progress.

The TUI returns to the input box and still allows the user to type, but every new message fails with:

error: [rpc -32003] turn_in_progress

<img width="1152" height="916" alt="Image" src="https://github.com/user-attachments/assets/892def5e-289c-4ff7-950d-73bb6606f36c" />

### Steps to reproduce

1. Start Raven TUI:

```bash
raven
Send a prompt.

Cancel or interrupt the prompt while the turn is still running.

Send another message, for example:

hello
Observe that every subsequent message fails with:
error: [rpc -32003] turn_in_progress

### Expected behavior

```markdown
After a prompt is cancelled or interrupted, Raven should release the active turn state and allow the next user message to run normally.

If a turn is still actually running, the TUI should show a clear busy/cancel state instead of accepting input that will always fail.

### Actual behavior

The previous turn appears to remain locked on the backend side.

The UI looks ready for input, but all subsequent messages are rejected with:

```text
error: [rpc -32003] turn_in_progress

<img width="1152" height="916" alt="Image" src="https://github.com/user-attachments/assets/4872c9b2-e6f0-466f-b3f8-6efe2600595d" />

### Environment

- OS: macOS
- Shell: zsh
- Terminal: iTerm2
- Raven version: 0.1.3
- Model/provider: Deepseek chat

### Logs or screenshots

```text

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions