Asia/Shanghai
ProjectsJuly 9, 2026

opencode-sub2api-haiku-fix

image
opencode-sub2api-haiku-fix is a deliberately small OpenCode plugin for one failure mode: Claude Haiku requests through Sub2API returning "You're out of extra usage" while Opus and Sonnet work on the same route. The fix stays local to the plugin. It does not fork Sub2API, patch OpenCode core, or modify OMO. Instead, it rewrites only Haiku requests into the Claude Code-style wire shape that this OAuth route expects.
  • Preserves Haiku manual thinking.
  • Rebuilds the final request body into a 3-block Claude Code-style system shape.
  • Moves the original OpenCode system prompt into the opening messages so local instructions survive the rewrite.
  • Adds Claude Code-style metadata and request/session IDs.
  • Leaves Sonnet and Opus untouched.
The launch build was verified with the local test suite and a live OpenCode smoke test:
Bash
npm test
opencode run -m anthropic/claude-haiku-4-5-20251001 "Reply OK only."
The smoke test returned OK, and Sub2API recorded a successful Haiku usage row after the earlier extra-usage errors stopped.
opencode-sub2api-haiku-fix 是一个只解决一个问题的 OpenCode 插件:同一个 Sub2API 路由下,Opus 和 Sonnet 可以正常工作,但 Haiku 报「You're out of extra usage」。 这个错误在该场景里不是额度结论,而是 Haiku 请求形状不够像 Claude Code。插件只在 OpenCode 侧修正 Haiku 请求,不改 Sub2API、不改 OpenCode core、不改 OMO。
  • 保住 Haiku manual thinking。
  • 将最终请求改成 Claude Code 风格三段 system。
  • 将原始 OpenCode system prompt 移入开头 messages,避免本地指令丢失。
  • 补齐 Claude Code 风格 metadata、request ID 和 session ID。
  • 对非 Haiku 模型提前退出,不影响 Sonnet 和 Opus。
该项目适合已经使用 Sub2API + OpenCode,并且希望保持后端可持续更新、不维护私有 Sub2API fork 的用户。

Related projects

Clean Design

Clean Design

Use the AI tools you already have to create editable visual projects that stay on your Mac.
Codex Minus

Codex Minus

面向 macOS 与 Windows 的精简 Codex 管理工具:安全切换供应商,管理官方与自定义模型目录,并保护 OAuth 与 Context。
JumpOTP

JumpOTP

面向授权 SSH/JumpServer 会话的按需 TOTP 助手。仅在严格匹配提示后调用已解锁的 Bitwarden CLI,每条连接最多自动提交一次,并保留可见手输回退。
Codex Doubao Pets

Codex Doubao Pets

六个可以直接安装到 Codex Desktop 的豆包桌宠。用真实角色图完成选择,用一条 npm 命令完成安装。
loop

loop

一次显式触发,按产物就绪状态自动连接 deep-grill、deep-design 和 deep-build,持续推进到已确认规格或可验证结果。
Slash Saver

Slash Saver

一个只为物理斜杠键做一件事的原生 macOS 工具:在原始按键进入当前应用前,切到用户指定的 ASCII 输入源。
deep-grill

deep-grill

同一个 Agent Skill,用探索模式把原始想法变成已确认 Product Brief,用审查模式压力测试成形方案,并在普通回复中持续当前会话。
Mingjian AI Services

Mingjian AI Services

A focused collaboration entry for teams moving from AI ideas to working products, Agent systems, and operable business workflows.
opencode-metrics

opencode-metrics

OpenCode TUI 的分会话侧边栏指标插件。按 sessionID 记录速度、TTFT、token、缓存、计时,只显示你当前 attach 的会话,而不是 serve 模式下的全局汇总。
opencode-plugin-fixes

opencode-plugin-fixes

Archived OpenCode guardrail experiment. The final source tree covers four narrow tool-call repairs; no npm package was ever published.
opencode-vibe-island-plugin

opencode-vibe-island-plugin

让 Vibe Island 在装了 oh-my-openagent 时仍然把 OpenCode 会话当成 OpenCode。修好 source 误标和 Ghostty 点击跳转。
OpenCode Themes

OpenCode Themes

Terminal-inspired dark themes for Obsidian, Typora, and Ghostty, all synced to the official OpenCode TUI palette.
wechat-mp-publisher

wechat-mp-publisher

从个人公众号 Skill 到可公开安装的 npm 包:本地校验与沙箱预览在前,用户确认后只创建草稿。
SIGINT

SIGINT

已归档的内容情报实验:曾把小红书/抖音采集、AI 分析、n8n 编排与实时仪表盘接成一条完整链路。
MdictLive

MdictLive

Modern web reader for MDict dictionaries with React 19 SPA, dark mode, and faithful rendering.
SiliconLM

SiliconLM

Local LLM dashboard for Apple Silicon Macs, currently preserved without an active local deployment.
mdx2apple

mdx2apple

Convert MDict (.mdx/.mdd) dictionaries to macOS Apple Dictionary format with one command.