mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
dcab40123f
## Summary - Add agent job support: spawn a batch of sub-agents from CSV, auto-run, auto-export, and store results in SQLite. - Simplify workflow: remove run/resume/get-status/export tools; spawn is deterministic and completes in one call. - Improve exec UX: stable, single-line progress bar with ETA; suppress sub-agent chatter in exec. ## Why Enables map-reduce style workflows over arbitrarily large repos using the existing Codex orchestrator. This addresses review feedback about overly complex job controls and non-deterministic monitoring. ## Demo (progress bar) ``` ./codex-rs/target/debug/codex exec \ --enable collab \ --enable sqlite \ --full-auto \ --progress-cursor \ -c agents.max_threads=16 \ -C /Users/daveaitel/code/codex \ - <<'PROMPT' Create /tmp/agent_job_progress_demo.csv with columns: path,area and 30 rows: path = item-01..item-30, area = test. Then call spawn_agents_on_csv with: - csv_path: /tmp/agent_job_progress_demo.csv - instruction: "Run `python - <<'PY'` to sleep a random 0.3–1.2s, then output JSON with keys: path, score (int). Set score = 1." - output_csv_path: /tmp/agent_job_progress_demo_out.csv PROMPT ``` ## Review feedback addressed - Auto-start jobs on spawn; removed run/resume/status/export tools. - Auto-export on success. - More descriptive tool spec + clearer prompts. - Avoid deadlocks on spawn failure; pending/running handled safely. - Progress bar no longer scrolls; stable single-line redraw. ## Tests - `cd codex-rs && cargo test -p codex-exec` - `cd codex-rs && cargo build -p codex-cli`
38 lines
1.2 KiB
Rust
38 lines
1.2 KiB
Rust
mod agent_job;
|
|
mod backfill_state;
|
|
mod log;
|
|
mod memories;
|
|
mod thread_metadata;
|
|
|
|
pub use agent_job::AgentJob;
|
|
pub use agent_job::AgentJobCreateParams;
|
|
pub use agent_job::AgentJobItem;
|
|
pub use agent_job::AgentJobItemCreateParams;
|
|
pub use agent_job::AgentJobItemStatus;
|
|
pub use agent_job::AgentJobProgress;
|
|
pub use agent_job::AgentJobStatus;
|
|
pub use backfill_state::BackfillState;
|
|
pub use backfill_state::BackfillStatus;
|
|
pub use log::LogEntry;
|
|
pub use log::LogQuery;
|
|
pub use log::LogRow;
|
|
pub use memories::Phase2JobClaimOutcome;
|
|
pub use memories::Stage1JobClaim;
|
|
pub use memories::Stage1JobClaimOutcome;
|
|
pub use memories::Stage1Output;
|
|
pub use memories::Stage1StartupClaimParams;
|
|
pub use thread_metadata::Anchor;
|
|
pub use thread_metadata::BackfillStats;
|
|
pub use thread_metadata::ExtractionOutcome;
|
|
pub use thread_metadata::SortKey;
|
|
pub use thread_metadata::ThreadMetadata;
|
|
pub use thread_metadata::ThreadMetadataBuilder;
|
|
pub use thread_metadata::ThreadsPage;
|
|
|
|
pub(crate) use agent_job::AgentJobItemRow;
|
|
pub(crate) use agent_job::AgentJobRow;
|
|
pub(crate) use memories::Stage1OutputRow;
|
|
pub(crate) use thread_metadata::ThreadRow;
|
|
pub(crate) use thread_metadata::anchor_from_item;
|
|
pub(crate) use thread_metadata::datetime_to_epoch_seconds;
|