Skip to content

fix: 手动恢复的免费模型不再被自动探测覆盖,并支持手动/自动切换 - #57

Merged
jasonxu114514 merged 1 commit into
jasonxu114514:mainfrom
cheerc:fix/availability-manual-lock
Oct 8, 2026
Merged

jasonxu114514 merged 1 commit into
jasonxu114514:mainfrom
cheerc:fix/availability-manual-lock

Conversation

@cheerc

@cheerc cheerc commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

手动恢复免费模型后,后续自动探测原先仍可将其重新禁用。现在恢复操作会进入持久化的手动模式:保持启用并跳过自动探测,直到管理者明确切回自动。

  • 新增每模型手动/自动切换和 POST /api/models/manual,要求管理登录与 CSRF 校验;运行时未加载时返回错误。
  • 在途探测不能覆盖手动恢复,旧 manually_enabled 记录在加载时迁移为手动模式。重复设置同一模式不改变禁用原因或调度时间。
  • 已禁用模型到期复测遇到临时错误时,保留原禁用证据并在 24 小时后重试,避免过期的 NextCheck 导致每分钟重复探测。已启用模型的临时失败仍按 1 小时重试。
  • 更新 WebUI 和中英文文档,说明手动模式会暂停 auto 思考档位探测;缓存超过 2 小时后不再强制下发已验证档位。

验证:本地回归覆盖手动锁定、持久化、迁移、保存失败回滚、过期复测调度、重复操作、真实本地 HTTP 在途请求与管理接口鉴权;go test ./...、go vet ./...、go build ./...、格式和 WebUI 语法检查通过。测试文件在验证后移除,最终变更不包含测试文件。

Closes #56

Keep manually restored models enabled until automatic control is selected.
Persist manual mode, protect in-flight results, and add the admin API and UI toggle.
Preserve disable evidence and renew expired 24-hour retry schedules after inconclusive probes.
Keep repeated mode changes idempotent and document manual mode with adaptive effort.

Closes jasonxu114514#56
@jasonxu114514
jasonxu114514 force-pushed the fix/availability-manual-lock branch from 2bf18ce to df56703 Compare October 8, 2026 14:10
@jasonxu114514
jasonxu114514 merged commit 1e2702f into jasonxu114514:main Oct 8, 2026
5 checks passed
SK-DEV-AI added a commit to SK-DEV-AI/opencode2api that referenced this pull request Oct 10, 2026
…114514#57), port offline no_upstream_contact guard

Upstream jasonxu114514#54 moves probing to native protocol with model_unavailable-only
disables and adds reasoning.effort=auto discovery; jasonxu114514#57 adds manual control
lock with per-model toggle. Port our Finding C offline-boot guard into the
new probe.go via gotResponse tracking so offline boot reports unattempted
instead of disabling working models. Adapt local probe test to probeResult
shape. Vet clean, all tests + race pass.
@cheerc
cheerc deleted the fix/availability-manual-lock branch October 13, 2026 08:04
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.

[BUG] 手动恢复的免费模型会被下一次自动探测覆盖,且缺少手动/自动切换

2 participants