Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions changelog/unreleased/checkin-time-setting.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
### English

- Automatic check-in now follows one operator-set time per provider instead of a learned upstream window. The setting defaults to 09:00 for every provider, lives in the console system settings, and takes effect for any account without a per-account custom time as soon as it is saved; the stored per-account auto time is only a display mirror and no longer outranks the setting.
- Removed the upstream earliest-window learning and the per-provider/region provenance table (`earliest`, `window_from_upstream`, `window_source`); upstream status payloads now only report check-in status.

### 中文

- 自动签到改为跟随「按供应商统一设置的时间」,默认全部为 09:00,在控制台系统设置里调整;未单独设置时间的账号在保存后立刻按新时间排期,账号上存的自动时间只做展示、不再压过设置。
- 移除了按上游最早窗口学习以及注册表里的窗口出处表(`earliest`、`window_from_upstream`、`window_source`),上游状态只用来回报签到状态。
15 changes: 15 additions & 0 deletions changelog/unreleased/checkin-window-region-aware.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
### English

- Scheduled check-in now learns each provider region's daily window start from the upstream status payload and runs one hour after it. Qoder Global (10:00) and Qoder CN (00:00) no longer share one schedule.
- A failed status probe keeps the learned hour instead of dropping back to a guess; providers that only expose a day flag (Trae, MiniMax Code) follow a documented built-in table that is rewritten on every probe, so a corrected table reaches existing accounts.
- The check-in window table carries its provenance per provider and region in the registry (`Earliest`, `WindowFromUpstream`, `WindowSource`), sourced from vendor docs and actively maintained open-source check-in projects instead of folklore.
- Windows that start at 23:00 or later clamp to 23:59 instead of wrapping to 00:xx and firing before the window.
- The Automatic check-in card now shows each provider region's earliest window, whether it is learned from upstream or built in, and the resulting automatic claim time.

### 中文

- 定时签到改为按「供应商 + 区域」从上游状态响应里学习每日签到窗口的开始时间,并在其后一小时执行。Qoder 国际版(10:00)与 Qoder CN(00:00)不再共用同一个时间。
- 上游状态探测失败时保留已学到的时间,不再退回猜测值;只返回天级标志的供应商(Trae、MiniMax Code)走有出处的内置时间表,且每次探测都会重写,表修正后存量账号也会跟上。
- 签到窗口表在注册表里按供应商/区域记录来源(`Earliest`、`WindowFromUpstream`、`WindowSource`),依据厂商官方文档和最近仍在更新的开源签到项目填写,不再是无出处的经验值。
- 23:00 之后开始的窗口钳制到 23:59,避免加一小时跨天变成 00:xx、在窗口开启前就执行。
- 「自动签到」卡片会显示每个区域的最早窗口、是上游自动获取还是内置时间表,以及推导出的自动签到时间。
13 changes: 13 additions & 0 deletions changelog/unreleased/console-self-update-from-image.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
### English

- Download update no longer depends on GitHub release assets: the host updater binary is copied out of the image that was just pulled, so a console update works on slow or unstable routes to GitHub.
- A missing or slow updater binary no longer fails the update. Preparation still succeeds once the target image is pulled, and the host binary is refreshed from the recreated container after the health check.
- `deploy/install-updater.sh` installs the updater from the running container first (no network download), and `scripts/start.sh` installs the managed updater automatically on Linux when no unit exists yet (`CLI2API_SKIP_UPDATER_INSTALL=1` opts out).
- The version-update dialog shows the current version as the latest one plus "Up to date" instead of a bare "—" when no newer release exists.

### 中文

- 「下载更新」不再依赖 GitHub Release 资源:宿主机 updater 二进制直接从刚拉取的镜像里取出,GitHub 线路慢或抖动时也能完成更新。
- updater 二进制下载失败不再让更新失败:目标镜像拉取成功即可准备完成,宿主机二进制会在重建容器并通过健康校验后从容器中刷新。
- `deploy/install-updater.sh` 优先从运行中的容器安装 updater(不走网络),`scripts/start.sh` 在 Linux 上检测到还没有 updater 单元时自动安装(设 `CLI2API_SKIP_UPDATER_INSTALL=1` 可跳过)。
- 版本更新弹窗在没有更新时把「最新版本」显示为当前版本并标注「已是最新版本」,不再是单个「—」。
13 changes: 13 additions & 0 deletions changelog/unreleased/provider-client-versions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
### English

