codexapi 0.3.0__tar.gz → 0.3.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.3.0/src/codexapi.egg-info → codexapi-0.3.1}/PKG-INFO +1 -1
- {codexapi-0.3.0 → codexapi-0.3.1}/pyproject.toml +1 -1
- {codexapi-0.3.0 → codexapi-0.3.1}/src/codexapi/__init__.py +1 -1
- {codexapi-0.3.0 → codexapi-0.3.1}/src/codexapi/cli.py +17 -6
- {codexapi-0.3.0 → codexapi-0.3.1/src/codexapi.egg-info}/PKG-INFO +1 -1
- {codexapi-0.3.0 → codexapi-0.3.1}/LICENSE +0 -0
- {codexapi-0.3.0 → codexapi-0.3.1}/README.md +0 -0
- {codexapi-0.3.0 → codexapi-0.3.1}/setup.cfg +0 -0
- {codexapi-0.3.0 → codexapi-0.3.1}/src/codexapi/__main__.py +0 -0
- {codexapi-0.3.0 → codexapi-0.3.1}/src/codexapi/agent.py +0 -0
- {codexapi-0.3.0 → codexapi-0.3.1}/src/codexapi/ralph.py +0 -0
- {codexapi-0.3.0 → codexapi-0.3.1}/src/codexapi/task.py +0 -0
- {codexapi-0.3.0 → codexapi-0.3.1}/src/codexapi.egg-info/SOURCES.txt +0 -0
- {codexapi-0.3.0 → codexapi-0.3.1}/src/codexapi.egg-info/dependency_links.txt +0 -0
- {codexapi-0.3.0 → codexapi-0.3.1}/src/codexapi.egg-info/entry_points.txt +0 -0
- {codexapi-0.3.0 → codexapi-0.3.1}/src/codexapi.egg-info/top_level.txt +0 -0
|
@@ -224,19 +224,20 @@ def _is_session_file(path, root_str):
|
|
|
224
224
|
|
|
225
225
|
def _list_codex_processes():
|
|
226
226
|
result = subprocess.run(
|
|
227
|
-
["ps", "-ax", "-o", "pid=,ppid=,comm=,args="],
|
|
227
|
+
["ps", "-ax", "-o", "pid=,ppid=,uid=,comm=,args="],
|
|
228
228
|
capture_output=True,
|
|
229
229
|
text=True,
|
|
230
230
|
)
|
|
231
231
|
if result.returncode != 0:
|
|
232
232
|
return []
|
|
233
|
+
current_uid = os.getuid()
|
|
233
234
|
processes = []
|
|
234
235
|
for line in result.stdout.splitlines():
|
|
235
236
|
line = line.strip()
|
|
236
237
|
if not line:
|
|
237
238
|
continue
|
|
238
|
-
parts = line.split(None,
|
|
239
|
-
if len(parts) <
|
|
239
|
+
parts = line.split(None, 4)
|
|
240
|
+
if len(parts) < 4:
|
|
240
241
|
continue
|
|
241
242
|
try:
|
|
242
243
|
pid = int(parts[0])
|
|
@@ -246,8 +247,14 @@ def _list_codex_processes():
|
|
|
246
247
|
ppid = int(parts[1])
|
|
247
248
|
except ValueError:
|
|
248
249
|
continue
|
|
249
|
-
|
|
250
|
-
|
|
250
|
+
try:
|
|
251
|
+
uid = int(parts[2])
|
|
252
|
+
except ValueError:
|
|
253
|
+
continue
|
|
254
|
+
if uid != current_uid:
|
|
255
|
+
continue
|
|
256
|
+
comm = parts[3]
|
|
257
|
+
args = parts[4] if len(parts) > 4 else ""
|
|
251
258
|
if comm == "codex" or re.search(r"(^|[\\s/])codex(\\s|$)", args):
|
|
252
259
|
processes.append({"pid": pid, "ppid": ppid, "comm": comm, "args": args})
|
|
253
260
|
return processes
|
|
@@ -273,7 +280,11 @@ def _process_session_files(pid, root):
|
|
|
273
280
|
|
|
274
281
|
proc_fd = Path(f"/proc/{pid}/fd")
|
|
275
282
|
if proc_fd.exists():
|
|
276
|
-
|
|
283
|
+
try:
|
|
284
|
+
entries = list(proc_fd.iterdir())
|
|
285
|
+
except OSError:
|
|
286
|
+
return paths
|
|
287
|
+
for entry in entries:
|
|
277
288
|
try:
|
|
278
289
|
target = os.readlink(entry)
|
|
279
290
|
except OSError:
|
|
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
|