feat(codex): migrate bridging to OS scheduler - #638
Open
xnne-bot wants to merge 8 commits into
Open
Conversation
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
|
这个 PR 可以解决 schedule task 的一个 sandbox 问题,没法解决 codex 对话时 retrieve 就被拦住的问题。 可以先观望一下 codex desktop 会话内的 sandbox 如何解决再把这个接入。 |
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.
📝 Pull Request Summary
将 Codex 的 memU bridging 从 ChatGPT/Codex native scheduled task 迁移到可确定管理的 OS scheduler:Windows 复用共享 Task Scheduler helper,macOS/Linux 使用 prompt file + wrapper + cron/launchd。旧 native task 必须先经 Codex Desktop 审计并移除,避免 native 与 OS 两套 scheduler 同时处理同一批 jobs。
✅ What does this PR do?
HostSpec.schedule_backend从native改为os,并接入共享scheduleCLI。codex exec --dangerously-bypass-approvals-and-sandbox --skip-git-repo-check {prompt};不使用--ephemeral,保留 rollout 作为失败诊断记录。\memU\memu-bridging-codex,支持install / verify / status / uninstall。bridge.sh;wrapper 恢复 scheduler 所需PATH、固定 working root、保留日志并用 lock 防止重叠运行。session_id_env保持为空,CodexTranscriptSource不变;该调查与修复留给后续独立 PR。🤔 Why is this change needed?
旧方案要求模型在 ChatGPT/Codex Desktop 中创建 native scheduled task,任务生命周期依赖模型是否正确识别并调用产品侧 task tool;
codex-cli本身也没有 native Scheduled 管理界面。迁移到 OS scheduler 后,安装、状态检查和卸载拥有 canonical identity,Windows 可由 CLI 确定性管理,Unix 也避免把约 1.2 KB prompt 塞进 cron line。调研依据:
安全边界保持明确:
--dangerously-bypass-approvals-and-sandbox只移除 Codex 自身的 approval 与 sandbox,不会提权为 administrator/root,也不会绕过 S4U、cron sparse environment、macOS TCC/Keychain、代理/CA、防火墙、企业策略或 CLI 登录。wrapper 只运行由 package 固定的 bridging prompt,不接受任意用户 prompt。