- Pin every provider client version to the current upstream release: Trae CN `3.4.21` with build code `20261117` (both taken from the 2026-11-17 public release; the model catalog and chat gate on `X-Ide-Version-Code`, and a stale value silently cut the catalog from 21 models to 6), Kiro IDE `1.5.37`, Codex CLI `0.172.0`, Command Code CLI `1.93.3`, Kimi Code CLI `2.7.3`, Devin CLI `3000.14.30821`, and the WorkBuddy / CodeBuddy CLI segment `2.186.0` (CN desktop `5.11.3`, Global `5.11.4`).
- Check-in and quota paths were re-verified against the live upstream with those versions: Trae daily check-in and credit usage, WorkBuddy daily check-in, user-resource and billing identity, both unchanged. WorkBuddy CLI `2.186.0` returns the same 57-model CN catalog and streams chat exactly like `2.176.0`.
- Also refreshed two identities that the first pass had left alone once a public source was found: Meta Muse now sends the `muse-build/1.4.14` fingerprint (build `dec7d749…`, `tbh:exec`, platform from the host) instead of the stale `1.3.0 / tbh:tui`, and the MiniMax check-in query reports `desktop_version=0.7.9` (the current MCode TUI release) instead of `0.7.2`.
- Four identities that had been left on assumptions were re-checked against the packages the vendors actually ship: Qoder check-in now reports the desktop release per edition (`0.5.18` CN, `0.5.3` global) instead of `0.4.8`; CodeArts reports the snap extension identity every current client sends (`snap_vscode`, `26.11.300`, the VS Code extension published 2026-11-25) instead of `snap_AIIDE / 5.2.0`, a pair that appears in neither the IDE 26.11.200 package nor the VSIX; Kiro's KAS segment moves to `0.66.123`, the `@kiro/agent` bundled in IDE 1.5.37; and Doubao Work's account query moves to `sdk_version=2.2.10` (what doubao.com itself sends today), while `version_code=20800` stays because the official page still sends it.

### 中文

- 所有供应商客户端版本号对齐上游当前版本:Trae 国内版版本号改为 `3.4.21`、构建号改为 `20261117`(都取 11-17 的公开正式版;模型目录与对话按 `X-Ide-Version-Code` 分档,旧值会把目录从 21 个模型静默砍到 6 个),Kiro IDE 改为 `1.5.37`,Codex CLI 改为 `0.172.0`,Command Code CLI 改为 `1.93.3`,Kimi Code CLI 改为 `2.7.3`,Devin CLI 改为 `3000.14.30821`,WorkBuddy / CodeBuddy CLI 段改为 `2.186.0`(CN 桌面端 `5.11.3`、Global `5.11.4`)。
- 签到与额度链路已按新版本对真上游复验:Trae 每日签到与积分用量、WorkBuddy 每日签到、user-resource 与计费身份均正常。WorkBuddy CLI `2.186.0` 与 `2.176.0` 返回同一套 57 个模型目录,流式对话表现一致。
- 另有两项在找到公开来源后补齐:Meta Muse 改用 `muse-build/1.4.14` 指纹(构建 `dec7d749…`、`tbh:exec`、平台取自宿主),不再用旧的 `1.3.0 / tbh:tui`;MiniMax 签到查询的 `desktop_version` 改为 `0.7.9`(当前 MCode TUI 版本),不再用 `0.7.2`。
- 另有四项原来靠推断,现已按厂商真实安装包核对:Qoder 签到按版本地区上报桌面版(CN `0.5.18`、Global `0.5.3`),不再用 `0.4.8`;CodeArts 改为当前所有官方客户端实际发送的 `snap_vscode` / `26.11.300`(11-25 发布的 VS Code 扩展),不再用 `snap_AIIDE / 5.2.0`(IDE 26.11.200 安装包与 VSIX 里都搜不到这对值);Kiro 的 KAS 段改为 `0.66.123`(IDE 1.5.37 内置的 `@kiro/agent`);豆包办公的账号查询改为 `sdk_version=2.2.10`(doubao.com 页面当前使用的值),`version_code=20800` 保留,因为官网页面至今仍发这个值。
9 changes: 9 additions & 0 deletions changelog/unreleased/stream-idle-timeout.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
### English

- Streaming responses now carry a 5-minute upstream idle deadline (`CLI2API_STREAM_IDLE_MS`, clamped to at least 30s). An upstream that answers the response head and then goes silent no longer holds the account's in-flight slot, the client connection and a permanently "streaming" request row: the relay reports `stream_idle_timeout`, the account cools down for 10s, and the slot is released.
- On boot, request rows a previous process left in `started`/`streaming` are closed as `error` / `stream_abandoned`, so the console stops showing phantom running requests after every restart.

### 中文

- 流式响应新增 5 分钟上游空闲上限(`CLI2API_STREAM_IDLE_MS`,最低按 30 秒)。上游回了响应头后长时间不吐字节时,不再永久占住账号并发槽位、客户端连接和一直显示 `streaming` 的请求记录:转发报 `stream_idle_timeout`,该账号冷却 10 秒并释放槽位。
- 启动时会把上一进程遗留的 `started`/`streaming` 请求记录收尾为 `error` / `stream_abandoned`,重启后控制台不再出现幽灵运行中的请求。
7 changes: 7 additions & 0 deletions changelog/unreleased/updater-health-version-match.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
### English

