teknium1
c42fa94afc
refactor(run_agent): extract Codex runtime + assorted helpers to dedicated modules
Two new modules:
* agent/codex_runtime.py — three Codex API-mode methods
- run_codex_app_server_turn (148 LOC) — Codex CLI subprocess driver
- run_codex_stream (125 LOC) — Codex Responses API stream
- run_codex_create_stream_fallback (78 LOC) — fallback after Responses
stream=true initial create failure
* agent/agent_runtime_helpers.py — twelve assorted AIAgent helpers
totalling ~1,166 LOC: convert_to_trajectory_format, sanitize_tool_call_arguments
(static), repair_message_sequence, strip_think_blocks,
recover_with_credential_pool, try_recover_primary_transport,
drop_thinking_only_and_merge_users (static), restore_primary_runtime,
extract_reasoning, dump_api_request_debug,
anthropic_prompt_cache_policy, create_openai_client
AIAgent keeps thin forwarder methods for all 15 (preserving @staticmethod
where needed). Symbols tests patch on run_agent (OpenAI, AIAgent class
attrs) are routed through _ra() to honor the patch contract. The
_TRANSIENT_TRANSPORT_ERRORS frozenset moves with try_recover_primary_transport
and is referenced as a module-level constant in the extracted code.
tests/run_agent/ + tests/agent/: 4313 passed (same pre-existing
test_auxiliary_client failure).
run_agent.py: 11391 -> 9887 lines (-1504).
2026-05-16 19:03:30 -07:00
..
2026-05-14 15:56:07 -07:00
2026-05-14 14:55:23 -07:00
2026-02-21 22:31:43 -08:00
2026-05-11 11:13:25 -07:00
2026-05-16 19:03:30 -07:00
2026-05-12 20:46:04 -07:00
2026-05-14 20:15:29 -07:00
2026-05-16 18:05:01 -07:00
2026-05-07 05:17:16 -07:00
2026-05-16 18:48:22 -07:00
2026-05-09 21:06:19 -07:00
2026-05-16 19:03:30 -07:00
2026-05-14 14:28:14 -07:00
2026-05-13 22:25:16 -07:00
2026-04-20 01:56:41 -07:00
2026-05-16 18:09:33 -07:00
2026-05-08 14:27:40 -07:00
2026-05-11 11:13:25 -07:00
2026-04-29 09:53:42 -07:00
2026-05-02 01:29:57 -07:00
2026-05-10 06:44:53 -07:00
2026-05-15 10:36:38 +05:30
2026-05-11 11:13:25 -07:00
2026-04-21 01:31:58 -07:00
2026-05-14 08:03:56 -07:00
2026-05-11 11:13:20 -07:00
2026-04-28 06:46:45 -07:00
2026-04-28 06:46:45 -07:00
2026-05-04 03:16:19 -07:00
2026-05-10 07:14:14 -07:00
2026-04-21 21:30:10 -07:00
2026-05-13 22:31:28 -07:00
2026-05-11 11:13:25 -07:00
2026-04-20 05:25:49 -07:00
2026-05-16 17:59:32 -07:00
2026-04-28 12:27:36 -07:00
2026-04-30 23:03:54 -07:00
2026-05-11 16:49:13 -07:00
2026-05-11 11:13:25 -07:00
2026-05-05 13:33:49 -07:00
2026-05-16 17:41:09 -07:00
2026-05-13 23:51:15 -07:00
2026-05-13 23:51:15 -07:00
2026-05-11 11:13:25 -07:00
2026-05-08 14:27:40 -07:00
2026-04-29 08:08:36 -07:00
2026-05-10 07:09:28 -07:00
2026-05-12 20:49:20 -07:00
2026-05-16 17:59:32 -07:00
2026-05-12 18:46:28 -07:00
2026-05-12 20:46:04 -07:00
2026-04-13 16:32:04 -07:00
2026-05-11 11:13:25 -07:00
2026-04-08 00:41:36 -07:00
2026-05-11 11:13:25 -07:00
2026-05-11 11:13:25 -07:00
2026-04-24 15:15:07 -07:00
2026-05-08 16:39:32 -07:00
2026-05-16 18:28:17 -07:00
2026-04-09 03:10:30 -07:00
2026-05-16 18:16:20 -07:00
2026-05-05 04:33:38 -07:00
2026-05-04 12:07:17 -07:00
2026-05-16 17:54:26 -07:00
2026-05-16 18:24:05 -07:00
2026-05-13 06:46:23 -07:00
2026-05-13 06:46:23 -07:00
2026-02-21 22:31:43 -08:00
2026-05-12 16:32:57 -07:00
2026-05-13 16:39:41 -07:00
2026-05-13 16:39:41 -07:00
2026-05-13 22:31:28 -07:00
2026-05-13 22:31:28 -07:00