codexapi 0.5.0__tar.gz → 0.5.1__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.
- {codexapi-0.5.0/src/codexapi.egg-info → codexapi-0.5.1}/PKG-INFO +4 -2
- {codexapi-0.5.0 → codexapi-0.5.1}/README.md +3 -1
- {codexapi-0.5.0 → codexapi-0.5.1}/pyproject.toml +1 -1
- {codexapi-0.5.0 → codexapi-0.5.1}/src/codexapi/__init__.py +1 -1
- {codexapi-0.5.0 → codexapi-0.5.1}/src/codexapi/cli.py +20 -6
- {codexapi-0.5.0 → codexapi-0.5.1}/src/codexapi/ralph.py +3 -3
- {codexapi-0.5.0 → codexapi-0.5.1/src/codexapi.egg-info}/PKG-INFO +4 -2
- {codexapi-0.5.0 → codexapi-0.5.1}/LICENSE +0 -0
- {codexapi-0.5.0 → codexapi-0.5.1}/setup.cfg +0 -0
- {codexapi-0.5.0 → codexapi-0.5.1}/src/codexapi/__main__.py +0 -0
- {codexapi-0.5.0 → codexapi-0.5.1}/src/codexapi/agent.py +0 -0
- {codexapi-0.5.0 → codexapi-0.5.1}/src/codexapi/foreach.py +0 -0
- {codexapi-0.5.0 → codexapi-0.5.1}/src/codexapi/task.py +0 -0
- {codexapi-0.5.0 → codexapi-0.5.1}/src/codexapi/taskfile.py +0 -0
- {codexapi-0.5.0 → codexapi-0.5.1}/src/codexapi.egg-info/SOURCES.txt +0 -0
- {codexapi-0.5.0 → codexapi-0.5.1}/src/codexapi.egg-info/dependency_links.txt +0 -0
- {codexapi-0.5.0 → codexapi-0.5.1}/src/codexapi.egg-info/entry_points.txt +0 -0
- {codexapi-0.5.0 → codexapi-0.5.1}/src/codexapi.egg-info/requires.txt +0 -0
- {codexapi-0.5.0 → codexapi-0.5.1}/src/codexapi.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: codexapi
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.1
|
|
4
4
|
Summary: Minimal Python API for running the Codex CLI.
|
|
5
5
|
License: MIT
|
|
6
6
|
Keywords: codex,agent,cli,openai
|
|
@@ -93,10 +93,12 @@ Use `--no-yolo` to run Codex with `--full-auto` instead.
|
|
|
93
93
|
Ralph loop mode repeats the same prompt until a completion promise or a max
|
|
94
94
|
iteration cap is hit (0 means unlimited). Cancel by deleting
|
|
95
95
|
`.codexapi/ralph-loop.local.md` or running `codexapi ralph --cancel`.
|
|
96
|
+
By default each iteration starts with a fresh Agent context; use
|
|
97
|
+
`--ralph-reuse` to keep a single shared context across iterations.
|
|
96
98
|
|
|
97
99
|
```bash
|
|
98
100
|
codexapi ralph "Fix the bug." --completion-promise DONE --max-iterations 5
|
|
99
|
-
codexapi ralph --ralph-
|
|
101
|
+
codexapi ralph --ralph-reuse "Try again from the same context." --max-iterations 3
|
|
100
102
|
codexapi ralph --cancel --cwd /path/to/project
|
|
101
103
|
```
|
|
102
104
|
|
|
@@ -79,10 +79,12 @@ Use `--no-yolo` to run Codex with `--full-auto` instead.
|
|
|
79
79
|
Ralph loop mode repeats the same prompt until a completion promise or a max
|
|
80
80
|
iteration cap is hit (0 means unlimited). Cancel by deleting
|
|
81
81
|
`.codexapi/ralph-loop.local.md` or running `codexapi ralph --cancel`.
|
|
82
|
+
By default each iteration starts with a fresh Agent context; use
|
|
83
|
+
`--ralph-reuse` to keep a single shared context across iterations.
|
|
82
84
|
|
|
83
85
|
```bash
|
|
84
86
|
codexapi ralph "Fix the bug." --completion-promise DONE --max-iterations 5
|
|
85
|
-
codexapi ralph --ralph-
|
|
87
|
+
codexapi ralph --ralph-reuse "Try again from the same context." --max-iterations 3
|
|
86
88
|
codexapi ralph --cancel --cwd /path/to/project
|
|
87
89
|
```
|
|
88
90
|
|
|
@@ -920,8 +920,8 @@ def main(argv=None):
|
|
|
920
920
|
" --completion-promise after trimming/collapsing whitespace. CRITICAL RULE:\n"
|
|
921
921
|
" Only output the promise when it is completely and unequivocally TRUE.\n"
|
|
922
922
|
" Cancel by deleting .codexapi/ralph-loop.local.md or running codexapi ralph --cancel.\n"
|
|
923
|
-
" Default
|
|
924
|
-
"
|
|
923
|
+
" Default starts each iteration with a fresh Agent context; use --ralph-reuse\n"
|
|
924
|
+
" to reuse a single Codex thread across iterations.\n"
|
|
925
925
|
)
|
|
926
926
|
parser = argparse.ArgumentParser(
|
|
927
927
|
prog="codexapi",
|
|
@@ -1026,10 +1026,20 @@ def main(argv=None):
|
|
|
1026
1026
|
"--completion-promise",
|
|
1027
1027
|
help="Promise text to match in <promise>...</promise>.",
|
|
1028
1028
|
)
|
|
1029
|
-
ralph_parser.
|
|
1029
|
+
ralph_fresh_group = ralph_parser.add_mutually_exclusive_group()
|
|
1030
|
+
ralph_fresh_group.add_argument(
|
|
1030
1031
|
"--ralph-fresh",
|
|
1031
1032
|
action="store_true",
|
|
1032
|
-
|
|
1033
|
+
dest="ralph_fresh",
|
|
1034
|
+
default=None,
|
|
1035
|
+
help="Start each iteration with a fresh Agent context (default).",
|
|
1036
|
+
)
|
|
1037
|
+
ralph_fresh_group.add_argument(
|
|
1038
|
+
"--ralph-reuse",
|
|
1039
|
+
action="store_false",
|
|
1040
|
+
dest="ralph_fresh",
|
|
1041
|
+
default=None,
|
|
1042
|
+
help="Reuse the same Agent context each iteration.",
|
|
1033
1043
|
)
|
|
1034
1044
|
ralph_parser.add_argument("--cwd", help="Working directory for the Codex session.")
|
|
1035
1045
|
ralph_parser.add_argument(
|
|
@@ -1104,12 +1114,16 @@ def main(argv=None):
|
|
|
1104
1114
|
if args.cancel:
|
|
1105
1115
|
if args.prompt:
|
|
1106
1116
|
raise SystemExit("ralph --cancel takes no prompt.")
|
|
1107
|
-
if args.completion_promise or args.ralph_fresh:
|
|
1108
|
-
raise SystemExit(
|
|
1117
|
+
if args.completion_promise or args.ralph_fresh is not None:
|
|
1118
|
+
raise SystemExit(
|
|
1119
|
+
"--completion-promise/--ralph-fresh/--ralph-reuse are not allowed with --cancel."
|
|
1120
|
+
)
|
|
1109
1121
|
if args.max_iterations != 0:
|
|
1110
1122
|
raise SystemExit("--max-iterations is not allowed with --cancel.")
|
|
1111
1123
|
print(cancel_ralph_loop(args.cwd))
|
|
1112
1124
|
return
|
|
1125
|
+
if args.ralph_fresh is None:
|
|
1126
|
+
args.ralph_fresh = True
|
|
1113
1127
|
|
|
1114
1128
|
if args.command == "task" and args.task_file:
|
|
1115
1129
|
if args.prompt:
|
|
@@ -19,7 +19,7 @@ def run_ralph_loop(
|
|
|
19
19
|
flags=None,
|
|
20
20
|
max_iterations=0,
|
|
21
21
|
completion_promise=None,
|
|
22
|
-
fresh=
|
|
22
|
+
fresh=True,
|
|
23
23
|
):
|
|
24
24
|
"""Run a Ralph Wiggum-style loop that repeats the same prompt.
|
|
25
25
|
|
|
@@ -37,8 +37,8 @@ def run_ralph_loop(
|
|
|
37
37
|
may ONLY output it when the statement is completely and unequivocally TRUE.
|
|
38
38
|
Do not output false promises to escape the loop.
|
|
39
39
|
|
|
40
|
-
By default
|
|
41
|
-
`fresh=
|
|
40
|
+
By default each iteration uses a fresh Agent for a clean context. Set
|
|
41
|
+
`fresh=False` to reuse a single Agent instance for shared context.
|
|
42
42
|
Cancel by deleting the state file or running `codexapi ralph --cancel`.
|
|
43
43
|
"""
|
|
44
44
|
if not isinstance(prompt, str) or not prompt.strip():
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: codexapi
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.1
|
|
4
4
|
Summary: Minimal Python API for running the Codex CLI.
|
|
5
5
|
License: MIT
|
|
6
6
|
Keywords: codex,agent,cli,openai
|
|
@@ -93,10 +93,12 @@ Use `--no-yolo` to run Codex with `--full-auto` instead.
|
|
|
93
93
|
Ralph loop mode repeats the same prompt until a completion promise or a max
|
|
94
94
|
iteration cap is hit (0 means unlimited). Cancel by deleting
|
|
95
95
|
`.codexapi/ralph-loop.local.md` or running `codexapi ralph --cancel`.
|
|
96
|
+
By default each iteration starts with a fresh Agent context; use
|
|
97
|
+
`--ralph-reuse` to keep a single shared context across iterations.
|
|
96
98
|
|
|
97
99
|
```bash
|
|
98
100
|
codexapi ralph "Fix the bug." --completion-promise DONE --max-iterations 5
|
|
99
|
-
codexapi ralph --ralph-
|
|
101
|
+
codexapi ralph --ralph-reuse "Try again from the same context." --max-iterations 3
|
|
100
102
|
codexapi ralph --cancel --cwd /path/to/project
|
|
101
103
|
```
|
|
102
104
|
|
|
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
|