Skip to content

fix: Fix default timeout value.#17187

Closed
CarloWood wants to merge 1 commit intoanomalyco:devfrom
CarloWood:CW00-popup-able-to-connect-to-url
Closed

fix: Fix default timeout value.#17187
CarloWood wants to merge 1 commit intoanomalyco:devfrom
CarloWood:CW00-popup-able-to-connect-to-url

Conversation

@CarloWood
Copy link

@CarloWood CarloWood commented Mar 12, 2026

Many callsites don’t pass duration, relying on the default. The way the default was specified was wrong, resulting in an 'undefined' value if no duration is passed instead of 5000.
Passing undefined to setTimeout causes an immediate timeout (in practise a very shortly visible TUI toast UI.

Issue for this PR

Closes #17191

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

It fixes that the default of 5000 is actually used if nothing is passed, instead of getting undefined.

How did you verify your code works?

I run opencode in a container with a network namespace; everything is firewalled, so I got for every attempt to connect some https:// url the vague error "Unable to connect. Is the computer able to access the url?" which showed up so short that there was hardly time to read it.

I could reproduce this simply by testing "test" and hitting enter on a prompt.
After applying this patch that changed to a neat 5 seconds long visible error, as it should.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

If you do not follow this template your PR will be automatically rejected.

@github-actions
Copy link
Contributor

Hey! Your PR title Fix default timeout value. doesn't follow conventional commit format.

Please update it to start with one of:

  • feat: or feat(scope): new feature
  • fix: or fix(scope): bug fix
  • docs: or docs(scope): documentation changes
  • chore: or chore(scope): maintenance tasks
  • refactor: or refactor(scope): code refactoring
  • test: or test(scope): adding or updating tests

Where scope is the package name (e.g., app, desktop, opencode).

See CONTRIBUTING.md for details.

@github-actions github-actions bot added the needs:compliance This means the issue will auto-close after 2 hours. label Mar 12, 2026
@CarloWood CarloWood changed the title Fix default timeout value. fix: Fix default timeout value. Mar 12, 2026
@github-actions github-actions bot removed needs:title needs:compliance This means the issue will auto-close after 2 hours. labels Mar 12, 2026
@github-actions
Copy link
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

@CarloWood
Copy link
Author

That failure is unrelated to my fix... In fact, I think my fix fixes what that failure is complaining about: you no longer have to pass something because now the default DOES work.

@kommander
Copy link
Collaborator

Well, the type changed so these have to be fixed.

Many callsites don’t pass duration, relying on the default.
The way the default was specified was wrong, resulting in an 'undefined' value
if no duration is passed instead of 5000.
Passing `undefined` to setTimeout causes an immediate timeout (in practise
a very shortly visible TUI toast UI.
@CarloWood CarloWood force-pushed the CW00-popup-able-to-connect-to-url branch from c7a32d4 to c9638c9 Compare March 14, 2026 17:22
@CarloWood
Copy link
Author

CarloWood commented Mar 16, 2026

Well, the type changed so these have to be fixed.

Still, not related to this one-liner fix. I hope the fact that it says "Some checks were not successful" isn't going to be a reason that no is going to review this patch.

@CarloWood
Copy link
Author

Replaced by #18113

@CarloWood CarloWood closed this Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]Error toast popup almost immediately disappears.

2 participants