python-codex 0.1.7__tar.gz → 0.1.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_codex-0.1.7 → python_codex-0.1.8}/AGENTS.md +1 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/PKG-INFO +1 -1
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/tools/base_tool.py +2 -1
- {python_codex-0.1.7 → python_codex-0.1.8}/pyproject.toml +1 -1
- python_codex-0.1.8/tests/test_py36_syntax.py +29 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/.github/workflows/publish.yml +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/.github/workflows/test.yml +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/.gitignore +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/LICENSE +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/README.md +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/README_ZH.md +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/docs/ALIGNMENT.md +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/docs/CONTEXT.md +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/docs/responses_server/README.md +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/__init__.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/agent.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/cli.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/collaboration.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/compat.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/context.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/doctor.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/model.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/portable.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/portable_server.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/prompts/collaboration_default.md +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/prompts/collaboration_plan.md +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/prompts/default_base_instructions.md +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/prompts/exec_tools.json +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/prompts/models.json +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/prompts/permissions/approval_policy/never.md +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/prompts/permissions/approval_policy/on_failure.md +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/prompts/permissions/approval_policy/on_request.md +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/prompts/permissions/approval_policy/on_request_rule_request_permission.md +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/prompts/permissions/approval_policy/unless_trusted.md +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/prompts/permissions/sandbox_mode/danger_full_access.md +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/prompts/permissions/sandbox_mode/read_only.md +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/prompts/permissions/sandbox_mode/workspace_write.md +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/prompts/subagent_tools.json +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/protocol.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/runtime.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/runtime_services.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/tools/__init__.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/tools/agent_tool_schemas.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/tools/apply_patch_tool.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/tools/close_agent_tool.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/tools/code_mode_manager.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/tools/exec_command_tool.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/tools/exec_runtime.js +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/tools/exec_tool.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/tools/grep_files_tool.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/tools/list_dir_tool.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/tools/read_file_tool.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/tools/request_permissions_tool.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/tools/request_user_input_tool.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/tools/resume_agent_tool.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/tools/send_input_tool.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/tools/shell_command_tool.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/tools/shell_tool.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/tools/spawn_agent_tool.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/tools/unified_exec_manager.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/tools/update_plan_tool.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/tools/view_image_tool.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/tools/wait_agent_tool.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/tools/wait_tool.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/tools/web_search_tool.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/tools/write_stdin_tool.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/utils/__init__.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/utils/compactor.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/utils/debug.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/utils/dotenv.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/utils/get_env.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/utils/random_ids.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/utils/session_persist.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/pycodex/utils/visualize.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/responses_server/__init__.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/responses_server/__main__.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/responses_server/app.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/responses_server/config.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/responses_server/messages_api.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/responses_server/payload_processors.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/responses_server/server.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/responses_server/session_store.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/responses_server/stream_router.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/responses_server/tools/__init__.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/responses_server/tools/custom_adapter.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/responses_server/tools/web_search.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/tests/TESTS.md +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/tests/__init__.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/tests/compare_request_user_input_roundtrip.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/tests/compare_steer_request_bodies.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/tests/compare_tool_schemas.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/tests/fake_responses_server.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/tests/fakes.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/tests/responses_server/fake_chat_completions_server.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/tests/responses_server/test_server.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/tests/test_agent.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/tests/test_builtin_tools.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/tests/test_cli.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/tests/test_compactor.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/tests/test_context.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/tests/test_doctor.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/tests/test_fake_responses_server.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/tests/test_model.py +0 -0
- {python_codex-0.1.7 → python_codex-0.1.8}/tests/test_portable.py +0 -0
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
- 当前 `exec` / `wait` 已有一个最小 code-mode 实现:底层通过 Node 子进程运行 JavaScript,自带 `text` / `image` / `store` / `load` / `exit` / `notify` / `yield_control` helper,并允许通过 `tools.<name>(...)` 调回本地已注册工具;`web_search` 当前作为 Responses API provider-native tool declaration 暴露给模型,不经过本地 ToolRegistry 执行。
|
|
36
36
|
- 我们支持的 tools 必须和原版 Codex 内置 tools 一一对应:名称、定位、参数形状、交互模型、输出语义都应尽量对齐;不要混合多个原版工具的语义做一个“折中工具”。
|
|
37
37
|
- 代码风格上不要使用 `*` 定义 keyword-only 参数;接口默认允许位置参数。
|
|
38
|
+
- runtime 包和会在 import 阶段执行的测试辅助代码需要保持 Python 3.6.2 语法兼容;不要引入 walrus `:=`、`match` 等仅 3.8+/3.10+ 可解析的新语法,哪怕分支在运行时不会走到。
|
|
38
39
|
- 本仓库使用 `uv`;本地默认没有预装测试依赖,开始工作前先跑 `uv sync --dev`,验证用 `uv run pytest`。
|
|
39
40
|
- 上游 Codex 的 `steer` 目前是 TUI 交互层能力:开启后 `Enter` 会立即提交,`Tab` 才是排队。对齐时优先盯“下一次发出去的请求体”而不是内部控制流;当前 `pycodex` 已把 steer/queue 语义下沉到 `AgentRuntime`,并让 `AgentLoop.run_turn(texts)` 一次接收一批 user texts,这样下一次请求的 `input` 可以把多个 steer 文本按顺序并到 history 尾部。`CliSessionView.handle_event()` 把 spinner 再次拉起。要保证输入不被遮挡,需要让 view 知道“当前正在输入”,并在 input-active 期间抑制这些事件对 spinner 的 resume。
|
|
40
41
|
- steer 的最小交互反馈已经约定为两条显式状态文案:入队时打印 `[steer] queued: <prompt>`,该条 queued turn 真正开始执行时打印 `[steer] inserted: <prompt>`。后续如果补更复杂的 queue UI,也应保留这两个核心状态语义。
|
|
@@ -142,7 +142,8 @@ class ToolRegistry:
|
|
|
142
142
|
tool_type=call.tool_type,
|
|
143
143
|
)
|
|
144
144
|
except Exception as exc: # pragma: no cover - defensive wrapper
|
|
145
|
-
|
|
145
|
+
debug_dir = get_debug_dir()
|
|
146
|
+
if debug_dir is not None:
|
|
146
147
|
with (debug_dir / "tool_errors.jsonl").open("a", encoding="utf-8") as handle:
|
|
147
148
|
handle.write(
|
|
148
149
|
json.dumps(
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import ast
|
|
2
|
+
import os
|
|
3
|
+
import sys
|
|
4
|
+
|
|
5
|
+
import pytest
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def _iter_python_files():
|
|
9
|
+
for root in ["pycodex", "responses_server", "tests"]:
|
|
10
|
+
for dirpath, _dirnames, filenames in os.walk(root):
|
|
11
|
+
for filename in filenames:
|
|
12
|
+
if filename.endswith(".py"):
|
|
13
|
+
yield os.path.join(dirpath, filename)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def test_python_sources_parse_with_python36_grammar():
|
|
17
|
+
if sys.version_info < (3, 8):
|
|
18
|
+
pytest.skip("ast feature_version requires Python 3.8+")
|
|
19
|
+
|
|
20
|
+
failures = []
|
|
21
|
+
for path in sorted(_iter_python_files()):
|
|
22
|
+
with open(path, "r", encoding="utf-8") as handle:
|
|
23
|
+
source = handle.read()
|
|
24
|
+
try:
|
|
25
|
+
ast.parse(source, filename=path, feature_version=(3, 6))
|
|
26
|
+
except SyntaxError as exc:
|
|
27
|
+
failures.append("%s:%s: %s" % (path, exc.lineno, exc.msg))
|
|
28
|
+
|
|
29
|
+
assert not failures, "Python 3.6-incompatible syntax found:\n%s" % "\n".join(failures)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_codex-0.1.7 → python_codex-0.1.8}/pycodex/prompts/permissions/approval_policy/never.md
RENAMED
|
File without changes
|
{python_codex-0.1.7 → python_codex-0.1.8}/pycodex/prompts/permissions/approval_policy/on_failure.md
RENAMED
|
File without changes
|
{python_codex-0.1.7 → python_codex-0.1.8}/pycodex/prompts/permissions/approval_policy/on_request.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_codex-0.1.7 → python_codex-0.1.8}/pycodex/prompts/permissions/sandbox_mode/read_only.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python_codex-0.1.7 → python_codex-0.1.8}/tests/responses_server/fake_chat_completions_server.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|