- Fix the updater's post-restart health gate: images report the release tag (`v0.7.52`) while the console sends the bare semver (`0.7.52`), so the previous strict string comparison failed every deploy and forced a needless rollback. Versions are now compared as semver, ignoring the leading `v`.

### 中文

- 修复更新器重启后的健康校验:镜像里的 `/health` 回报的是发布 tag(`v0.7.52`),控制台送来的是不带 `v` 的版本号(`0.7.52`),原来按字符串严格比较会让每次部署都判定失败并触发一次无谓的回滚。现在按语义版本比较,忽略前缀 `v`。
7 changes: 7 additions & 0 deletions changelog/unreleased/updater-pull-retry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
### English

- Console updates no longer hang on a stalled registry connection: each `docker pull` attempt is bounded to four minutes and retried up to three times, so layers already downloaded are reused instead of the whole preparation burning its 15-minute budget and failing.

### 中文

- 控制台更新不再被卡住的镜像拉取拖死:每次 `docker pull` 限时四分钟并最多重试三次,已下载的层直接复用,不会把整个准备阶段的 15 分钟预算耗光后失败。
43 changes: 23 additions & 20 deletions deploy/install-updater.sh
Original file line number Diff line number Diff line change
Expand Up @@ -172,27 +172,30 @@ install_linux() {

local temp_dir status
temp_dir="$(mktemp -d)"
if install_released_updater /usr/local/bin/cli2api-updater linux; then
:
elif docker cp "${CONTAINER_NAME}:/app/cli2api-updater" "${temp_dir}/cli2api-updater" >/dev/null 2>&1; then
# The updater inside the running container always matches the deployed image
# and needs no network round trip, so prefer it over the GitHub asset.
if docker cp "${CONTAINER_NAME}:/app/cli2api-updater" "${temp_dir}/cli2api-updater" >/dev/null 2>&1 && [[ -s "${temp_dir}/cli2api-updater" ]]; then
install -m 0755 "${temp_dir}/cli2api-updater" /usr/local/bin/cli2api-updater
echo "Installed updater from the running container."
else
install_released_updater /usr/local/bin/cli2api-updater linux
status=$?
if [[ "${status}" -ne 0 && "${status}" -ne 1 ]]; then
rm -rf "${temp_dir}"
exit "${status}"
fi
if [[ "${status}" -eq 1 ]]; then
if ! command -v go >/dev/null 2>&1; then
rm -rf "${temp_dir}"
echo "No updater binary is available. Install Go 1.25.6+ to build it locally." >&2
exit 1
fi
echo "Released updater asset unavailable; building from the checked-out source."
(cd "${ROOT_DIR}" && go build -trimpath -o "${temp_dir}/cli2api-updater" ./cmd/updater) || { rm -rf "${temp_dir}"; exit 1; }
install -m 0755 "${temp_dir}/cli2api-updater" /usr/local/bin/cli2api-updater
echo "Installed updater from the running container."
else
status=$?
if [[ "${status}" -ne 1 ]]; then
rm -rf "${temp_dir}"
exit "${status}"
fi
if ! command -v go >/dev/null 2>&1; then
rm -rf "${temp_dir}"
echo "No updater binary is available. Install Go 1.25.6+ to build it locally." >&2
exit 1
fi
echo "Released updater asset unavailable; building from the checked-out source."
(cd "${ROOT_DIR}" && go build -trimpath -o "${temp_dir}/cli2api-updater" ./cmd/updater)
install -m 0755 "${temp_dir}/cli2api-updater" /usr/local/bin/cli2api-updater
fi
rm -rf "${temp_dir}"
fi
fi
rm -rf "${temp_dir}"

install -d -m 0750 /run/cli2api-updater
install -d -m 0700 /var/lib/cli2api-updater
Expand Down
8 changes: 7 additions & 1 deletion frontend/src/api/overview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,13 @@ export type ProviderDescriptor = {
pat_login: boolean
import_export: boolean
}
regions: Array<{ id: string; label: string; checkin?: { timezone: string } }>
regions: Array<{
id: string
label: string
checkin?: {
timezone: string
}
}>
default_region: string
}

Expand Down
24 changes: 19 additions & 5 deletions frontend/src/components/checkin/CheckinDefaults.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import { PageAlert } from '@/components/ui/PageAlert'
import { SkeletonBlock } from '@/components/ui/PageSkeletons'
import { useI18n } from '@/hooks/useI18n'

const DEFAULT_CHECKIN_TIME = '09:00'

