Repository navigation
fix: 手动恢复的免费模型不再被自动探测覆盖,并支持手动/自动切换 - #57
Merged
jasonxu114514 merged 1 commit intoOct 8, 2026
Merged
Conversation
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
force-pushed
the
fix/availability-manual-lock
branch
from
October 8, 2026 14:10
2bf18ce to
df56703
Compare
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
手动恢复免费模型后,后续自动探测原先仍可将其重新禁用。现在恢复操作会进入持久化的手动模式:保持启用并跳过自动探测,直到管理者明确切回自动。
POST /api/models/manual,要求管理登录与 CSRF 校验;运行时未加载时返回错误。manually_enabled记录在加载时迁移为手动模式。重复设置同一模式不改变禁用原因或调度时间。NextCheck导致每分钟重复探测。已启用模型的临时失败仍按 1 小时重试。auto思考档位探测;缓存超过 2 小时后不再强制下发已验证档位。验证:本地回归覆盖手动锁定、持久化、迁移、保存失败回滚、过期复测调度、重复操作、真实本地 HTTP 在途请求与管理接口鉴权;
go test ./...、go vet ./...、go build ./...、格式和 WebUI 语法检查通过。测试文件在验证后移除,最终变更不包含测试文件。Closes #56