From dd63d61a5927683195fd03f6689dfd1304d4d882 Mon Sep 17 00:00:00 2001 From: Michael Bolin Date: Thu, 14 Aug 2025 17:44:10 -0700 Subject: [PATCH 1/2] fix: trying to simplify rust-ci.yml (#2327) It turns out that https://github.com/openai/codex/pull/2324 did not quite work as intended. Chat's new idea is to have this catch-all "CI results" job and update our branch protection rules to require this instead. --- .github/workflows/rust-ci.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/workflows/rust-ci.yml b/.github/workflows/rust-ci.yml index 1861233abf..fd8340a083 100644 --- a/.github/workflows/rust-ci.yml +++ b/.github/workflows/rust-ci.yml @@ -69,6 +69,7 @@ jobs: runs-on: ${{ matrix.runner }} timeout-minutes: 30 needs: changed + # Keep job-level if to avoid spinning up runners when not needed if: ${{ needs.changed.outputs.codex == 'true' || needs.changed.outputs.workflows == 'true' || github.event_name == 'push' }} defaults: run: @@ -166,3 +167,27 @@ jobs: run: | echo "One or more checks failed (clippy, build, or test). See logs for details." exit 1 + + # --- Gatherer job that you mark as the ONLY required status ----------------- + results: + name: CI results (required) + needs: [changed, general, lint_build_test] + if: always() + runs-on: ubuntu-24.04 + steps: + - name: Summarize + shell: bash + run: | + echo "general: ${{ needs.general.result }}" + echo "matrix : ${{ needs.lint_build_test.result }}" + + # If nothing relevant changed (PR touching only root README, etc.), + # declare success regardless of other jobs. + if [[ '${{ needs.changed.outputs.codex }}' != 'true' && '${{ needs.changed.outputs.workflows }}' != 'true' && '${{ github.event_name }}' != 'push' ]]; then + echo 'No relevant changes -> CI not required.' + exit 0 + fi + + # Otherwise require the jobs to have succeeded + [[ '${{ needs.general.result }}' == 'success' ]] || { echo 'general failed'; exit 1; } + [[ '${{ needs.lint_build_test.result }}' == 'success' ]] || { echo 'matrix failed'; exit 1; } From b9e0f4741cf99a17c1e8363faecfa118a8b12008 Mon Sep 17 00:00:00 2001 From: Michael Bolin Date: Thu, 14 Aug 2025 17:45:19 -0700 Subject: [PATCH 2/2] feat: introduce Op:UserTurn --- codex-rs/core/src/protocol.rs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/codex-rs/core/src/protocol.rs b/codex-rs/core/src/protocol.rs index f32d9ccf53..0767ccdb95 100644 --- a/codex-rs/core/src/protocol.rs +++ b/codex-rs/core/src/protocol.rs @@ -46,6 +46,33 @@ pub enum Op { items: Vec, }, + /// Similar to [`Op::UserInput`], but contains additional context required + /// for a turn of a [`crate::codex_conversation::CodexConversation`]. + UserTurn { + /// User input items, see `InputItem` + items: Vec, + + /// `cwd` to use with the [`SandboxPolicy`] and potentially tool calls + /// such as `local_shell`. + cwd: PathBuf, + + /// Policy to use for command approval. + approval_policy: AskForApproval, + + /// Policy to use for tool calls such as `local_shell`. + sandbox_policy: SandboxPolicy, + + /// Must be a valid model slug for the [`crate::client::ModelClient`] + /// associated with this conversation. + model: String, + + /// Will only be honored if the model is configured to use reasoning. + effort: ReasoningEffortConfig, + + /// Will only be honored if the model is configured to use reasoning. + summary: ReasoningSummaryConfig, + }, + /// Approve a command execution ExecApproval { /// The id of the submission we are approving