Skip to content

TimeoutNegativeWarning leaks through the TUI #3512

@veracioux

Description

@veracioux

Description

I prompted the LLM to call the bash tool with an invalid argument, and so it specified a negative number to the timeout parameter. It caused a TimeoutNegativeWarning which leaked into and broke the TUI.

Proposed fix:

  • validate the argument before passing it to setTimeout
  • to guard against similar issues, we can try to capture the warning using process.on("warning", ...). In order not to lose the logs, we can cache them in the background and dump them once the TUI has quit, similar to what I do in this PR: feat: Improve logging #3305

You can assign this to me.

OpenCode version

opentui @ 087cd3e

Steps to reproduce

  1. Run the TUI
  2. Prompt: call the bash tool with a negative number

Screenshot and/or share link

Image

Operating System

No response

Terminal

alacritty

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions