plugins: http.request quota refusals bypass session.retry

未关闭
#65,198 1 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
18/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
typescript
领域
devtools

调研方向

Start with the session hook wrapper in packages/plugin/src/promise/adapter.ts, where the callback is wrapped in Effect.promise, and check how a thrown NativeVaultQuotaPolicyError escapes it. The expected change is a supported way for a hook to return a local provider error so session.retry can fall back. Done means a quota refusal reaches session.retry and the turn continues on the fallback provider. The issue is a maintainer-level design question about the plugin API, so it is not a good first contribution.

由索引模型根据 Issue 内容生成。

描述

area/plugins platform/linux type/feature version/v2
Description

When the Claude OAuth pool is already out of quota, anthropic-auth throws NativeVaultQuotaPolicyError from http.request before sending the model request. OpenCode logs Failed to drain Session, records an unknown error, and never calls session.retry. I reproduced this twice in the main session and once in a subagent. Both had a working non-Anthropic fallback.

Failed to drain Session
NativeVaultQuotaPolicyError: No Claude account has room for this request (weekly limit or your quota floor).

OpenCode wraps the session hook callback in Effect.promise. The anthropic-auth diagnosis confirms that the plugin has no supported way to refuse the request locally as a provider error.

Expected: let the hook return a local error response without sending the request. Pass it through the normal provider error handling so session.retry can switch providers and continue the same turn.

Plugins

@cortexkit/opencode-anthropic-auth 2.16.2, oh-my-opencode-slim 3.0.7 (a052f07a).

OpenCode version

2.3.2

Steps to reproduce
  1. Configure the Anthropic OAuth pool and a non-Anthropic fallback.
  2. With all eligible Claude accounts already out of quota, send a new prompt using Claude.
  3. The turn stops without trying the fallback. The same happens when a subagent starts on Claude.
Operating System

Ubuntu 24.04.5 LTS, arm64.

Terminal

OpenCode TUI in tmux.

主要语言
TypeScript
星标
227k
派生
30.7k
平均合并
3 小时 57 分钟
30 天内合并 PR
484

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

anomalyco/opencode 的其他 Issue

查看 anomalyco/opencode 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。