Skip to content

Conversation

@AurelienRibon
Copy link
Contributor

@AurelienRibon AurelienRibon commented Oct 28, 2025

Some models, like gpt-5-pro, can think for way longer than the default 5 minutes timeout.
This PR allows the customization of this parameter, with a new --timeout argument passed to opencode run.

Does it work?

With a small timeout, we get a TimeoutError from fetch, as expected.
image

With a sufficient timeout, no error.
image

Without any custom timeout, no error.
image

EDIT

I just added support for timeout units (like --timeout 60s). If no unit is provided, ms is assumed.

Some models, like `gpt-5-pro`, can think for way longer than the default 5 minutes timeout. This PR allows the customization of this parameter.
@AurelienRibon
Copy link
Contributor Author

I changed the proposition to a constant-based approach, which is less intrusive (does not appear in help, does not introduce new params to existing functions).

This PR is still required for gpt-5-pro to work, as the current state of the tool prevents the model from completing its work (most complex questions require ~10mins to complete, some can go to 20mins).

@rekram1-node
Copy link
Collaborator

rekram1-node commented Oct 30, 2025

Do u still think this makes sense even with OPENCODE_CONFIG, OPENCODE_CONFIG_CONTENT, and existing opencode configs that let u specify timeout?

@rekram1-node
Copy link
Collaborator

@AurelienRibon okay someone else asked for it: #3583

Can we make it a flag for the run command and drop the env var?

@AurelienRibon
Copy link
Contributor Author

@rekram1-node hey, sorry I took a day off with the wife and kid. I initially made it a flag, so I will just roll-back the latest changes to restore the flag behavior. Will do that tomorrow, you'll tell me if the result is fine.

Only question I had in my mind when it was a CLI argument: what should it be named? I chose --timeout initially for simplicity, but that could be ambiguous, as it's the timeout for one model request, not the entire opencode run loop. I'll go with --timeout, but if you have a better idea in the meantime, just say.

@rekram1-node
Copy link
Collaborator

timeout is good, and hey no worries dont worry about being super responsive family takes priority and u are doing this for fun hope im not coming off as needing u to do things immediately! :)

@AurelienRibon
Copy link
Contributor Author

All done, I updated the PR description with new behavior examples.

@AurelienRibon
Copy link
Contributor Author

@actions-user, why you create conflicts?

image image

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.

3 participants