Skip to content

[feature]: Edit opencode's token limit sleep to be dependent on the value fetched from provider #237

Description

@Cyberistic

Hello, thanks for the plugin. Super nice and handy.

I'm not sure if this fits within scope of the plugin, as it's a feature which directly modifies the behavior of opencode, so feel free to close it.

Pre-flight checks

  • I searched existing issues and did not find a duplicate request.
  • I reviewed current behavior on the production released OpenCode version.

OpenCode version reviewed

1.18.21

Problem statement

When you run out of tokens in opencode, it retries exponentially (1 second, 2 seconds, ... 1 hour, 2 hours..) until it fails with this message.
Image

Proposed change

We already have the data for when the token limit will restart, just sleep for that amount! (e.g. my 5 hour cycle restarts in 1.5 hours, instead of spamming their api every few seconds and exponentially increasing the wait time, directly start with 1.5 hours, and maybe THEN can the current exponential behavior be applied)

Image

Things to consider

Only depend on the 5 hour cycles or allow month/weeks as well? is sleeping for days a good idea? Do we consider adding auto-model switch based on available quota?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions