界面已本地化;技能介绍与说明文档按所选语言由 AI 自动翻译,代码、命令、路径和专业术语保留原文,以原作者文档为准。
探索技能
开发与工程 · SKILL.md

preset-skill-op-availability-save-gate

preset-skill-op-availability-save-gate

【开发与工程】Save on the preset editor performs local structural validation only — it never makes a live provider/model network call. Real availability diagnosis is owned by /doctor and actual runtime execution.

独立 GitHub 快照 · 自动分类 · 以原作者文档为准

Llingtai-ai / lingtaiApache-2.0

技能说明

GitHub

name: preset-skill-op-availability-save-gate description: Save on the preset editor performs local structural validation only — it never makes a live provider/model network call. Real availability diagnosis is owned by /doctor and actual runtime execution. version: 3.0.0 last_changed_at: "2026-09-29T00:00:00Z" related_files:

  • tui/internal/tui/preset_editor.go
  • tui/internal/tui/doctor.go
  • tui/internal/preset/preset_skill_router_test.go maintenance: "If you find stale or incorrect information here, use the lingtai-issue-report skill to assemble evidence and obtain per-issue human consent before filing an issue. Never include secrets, credentials, tokens, or private paths."

Availability / save gate

Evidence: tui/internal/tui/preset_editor.go's commit().

Save is structural-only

commit() runs the preset's structural Validate() and, if it passes, saves immediately. There is no live HTTP call, no pending/checking state, and no per-tuple credential fingerprinting gate on Save — for any provider family: Codex and Claude Code logins as well as openai- and anthropic-family API keys. See reference/operations/saved-presets/SKILL.md for what Validate() checks.

History

An earlier revision of this editor ran a real live provider/model call on every Save and hard-blocked the save on a non-2xx response (a "real-availability gate"). That gate false-positived broadly — every provider, including working Codex and API-key configurations, could be rejected by transient network/provider conditions unrelated to whether the configuration was actually usable — and was removed (2026-07-23, reported by Jason). It has not been replaced by another probe, whitelist, or retry loop.

Where live availability diagnosis actually lives

/doctor (tui/internal/tui/doctor.go's probeLLM) and real runtime execution remain the places that diagnose whether a provider/model is actually reachable. probeLLM checks by provider family: openai lists {base_url}/models with a Bearer key, anthropic lists {base_url}/v1/models with x-api-key + anthropic-version (each then makes one max_tokens=1 generation call to catch empty gateway replies), codex and claude-code are reported as login-owned without a network call, and any other provider is reported as unsupported. Save does not duplicate that check.

Operations

For structural Validate() and the Load/Save/Delete file contract, see reference/operations/saved-presets/SKILL.md. For what happens after a successful save — activation and /refresh — see reference/operations/activation-session-refresh/SKILL.md.

我的收藏