export function CheckinDefaults({ settings, onSaved }: { settings: SystemSettings | null; onSaved: (settings: SystemSettings) => void }) {
const { t } = useI18n()
const navigate = useNavigate()
Expand All @@ -25,16 +27,25 @@ export function CheckinDefaults({ settings, onSaved }: { settings: SystemSetting
}, [])

async function save(providerID: string, value: string) {
if (!settings || value === settings.checkin_times[providerID]) return
if (!settings) return
const current = settings.checkin_times[providerID] ?? DEFAULT_CHECKIN_TIME
if (!value || value === current) {
setDrafts((draftsNow) => {
const next = { ...draftsNow }
delete next[providerID]
return next
})
return
}
setBusy(true)
setError('')
try {
onSaved(await updateSystemSettings({ checkin_times: { [providerID]: value } }))
} catch (err) {
setError(err instanceof Error ? err.message : String(err))
} finally {
setDrafts((current) => {
const next = { ...current }
setDrafts((draftsNow) => {
const next = { ...draftsNow }
delete next[providerID]
return next
})
Expand All @@ -52,8 +63,11 @@ export function CheckinDefaults({ settings, onSaved }: { settings: SystemSetting
{error ? <PageAlert title={error} /> : null}
{!settings || !providers ? <SkeletonBlock className="h-24 w-full" /> : providers.map((provider) => (
<FormRow key={provider.id} label={provider.label}
hint={provider.regions.filter((region) => region.checkin).map((region) => `${region.label} · ${region.checkin?.timezone === 'Local' ? settings.timezone : region.checkin?.timezone}`).join(' / ')}>
<Input type="time" value={drafts[provider.id] ?? settings.checkin_times[provider.id] ?? ''} disabled={busy}
hint={provider.regions.filter((region) => region.checkin).map((region) => {
const zone = region.checkin?.timezone === 'Local' ? settings.timezone : (region.checkin?.timezone || '')
return `${region.label} · ${zone}`
}).join(' / ')}>
<Input type="time" value={drafts[provider.id] ?? settings.checkin_times[provider.id] ?? DEFAULT_CHECKIN_TIME} disabled={busy}
aria-label={`${provider.label} ${t('autoCheckinTime')}`}
onChange={(event) => setDrafts((current) => ({ ...current, [provider.id]: event.target.value }))}
onBlur={(event) => void save(provider.id, event.target.value)} />
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/system/UpdateControls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ export function UpdateControls({ update }: { update: SystemUpdateController }) {
</div>
<div className="border-t border-separator p-4 sm:border-t-0">
<div className="text-caption font-medium text-muted">{t('latestVersion')}</div>
<div className="mono mt-2 text-section font-semibold">{info?.next_version || '—'}</div>
<div className="mono mt-2 text-section font-semibold">{info?.next_version || (info?.has_update ? '—' : info?.current_version) || '—'}</div>
{info?.managed && !info?.has_update && !busy ? <div className="mt-1 text-caption text-muted">{t('upToDate')}</div> : null}
</div>
</div>

Expand Down
4 changes: 3 additions & 1 deletion frontend/src/hooks/useSystemUpdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,9 @@ export function useSystemUpdate() {
? t('updateInProgress')
: preparing || submitting
? t('updatePreparingImage')
: t('updateNow')
: info?.managed && !info?.has_update
? t('upToDate')
: t('updateNow')
const statusHint = reloadIn != null
? t('updateReloadingHint')
: readyToApply
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/i18n/messages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const messages: Record<Lang, Dict> = {
navAccess: 'Access & try',
navAccounts: 'Accounts',
checkinDefaultsTitle: 'Automatic check-in',
checkinDefaultsHint: 'Set a default time for each provider. Accounts following the default pick up changes automatically; custom times stay unchanged.',
checkinDefaultsHint: 'Automatic check-in time per provider. Defaults to 09:00; every account without a custom time follows it.',
checkinDisabledAccountsTitle: 'Check in disabled accounts',
checkinDisabledAccountsHint: 'When enabled, accounts disabled for chat can still run their opted-in automatic check-in. Manual check-in remains unavailable for disabled accounts.',
checkinDisabledAccountsStatus: 'Current status',
Expand Down Expand Up @@ -1165,7 +1165,7 @@ export const messages: Record<Lang, Dict> = {
navAccess: '接入与调试',
navAccounts: '账号',
checkinDefaultsTitle: '自动签到',
checkinDefaultsHint: '按供应商设置默认时间。跟随默认的账号会立即采用新时间,账号自定义时间不受影响。',
checkinDefaultsHint: '按供应商统一设置自动签到时间,默认 09:00;未单独设置时间的账号立即跟随。',
checkinDisabledAccountsTitle: '停用账号也自动签到',
checkinDisabledAccountsHint: '开启后,停用聊天功能的账号仍可执行已开启的自动签到;停用账号仍不可手动签到。',
checkinDisabledAccountsStatus: '当前状态',
Expand Down
Loading
Loading