python-codex 0.4.6__py3-none-any.whl → 0.4.7__py3-none-any.whl

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.
@@ -163,6 +163,7 @@ class SessionRolloutRecorder:
163
163
  def list_resumable_sessions(
164
164
  codex_home: "Path",
165
165
  limit: "int" = 20,
166
+ session_id: "typing.Union[str, None]" = None,
166
167
  ) -> "typing.Tuple[typing.Dict[str, str], ...]":
167
168
  latest_rollouts_by_id: "typing.Dict[str, Path]" = {}
168
169
  for dirname in ROLLUP_SESSION_DIRNAMES:
@@ -173,6 +174,8 @@ def list_resumable_sessions(
173
174
  thread_id = _thread_id_from_rollout_path(path)
174
175
  if thread_id is None:
175
176
  continue
177
+ if session_id is not None and thread_id.lower() != session_id.lower():
178
+ continue
176
179
  previous = latest_rollouts_by_id.get(thread_id)
177
180
  if previous is None or path.stat().st_mtime > previous.stat().st_mtime:
178
181
  latest_rollouts_by_id[thread_id] = path
@@ -202,11 +205,16 @@ def list_resumable_sessions(
202
205
 
203
206
  def select_resumable_session(
204
207
  codex_home: "Path",
205
- resume_index_text: "str",
208
+ resume_target: "str",
206
209
  ) -> "typing.Dict[str, str]":
207
- normalized_target = resume_index_text.strip()
210
+ normalized_target = resume_target.strip()
211
+ if UUID_PATTERN.fullmatch(normalized_target):
212
+ sessions = list_resumable_sessions(codex_home, 1, normalized_target)
213
+ if not sessions:
214
+ raise ValueError(f"Session not found: {normalized_target}")
215
+ return sessions[0]
208
216
  if not normalized_target.isdigit():
209
- raise ValueError("Usage: /resume <number>")
217
+ raise ValueError("Usage: /resume <number|session_id>")
210
218
 
211
219
  sessions = list_resumable_sessions(codex_home)
212
220
  resume_index = int(normalized_target)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-codex
3
- Version: 0.4.6
3
+ Version: 0.4.7
4
4
  Summary: A minimal Python extraction of Codex's main agent loop
5
5
  License-File: LICENSE
6
6
  Requires-Python: >=3.6.2
@@ -387,8 +387,10 @@ Current behavior:
387
387
  `model:effort`.
388
388
  - `/resume` with no argument lists the currently resumable sessions by their
389
389
  first user-message preview; `/resume 1` resumes the first listed session
390
- - `/resume <number>` replaces the in-memory history with the selected recorded
391
- Codex rollout from `CODEX_HOME/sessions`. Tool calls without recorded results
390
+ - `/resume <session_id>` accepts a full session UUID, including sessions older
391
+ than the displayed list. Both forms search `CODEX_HOME/sessions` and
392
+ `CODEX_HOME/archived_sessions` and replace the in-memory history with the
393
+ selected recorded Codex rollout. Tool calls without recorded results
392
394
  are omitted during restore; later saved messages and completed tools remain
393
395
  available, and the source file is left intact.
394
396
  - `/compact` synthesizes a local handoff summary, replaces the in-memory
@@ -62,7 +62,7 @@ pycodex/utils/get_env.py,sha256=L4S8h84tkgxZKvrxY7ezTgePbXepG-yIigUTKeY6uuE,6094
62
62
  pycodex/utils/image_utils.py,sha256=OUzUs0Cow4L8Z2np0EBeEUotAqqsCmRmhrV8AxZUXRw,2460
63
63
  pycodex/utils/model_metadata.py,sha256=uK3iI4yC7Ge7yN4I1_gQYalQ4MYKddz2qMwsmQb-P80,1337
64
64
  pycodex/utils/random_ids.py,sha256=jLTxZZ0MBbRdQOFDFWGVRjWzIo6FKSQ5ADXbQSLPp1s,379
65
- pycodex/utils/session_persist.py,sha256=_7Lz1jO7D0Qf16UVuZBKU_Si-k_cUVinnLMlsd1jVj4,23600
65
+ pycodex/utils/session_persist.py,sha256=P-tsYdb1r0Ca_mVgTcK24bZM09zR-tNFgoFXlVIn5Q0,24012
66
66
  pycodex/utils/truncation.py,sha256=5D6vAorT8EgXgjd7ASwtraAyIZdlCR-w5jKZqJxDzho,5446
67
67
  pycodex/utils/_aes_gcm/LICENSE,sha256=KvdHagY3sYIK34GldJaRi34sNnGwMVJIIoDhbC9MRu8,2805
68
68
  pycodex/utils/_aes_gcm/README.md,sha256=D9XGeewCgU2PVqJCO6WusUs0Mw2FbMnABCqaVktqCnE,3045
@@ -83,8 +83,8 @@ responses_server/trajectory_dump.py,sha256=5_Wy6tslszrqx3j1JeP_boyTbzIicKy8No84P
83
83
  responses_server/tools/__init__.py,sha256=ivsBSEy0SBUhY-Uea5v1XMLXShkwHdCVl0id-1FwdZg,150
84
84
  responses_server/tools/custom_adapter.py,sha256=SnIiNUdomff3APtTriURAC9YCeEdhCDjzGMEYusfUdk,8340
85
85
  responses_server/tools/web_search.py,sha256=pnKH9JyTScRehWpZS3HpXRvjWsQvC0QZqxjEOCT4ndg,8936
86
- python_codex-0.4.6.dist-info/METADATA,sha256=uC7ydz7Y3S65w0jugBRDWho_eH7-zTfD_wWjt93qG90,47911
87
- python_codex-0.4.6.dist-info/WHEEL,sha256=KGYbc1zXlYddvwxnNty23BeaKzh7YuoSIvIMO4jEhvw,87
88
- python_codex-0.4.6.dist-info/entry_points.txt,sha256=sNUVakoVuTrzJH505ZgRTQxmtRRPUHV_EH0i6EbYTyM,45
89
- python_codex-0.4.6.dist-info/licenses/LICENSE,sha256=0X8ifk312hYAORM4hlzg8wVSEXYKNmiPgWlB1YIy2Nw,10926
90
- python_codex-0.4.6.dist-info/RECORD,,
86
+ python_codex-0.4.7.dist-info/METADATA,sha256=vJgPquHMbmWwNuGdS_iP1KP8vvS4rApkjHPtKMfJU0M,48049
87
+ python_codex-0.4.7.dist-info/WHEEL,sha256=KGYbc1zXlYddvwxnNty23BeaKzh7YuoSIvIMO4jEhvw,87
88
+ python_codex-0.4.7.dist-info/entry_points.txt,sha256=sNUVakoVuTrzJH505ZgRTQxmtRRPUHV_EH0i6EbYTyM,45
89
+ python_codex-0.4.7.dist-info/licenses/LICENSE,sha256=0X8ifk312hYAORM4hlzg8wVSEXYKNmiPgWlB1YIy2Nw,10926
90
+ python_codex-0.4.7.dist-info/RECORD,,