[FEATURE]: opencode run --timeout=60s #2369

Open
opened 2026-02-16 17:35:22 -05:00 by yindo · 3 comments
Owner

Originally created by @segoon on GitHub (Oct 30, 2025).

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

If running opencode run in scripts, I want to see it explicitly fail if it cannot finish in X seconds.

Originally created by @segoon on GitHub (Oct 30, 2025). ### Feature hasn't been suggested before. - [x] I have verified this feature I'm about to request hasn't been suggested before. ### Describe the enhancement you want to request If running `opencode run` in scripts, I want to see it explicitly fail if it cannot finish in X seconds.
yindo added the discussion label 2026-02-16 17:35:22 -05:00
Author
Owner

@rekram1-node commented on GitHub (Oct 30, 2025):

someone has a pr that will address this soon

@rekram1-node commented on GitHub (Oct 30, 2025): someone has a pr that will address this soon
Author
Owner

@AurelienRibon commented on GitHub (Oct 31, 2025):

@segoon See https://github.com/sst/opencode/pull/3498
Note that this PR is about a timeout for a single opencode model request (calls to the underlying LLM). An execution of opencode run can produce dozens of LLM calls.

If you need to timeout the entire opencode run loop after X seconds, you should do that externally using whatever system you're using. If called from bash, there are multiple ways to timeout any script. If called from a python or JS code, use the builtin timeout features (option timeout for child_process::spawn for example).

It should not be the responsibility of opencode to ensure a maximum duration is respected for the entire loop, since it can be monitored from outside tools.

@AurelienRibon commented on GitHub (Oct 31, 2025): @segoon See https://github.com/sst/opencode/pull/3498 Note that this PR is about a timeout for a single opencode model request (calls to the underlying LLM). An execution of `opencode run` can produce dozens of LLM calls. If you need to timeout the entire `opencode run` loop after X seconds, you should do that externally using whatever system you're using. If called from bash, there are [multiple ways](https://chatgpt.com/share/e/69049a55-b8ec-8009-8844-8dae200d10c5) to timeout any script. If called from a python or JS code, use the builtin timeout features (option `timeout` for `child_process::spawn` for example). It should not be the responsibility of opencode to ensure a maximum duration is respected for the entire loop, since it can be monitored from outside tools.
Author
Owner

@paulgear commented on GitHub (Jan 30, 2026):

The --timeout PR seems to have been closed due to some automated processes making it non-viable to leave long-running PRs open. Any chance this will get looked at again soon?

@paulgear commented on GitHub (Jan 30, 2026): The --timeout PR seems to have been closed due to some automated processes making it non-viable to leave long-running PRs open. Any chance this will get looked at again soon?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#2369