Github support - #1222
Conversation
🤖 自动审查报告
📁 修改的文件
🧠 AI 代码审查意见结论Not Ready 结构化审查结果必要性通过
关联性不通过
类型建议类型: feat
描述完整性不完整
风险级别中
必改项
建议项
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 038d9a4f71
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| { value: 'anthropic', label: 'Anthropic' }, | ||
| { value: 'vertex_ai', label: 'Vertex AI' }, | ||
| { value: 'ollama', label: 'Ollama' }, | ||
| { value: 'github_copilot', label: 'GitHub Copilot (OAuth)' }, |
There was a problem hiding this comment.
Preserve Copilot protocol when loading channel settings
Adding github_copilot to the selectable protocols here introduces a regression because the editor’s protocol parser (normalizeProtocol used by inferProtocol) still falls back unknown values to openai. In practice, when an existing config contains LLM_COPILOT_PROTOCOL=github_copilot, opening and saving the Settings page rewrites that channel as openai, which breaks the intended OAuth device-flow path and can make the channel fail without a manually provided token/key. Please add explicit github_copilot normalization (and related alias handling) so Copilot channels round-trip safely.
Useful? React with 👍 / 👎.
ZhuLinsen
left a comment
There was a problem hiding this comment.
评审结论
- 必要性:通过。新增 GitHub Copilot 作为 LLM 渠道有实际使用价值,但默认启用策略需要先收敛运行时风险。
- 是否有对应 issue:无。未检测到 Fixes/Closes/Refs,Issue Link 仍未有效填写。
- PR 类型:feat。新增后端 LLM 渠道、Web 预设、Actions/env 映射和相关文档。
- description 完整性:不完整。缺少 PR Type 勾选、背景/范围、Issue 或验收标准、实际验证结果、兼容性风险说明和回滚方案。
- 是否可直接合入:不可。CI 当前成功且
mergeable_state=blocked本身不作为阻断,但下面的正确性与兼容性问题需要先处理。
主要问题
- [Correctness blocker]
apps/dsa-web/src/components/settings/LLMChannelEditor.tsx:diff 只把github_copilot加到可选协议和“无需 Key”提示,但协议推断/归一化路径未同步接纳该值,已展开快照中的KNOWN_MODEL_PREFIXES仍不包含github_copilot。风险是已保存或加载的 Copilot 渠道被回退成openai,再次保存后丢失 LiteLLM 原生 OAuth provider 语义。需要补齐解析逻辑,并加 Web 回归测试覆盖加载后保存仍保持github_copilot。 - [Compatibility blocker]
src/config.py:LLM_DEFAULT_COPILOT默认 true 会在完全未配置 LLM 时自动启用 Copilot。LiteLLM 官方文档说明首次使用github_copilot/会触发 OAuth device flow:https://docs.litellm.ai/docs/providers/github_copilot 。这会让main.py、server.py、Docker、GitHub Actions 等无交互环境可能阻塞或失败,且依赖付费 Copilot 订阅。建议改为 opt-in,或补非交互保护、用户可见提示和回归测试。 - [Compatibility blocker]
apps/dsa-web/src/components/settings/llmProviderTemplates.ts、docs/llm-providers.md、tests/test_daily_analysis_workflow_llm_env.py:新增 Copilot 示例包含claude-sonnet-4,但 GitHub 官方 Copilot 模型文档已列出 Claude Sonnet 4 于 2026-05-01 退休,建议替代为 Claude Sonnet 4.6:https://docs.github.com/en/copilot/reference/ai-models/supported-models 。当前日期为 2026-05-07,该示例会误导用户配置已过期模型。 - [Process blocker] PR 描述仍基本是模板正文:没有 issue 或无 issue 验收标准,没有实际验证命令与关键输出,未说明 Copilot/LiteLLM 的官方来源、运行时兼容范围、旧配置影响和恢复方式,也没有最小回滚方案。
🤖 此回复由 OpenReview Bot 自动生成,仅供参考。如有疑问请 @维护者。
ZhuLinsen
left a comment
There was a problem hiding this comment.
跟进结论
- 结论:接受,当前
backend-gate确实失败,且失败直接落在本 PR 新增的默认 Copilot 配置行为上。 - 是否仍有阻断:有,离线测试失败属于阻断项,不能仅靠
mergeable_state=blocked或 web-gate 通过来放行。
说明
backend-gate中语法、flake8、deterministic checks 已通过,失败发生在python -m pytest -m "not network";定位不需要等待 CI,失败点已经明确。src/config.py新增的LLM_DEFAULT_COPILOT默认 true 会在无任何 LLM 配置时自动生成copilot渠道。CI 中tests/test_llm_channel_config.py有 3 个用例原本期望禁用/空配置后llm_channels和llm_model_list为空,现在实际得到github_copilot/gpt-4o,说明该默认行为改变了既有配置语义。- 同一默认行为还触发了真实 LiteLLM Copilot OAuth 路径,
tests/test_pipeline_realtime_indicators.py和tests/test_report_schema.py多个离线用例报Failed to get access token after 3 attempts,模型为github_copilot/gpt-4o。这验证了之前关于无人值守/离线环境风险的判断,不只是文档描述问题。 - 建议优先把 Copilot 默认改为 opt-in,或至少在 CI/测试/无交互环境默认关闭,并补回归测试证明禁用渠道、空配置、离线测试不会自动进入 OAuth device flow。LiteLLM 文档也说明
github_copilot/首次使用会走 OAuth device flow:https://docs.litellm.ai/docs/providers/github_copilot apps/dsa-web/src/components/settings/LLMChannelEditor.tsx仍未在normalizeProtocol/ alias 路径中接纳github_copilot,Web 设置页保存后仍有把 Copilot 协议回退为openai的风险;web-gate 通过不能覆盖这个 round-trip 场景。claude-sonnet-4示例仍在.env.example、docs/llm-providers.md、llmProviderTemplates.ts中出现。GitHub 官方模型页显示 Claude Sonnet 4 已于 2026-05-01 退休,建议替代 Claude Sonnet 4.6:https://docs.github.com/en/copilot/reference/ai-models/supported-models
🤖 此回复由 OpenReview Bot 自动生成,仅供参考。如有疑问请 @维护者。
|
感谢贡献,这个方向本身有价值,但当前 PR 暂不适合继续合入,我先关闭处理。 主要原因:
|
PR Type
Background And Problem
请描述当前问题、影响范围与触发场景。
(EN) Describe the problem, its impact, and what triggers it.
Scope Of Change
请列出本 PR 修改的模块和文件范围。
(EN) List the modules and files changed in this PR.
Issue Link
必须填写以下之一 / Fill in one of:
Fixes #<issue_number>Refs #<issue_number>Verification Commands And Results
请填写你实际执行过的命令和关键结果(不要只写"已测试")。
(EN) Paste the commands you actually ran and their key output (don't just write "tested"):
关键输出/结论 / Key output & conclusion:
Compatibility And Risk
请说明兼容性影响、潜在风险(如无请写
None)。(EN) Describe compatibility impact and potential risks (write
Noneif not applicable).(EN) If this PR changes third-party model/API compatibility, request parameters, routing prefixes, or provider fallback behavior, include an official source link or announcement and clarify whether the rule is permanent, runtime-specific, or a temporary compatibility workaround.)
(EN) If this PR depends on a specific runtime or pinned dependency window (for example a LiteLLM version range, OpenAI-compatible routing, or YAML alias behavior), state the compatibility window you verified and which code paths were covered.)
(EN) If this PR touches runtime config save/cleanup/migration/backfill logic, explicitly describe whether existing config is rewritten, cleared, migrated, or left intact, and how users can restore the previous behavior.)
Rollback Plan
请至少写一句可执行的回滚方案(必填)。
(EN) Provide at least one actionable rollback step (required).
revert this PR),并说明是否需要额外回滚配置或数据迁移。(EN) For compatibility fixes, include the minimal rollback path (for example
revert this PR) and whether any additional config or data rollback is required.)EXTRACT_PROMPT Change (if applicable)
若本 PR 修改了
src/services/image_stock_extractor.py中的EXTRACT_PROMPT,请在此处粘贴完整变更后的 prompt。If this PR changes
EXTRACT_PROMPTinsrc/services/image_stock_extractor.py, paste the full updated prompt here:展开 / Expand: Full EXTRACT_PROMPT
Checklist
docs/CHANGELOG.md;README.md仅在首页级信息变化时更新,细节优先写入docs/*.md/ If user-visible changes are included, relevant docs anddocs/CHANGELOG.mdare updated;README.mdis updated only for homepage-level changes, with details kept indocs/*.md