Skip to content

fix: refresh codex credentials for auto-disabled channels#4324

Merged
Calcium-Ion merged 1 commit intoQuantumNous:mainfrom
seefs001:fix/refresh-auto-disabled-codex-channel
Apr 22, 2026
Merged

fix: refresh codex credentials for auto-disabled channels#4324
Calcium-Ion merged 1 commit intoQuantumNous:mainfrom
seefs001:fix/refresh-auto-disabled-codex-channel

Conversation

@seefs001
Copy link
Copy Markdown
Collaborator

@seefs001 seefs001 commented Apr 18, 2026

⚠️ 提交说明 / PR Notice

Important

  • 请提供人工撰写的简洁摘要,避免直接粘贴未经整理的 AI 输出。

📝 变更描述 / Description

codex渠道在被自动禁用后没有自动更新Access Token

🚀 变更类型 / Type of change

  • 🐛 Bug 修复 (Bug fix) - 请关联对应 Issue,避免将设计取舍、理解偏差或预期不一致直接归类为 bug
  • ✨ 新功能 (New feature) - 重大特性建议先通过 Issue 沟通
  • ⚡ 性能优化 / 重构 (Refactor)
  • 📝 文档更新 (Documentation)

🔗 关联任务 / Related Issue

  • Closes # (如有)

✅ 提交前检查项 / Checklist

  • 人工确认: 我已亲自整理并撰写此描述,没有直接粘贴未经处理的 AI 输出。
  • 非重复提交: 我已搜索现有的 IssuesPRs,确认不是重复提交。
  • Bug fix 说明: 若此 PR 标记为 Bug fix,我已提交或关联对应 Issue,且不会将设计取舍、预期不一致或理解偏差直接归类为 bug。
  • 变更理解: 我已理解这些更改的工作原理及可能影响。
  • 范围聚焦: 本 PR 未包含任何与当前任务无关的代码改动。
  • 本地验证: 已在本地运行并通过测试或手动验证,维护者可以据此复核结果。
  • 安全合规: 代码中无敏感凭据,且符合项目代码规范。

📸 运行证明 / Proof of Work

(请在此粘贴截图、关键日志或测试报告,以证明变更生效)

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced credential refresh operations to include channels in additional statuses, broadening the scope of channels that receive automatic credential updates.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 18, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 409a4413-a648-4db9-a5dd-9929fe22145e

📥 Commits

Reviewing files that changed from the base of the PR and between 5b9dcf1 and 3ea3b0c.

📒 Files selected for processing (1)
  • service/codex_credential_refresh_task.go

Walkthrough

A new helper function shouldAutoRefreshCodexChannelStatus was added to determine if a channel status qualifies for auto-refresh. The database query in runCodexCredentialAutoRefreshOnce was updated to select channels matching either enabled or auto-disabled status instead of a single hardcoded value.

Changes

Cohort / File(s) Summary
Channel Status Verification
service/codex_credential_refresh_task.go
Added helper function shouldAutoRefreshCodexChannelStatus to check whether a channel status is enabled or auto-disabled. Updated database query to select Codex channels matching either status value instead of a single hardcoded status, expanding the scope of channels eligible for auto-refresh.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A helper hop to check the state,
Which channels should we auto-refresh of late?
Not just one, but two paths we see,
Enabled or auto-disabled—more flexibility!
Status-checking whiskers twitch with glee, ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly aligns with the main change: enabling credential refresh for auto-disabled Codex channels through an expanded status check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Calcium-Ion Calcium-Ion merged commit e729b22 into QuantumNous:main Apr 22, 2026
2 checks passed
panjinhe pushed a commit to panjinhe/new-api that referenced this pull request Apr 22, 2026
mxyhi pushed a commit to mxyhi/new-api that referenced this pull request Apr 23, 2026
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.

2 participants