From 43ee0dfd195d4c97e4ec57ceb0f015b19f8e585b Mon Sep 17 00:00:00 2001 From: jif-oai Date: Tue, 14 Oct 2025 13:14:47 +0100 Subject: [PATCH] V12 --- codex-rs/codex-infty/src/orchestrator.rs | 36 +++++++++++++++----- codex-rs/codex-infty/src/prompts/director.rs | 1 - codex-rs/codex-infty/src/prompts/mod.rs | 10 ++---- codex-rs/codex-infty/src/prompts/solver.md | 3 +- codex-rs/codex-infty/src/prompts/solver.rs | 1 - codex-rs/codex-infty/src/prompts/verifier.md | 1 + codex-rs/codex-infty/src/prompts/verifier.rs | 1 - codex-rs/core/src/openai_model_info.rs | 6 +++- 8 files changed, 38 insertions(+), 21 deletions(-) delete mode 100644 codex-rs/codex-infty/src/prompts/director.rs delete mode 100644 codex-rs/codex-infty/src/prompts/solver.rs delete mode 100644 codex-rs/codex-infty/src/prompts/verifier.rs diff --git a/codex-rs/codex-infty/src/orchestrator.rs b/codex-rs/codex-infty/src/orchestrator.rs index 0384011519..c94cf4fe6d 100644 --- a/codex-rs/codex-infty/src/orchestrator.rs +++ b/codex-rs/codex-infty/src/orchestrator.rs @@ -84,6 +84,8 @@ struct VerificationRequestPayload<'a> { claim_path: &'a str, #[serde(skip_serializing_if = "Option::is_none")] notes: Option<&'a str>, + #[serde(skip_serializing_if = "Option::is_none")] + objective: Option<&'a str>, } struct SessionCleanup { @@ -525,8 +527,14 @@ impl InftyOrchestrator { notes: Option<&str>, options: &RunExecutionOptions, ) -> Result { + let objective = options + .objective + .as_deref() + .map(str::trim) + .filter(|objective| !objective.is_empty()); + let summary = self - .collect_verification_summary(sessions, claim_path, notes, options) + .collect_verification_summary(sessions, claim_path, notes, objective, options) .await?; self.emit_verification_summary(&summary); self.post_verification_summary_to_solver(sessions, &summary) @@ -547,17 +555,25 @@ impl InftyOrchestrator { .and_then(|p| p.to_str().map(|s| s.to_string())); let claim_path = relative.unwrap_or_else(|| deliverable_path.display().to_string()); + let objective = options + .objective + .as_deref() + .map(str::trim) + .filter(|objective| !objective.is_empty()); + let summary_result = self - .collect_verification_summary(sessions, claim_path.as_str(), summary, options) + .collect_verification_summary( + sessions, + claim_path.as_str(), + summary, + objective, + options, + ) .await?; self.emit_verification_summary(&summary_result); - if summary_result.overall.is_pass() { - Ok(true) - } else { - self.post_verification_summary_to_solver(sessions, &summary_result) - .await?; - Ok(false) - } + self.post_verification_summary_to_solver(sessions, &summary_result) + .await?; + Ok(summary_result.overall.is_pass()) } async fn request_solver_signal(&self, run_id: &str, solver_role: &str) -> Result<()> { @@ -580,6 +596,7 @@ impl InftyOrchestrator { sessions: &RunSessions, claim_path: &str, notes: Option<&str>, + objective: Option<&str>, options: &RunExecutionOptions, ) -> Result { if sessions.verifiers.is_empty() { @@ -590,6 +607,7 @@ impl InftyOrchestrator { kind: "verification_request", claim_path, notes, + objective, }; let request_text = serde_json::to_string_pretty(&request)?; let mut collected = Vec::with_capacity(sessions.verifiers.len()); diff --git a/codex-rs/codex-infty/src/prompts/director.rs b/codex-rs/codex-infty/src/prompts/director.rs deleted file mode 100644 index 0e40ce976a..0000000000 --- a/codex-rs/codex-infty/src/prompts/director.rs +++ /dev/null @@ -1 +0,0 @@ -pub(crate) const DIRECTOR_PROMPT: &str = include_str!("director.md"); diff --git a/codex-rs/codex-infty/src/prompts/mod.rs b/codex-rs/codex-infty/src/prompts/mod.rs index 34c02d105d..0eb4d6b76f 100644 --- a/codex-rs/codex-infty/src/prompts/mod.rs +++ b/codex-rs/codex-infty/src/prompts/mod.rs @@ -1,12 +1,8 @@ use codex_core::config::Config; +pub(crate) const DIRECTOR_PROMPT: &str = include_str!("director.md"); +pub(crate) const SOLVER_PROMPT: &str = include_str!("solver.md"); +pub(crate) const VERIFIER_PROMPT: &str = include_str!("verifier.md"); -mod director; -mod solver; -mod verifier; - -pub(crate) use director::DIRECTOR_PROMPT; -pub(crate) use solver::SOLVER_PROMPT; -pub(crate) use verifier::VERIFIER_PROMPT; pub fn ensure_instructions(role: &str, config: &mut Config) { if config.base_instructions.is_none() diff --git a/codex-rs/codex-infty/src/prompts/solver.md b/codex-rs/codex-infty/src/prompts/solver.md index ed1877435b..8c75d2116b 100644 --- a/codex-rs/codex-infty/src/prompts/solver.md +++ b/codex-rs/codex-infty/src/prompts/solver.md @@ -1,6 +1,7 @@ # Codex Infty Solver -You are the **Solver** role in a Codex Infty run. Drive the engagement end to end without waiting for humans. Maintain momentum for multi-hour or multi-day efforts. +You are a brilliant mathematician that will try to tackle some of the most difficult problems in the world with new approach that humans never tried. +You have the **Solver** role in a Codex Infty run. Drive the engagement end to end without waiting for humans. Maintain momentum for multi-hour or multi-day efforts. Responsibilities: - Understand the objective and break it into a living execution plan. Refine plans with `update_plan` and keep the run store up to date. diff --git a/codex-rs/codex-infty/src/prompts/solver.rs b/codex-rs/codex-infty/src/prompts/solver.rs deleted file mode 100644 index f32b87b487..0000000000 --- a/codex-rs/codex-infty/src/prompts/solver.rs +++ /dev/null @@ -1 +0,0 @@ -pub(crate) const SOLVER_PROMPT: &str = include_str!("solver.md"); diff --git a/codex-rs/codex-infty/src/prompts/verifier.md b/codex-rs/codex-infty/src/prompts/verifier.md index 803bfc324c..02e0234cbb 100644 --- a/codex-rs/codex-infty/src/prompts/verifier.md +++ b/codex-rs/codex-infty/src/prompts/verifier.md @@ -6,6 +6,7 @@ Process: 1. Inspect the referenced claim JSON and any linked artifacts, tests, or logs inside the run store. 2. Reproduce evidence when feasible (e.g. run tests via `shell`). Exit early if sandbox restrictions apply and explain the limitation. 3. Evaluate correctness, completeness, and policy alignment. Look for missing tests, undocumented gaps, regressions, or unverifiable assertions. +4. Make sure the proposed solution actually solve the provided objective. Respond **only** with JSON in this form: ```json diff --git a/codex-rs/codex-infty/src/prompts/verifier.rs b/codex-rs/codex-infty/src/prompts/verifier.rs deleted file mode 100644 index 8932f08d8c..0000000000 --- a/codex-rs/codex-infty/src/prompts/verifier.rs +++ /dev/null @@ -1 +0,0 @@ -pub(crate) const VERIFIER_PROMPT: &str = include_str!("verifier.md"); diff --git a/codex-rs/core/src/openai_model_info.rs b/codex-rs/core/src/openai_model_info.rs index d1d2305aaa..53e7bd7741 100644 --- a/codex-rs/core/src/openai_model_info.rs +++ b/codex-rs/core/src/openai_model_info.rs @@ -68,7 +68,11 @@ pub(crate) fn get_model_info(model_family: &ModelFamily) -> Option { auto_compact_token_limit: Some(350_000), }), - _ if slug.starts_with("gpt-5") => Some(ModelInfo::new(272_000, 128_000)), + _ if slug.starts_with("gpt-5") => Some(ModelInfo { + context_window: 272_000, + max_output_tokens: 128_000, + auto_compact_token_limit: Some(250_000), + }), _ if slug.starts_with("codex-") => Some(ModelInfo::new(272_000, 128_000)),