feat(agent): add Codex agent wrapper and ReMe MCP bridge#358
Open
jinliyl wants to merge 1 commit into
Open
Conversation
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.
变更概述
完成 #352
本 PR 为 ReMe 的统一 Agent Wrapper 增加 Codex 后端,使现有 Job 可以通过 Codex 执行,并将 ReMe Job 以 MCP 工具的形式注入 Codex 线程。同时补充 API Key 与 OAuth 两种默认配置,保持与 AgentScope、Claude Code 后端一致的调用和流式响应接口。
主要改动
1. 新增 Codex Agent Wrapper
CodexAgentWrapper并注册codexbackend。openai-codexPython SDK 实现同步reply与流式reply_stream。CODEX_HOME,默认将会话状态保存在 ReMe workspace 的mem_session/codex;OAuth 配置可直接使用用户的~/.codex。2. 新增 ReMe Job MCP 桥接
tool_context_id,并阻止调用方覆盖该上下文。3. 统一流式事件映射
StreamChunk/ChunkEnum。4. 默认配置与依赖
default.yaml中新增:codex:适用于 API Key / 自定义 Base URL。codex_oauth:复用~/.codex登录状态。openai-codex>=0.1.0b3加入 core 依赖。兼容性说明
skills="all";单独选择部分 skill 会明确报错,避免静默产生不完整配置。测试与检查
新增单元测试覆盖:
本地验证结果:
PYTHONPATH=. pytest tests/unit/test_codex_agent_wrapper.py -v:13 passed。git diff --check:通过。