Commit Graph

112 Commits

  • [codex] Update realtime V2 VAD silence delay and 1.5 prompt (#18092)
    ## Summary
    
    - set the realtime v2 server VAD silence delay to 500ms
    - update the default realtime 1.5 backend prompt to the v4 text
    - keep the session payload and prompt rendering tests aligned with those
    changes
    
    ## Why
    
    - the VAD change gives the voice path a longer pause before ending the
    user's turn
    - the prompt change makes the default bundled realtime prompt match the
    current v4 content
    
    ## Validation
    
    - `cargo +1.93.0 test -p codex-core realtime_prompt --manifest-path
    /tmp/codex-realtime-v2-vad-prompt-v4/codex-rs/Cargo.toml`
    - `CARGO_TARGET_DIR=/tmp/codex-pr-v4-target cargo +1.93.0 test -p
    codex-api
    realtime_v2_session_update_includes_background_agent_tool_and_handoff_output_item
    --manifest-path
    /tmp/codex-realtime-v2-vad-prompt-v4/codex-rs/Cargo.toml`
    - `CARGO_TARGET_DIR=/tmp/codex-pr-v4-target cargo +1.93.0 test -p
    codex-app-server --test all
    'suite::v2::realtime_conversation::realtime_webrtc_start_emits_sdp_notification'
    --manifest-path /tmp/codex-realtime-v2-vad-prompt-v4/codex-rs/Cargo.toml
    -- --exact`
  • fix (#17493)
    # External (non-OpenAI) Pull Request Requirements
    
    Before opening this Pull Request, please read the dedicated
    "Contributing" markdown file or your PR may be closed:
    https://github.com/openai/codex/blob/main/docs/contributing.md
    
    If your PR conforms to our contribution guidelines, replace this text
    with a detailed and high quality description of your changes.
    
    Include a link to a bug report or enhancement request.
  • Strengthen realtime backend delegation prompt (#17363)
    Encourages realtime prompt handling to delegate user requests to the
    backend agent by default when repo inspection, commands, implementation,
    or validation may help.
    
    Co-authored-by: Codex <noreply@openai.com>
  • [codex] add memory extensions (#16276)
    # External (non-OpenAI) Pull Request Requirements
    
    Before opening this Pull Request, please read the dedicated
    "Contributing" markdown file or your PR may be closed:
    https://github.com/openai/codex/blob/main/docs/contributing.md
    
    If your PR conforms to our contribution guidelines, replace this text
    with a detailed and high quality description of your changes.
    
    Include a link to a bug report or enhancement request.
  • Move default realtime prompt into core (#17165)
    - Adds a core-owned realtime backend prompt template and preparation
    path.
    - Makes omitted realtime start prompts use the core default, while null
    or empty prompts intentionally send empty instructions.
    - Covers the core realtime path and app-server v2 path with integration
    coverage.
    
    ---------
    
    Co-authored-by: Codex <noreply@openai.com>
  • codex debug 2 (guardian approved) (#17118)
    Removes lines 8-14 from core/templates/agents/orchestrator.md.
  • codex debug 15 (guardian approved) (#17131)
    Removes lines 99-106 from core/templates/agents/orchestrator.md.
  • codex debug 13 (guardian approved) (#17129)
    Removes lines 85-91 from core/templates/agents/orchestrator.md.
  • codex debug 11 (guardian approved) (#17127)
    Removes lines 71-77 from core/templates/agents/orchestrator.md.
  • codex debug 9 (guardian approved) (#17125)
    Removes lines 57-63 from core/templates/agents/orchestrator.md.
  • codex debug 7 (guardian approved) (#17123)
    Removes lines 43-49 from core/templates/agents/orchestrator.md.
  • codex debug 5 (guardian approved) (#17121)
    Removes lines 29-35 from core/templates/agents/orchestrator.md.
  • codex debug 3 (guardian approved) (#17119)
    Removes lines 15-21 from core/templates/agents/orchestrator.md.
  • codex debug 1 (guardian approved) (#17117)
    Removes lines 1-7 from core/templates/agents/orchestrator.md.
  • extract models manager and related ownership from core (#16508)
    ## Summary
    - split `models-manager` out of `core` and add `ModelsManagerConfig`
    plus `Config::to_models_manager_config()` so model metadata paths stop
    depending on `core::Config`
    - move login-owned/auth-owned code out of `core` into `codex-login`,
    move model provider config into `codex-model-provider-info`, move API
    bridge mapping into `codex-api`, move protocol-owned types/impls into
    `codex-protocol`, and move response debug helpers into a dedicated
    `response-debug-context` crate
    - move feedback tag emission into `codex-feedback`, relocate tests to
    the crates that now own the code, and keep broad temporary re-exports so
    this PR avoids a giant import-only rewrite
    
    ## Major moves and decisions
    - created `codex-models-manager` as the owner for model
    cache/catalog/config/model info logic, including the new
    `ModelsManagerConfig` struct
    - created `codex-model-provider-info` as the owner for provider config
    parsing/defaults and kept temporary `codex-login`/`codex-core`
    re-exports for old import paths
    - moved `api_bridge` error mapping + `CoreAuthProvider` into
    `codex-api`, while `codex-login::api_bridge` temporarily re-exports
    those symbols and keeps the `auth_provider_from_auth` wrapper
    - moved `auth_env_telemetry` and `provider_auth` ownership to
    `codex-login`
    - moved `CodexErr` ownership to `codex-protocol::error`, plus
    `StreamOutput`, `bytes_to_string_smart`, and network policy helpers to
    protocol-owned modules
    - created `codex-response-debug-context` for
    `extract_response_debug_context`, `telemetry_transport_error_message`,
    and related response-debug plumbing instead of leaving that behavior in
    `core`
    - moved `FeedbackRequestTags`, `emit_feedback_request_tags`, and
    `emit_feedback_request_tags_with_auth_env` to `codex-feedback`
    - deferred removal of temporary re-exports and the mechanical import
    rewrites to a stacked follow-up PR so this PR stays reviewable
    
    ## Test moves
    - moved auth refresh coverage from `core/tests/suite/auth_refresh.rs` to
    `login/tests/suite/auth_refresh.rs`
    - moved text encoding coverage from
    `core/tests/suite/text_encoding_fix.rs` to
    `protocol/src/exec_output_tests.rs`
    - moved model info override coverage from
    `core/tests/suite/model_info_overrides.rs` to
    `models-manager/src/model_info_overrides_tests.rs`
    
    ---------
    
    Co-authored-by: Codex <noreply@openai.com>
  • [plugins] Polish tool suggest prompts. (#15891)
    - [x] Polish tool suggest prompts to distinguish between missing
    connectors and discoverable plugins, and be very precise about the
    triggering conditions.
  • [apps][tool_suggest] Remove tool_suggest's dependency on tool search. (#14856)
    - [x] Remove tool_suggest's dependency on tool search.
  • [apps] Add tool call meta. (#14647)
    - [x] Add resource_uri and other things to _meta to shortcut resource
    lookup and speed things up.
  • Rename multi-agent wait tool to wait_agent (#14631)
    - rename the multi-agent tool name the model sees to wait_agent
    - update the model-facing prompts and tool descriptions to match
    
    ---------
    
    Co-authored-by: Codex <noreply@openai.com>
  • Update tool search prompts (#14500)
    - [x] Add mentions of connectors because model always think in connector
    terms in its CoT.
    - [x] Suppress list_mcp_resources in favor of tool search for available
    apps.
  • memories: focus write prompts on user preferences (#14493)
    ## Summary
    - update `codex-rs/core/templates/memories/stage_one_system.md` so phase
    1 captures stronger user-preference signals, richer task summaries, and
    cwd provenance without branch-specific fields
    - update `codex-rs/core/templates/memories/consolidation.md` so phase 2
    keeps separate sections for user preferences, reusable knowledge, and
    failure shields while staying cwd-aware but branchless
    - document the `codex` prompt-template maintenance rule in
    `codex-rs/core/src/memories/README.md`: the undated templates are
    canonical here and should be edited in place
    
    ## Testing
    - cargo test -p codex-core memories --manifest-path codex-rs/Cargo.toml
  • [apps] Add tool_suggest tool. (#14287)
    - [x] Add tool_suggest tool.
    - [x] Move chatgpt/src/connectors.rs and core/src/connectors.rs into a
    dedicated mod so that we have all the logic and global cache in one
    place.
    - [x] Update TUI app link view to support rendering the installation
    view for mcp elicitation.
    
    ---------
    
    Co-authored-by: Shaqayeq <shaqayeq@openai.com>
    Co-authored-by: Eric Traut <etraut@openai.com>
    Co-authored-by: pakrym-oai <pakrym@openai.com>
    Co-authored-by: Ahmed Ibrahim <aibrahim@openai.com>
    Co-authored-by: guinness-oai <guinness@openai.com>
    Co-authored-by: Eugene Brevdo <ebrevdo@users.noreply.github.com>
    Co-authored-by: Charlie Guo <cguo@openai.com>
    Co-authored-by: Fouad Matin <fouad@openai.com>
    Co-authored-by: Fouad Matin <169186268+fouad-openai@users.noreply.github.com>
    Co-authored-by: xl-openai <xl@openai.com>
    Co-authored-by: alexsong-oai <alexsong@openai.com>
    Co-authored-by: Owen Lin <owenlin0@gmail.com>
    Co-authored-by: sdcoffey <stevendcoffey@gmail.com>
    Co-authored-by: Codex <noreply@openai.com>
    Co-authored-by: Won Park <won@openai.com>
    Co-authored-by: Dylan Hurd <dylan.hurd@openai.com>
    Co-authored-by: celia-oai <celia@openai.com>
    Co-authored-by: gabec-openai <gabec@openai.com>
    Co-authored-by: joeytrasatti-openai <joey.trasatti@openai.com>
    Co-authored-by: Leo Shimonaka <leoshimo@openai.com>
    Co-authored-by: Rasmus Rygaard <rasmus@openai.com>
    Co-authored-by: maja-openai <163171781+maja-openai@users.noreply.github.com>
    Co-authored-by: pash-openai <pash@openai.com>
    Co-authored-by: Josh McKinney <joshka@openai.com>
  • feat: search_tool migrate to bring you own tool of Responses API (#14274)
    ## Why
    
    to support a new bring your own search tool in Responses
    API(https://developers.openai.com/api/docs/guides/tools-tool-search#client-executed-tool-search)
    we migrating our bm25 search tool to use official way to execute search
    on client and communicate additional tools to the model.
    
    ## What
    - replace the legacy `search_tool_bm25` flow with client-executed
    `tool_search`
    - add protocol, SSE, history, and normalization support for
    `tool_search_call` and `tool_search_output`
    - return namespaced Codex Apps search results and wire namespaced
    follow-up tool calls back into MCP dispatch
  • feat: pres artifact part 5 (#13355)
    Mostly written by Codex
  • feat: presentation artifact p1 (#13341)
    Part 1 of presentation tool artifact
  • Adjusting plan prompt for clarity and verbosity (#13284)
    `plan.md` prompt changes to tighten plan clarity and verbosity.
  • Tune memory read-path for stale facts (#13088)
    ## Why
    - tighten Codex memory-read behavior around stale facts and conflicting
    memory
    - encode the risk-of-drift vs verification-effort decision rule directly
    in the read-path prompt
    - make partial stale-detail updates explicit so correcting only the
    answer is not treated as sufficient
    
    ## What changed
    - update `codex-rs/core/templates/memories/read_path.md`
    - add guidance for when to verify cheap local facts vs when to answer
    from older memory with visible provenance
    - strengthen same-turn `MEMORY.md` updates when stored concrete details
    are stale
    
    ## Notes
    - this is based on some staleness eval work
  • feat: memories forgetting (#12900)
    Add diff based memory forgetting
  • Enable request_user_input in Default mode (#12735)
    ## Summary
    - allow `request_user_input` in Default collaboration mode as well as
    Plan
    - update the Default-mode instructions to prefer assumptions first and
    use `request_user_input` only when a question is unavoidable
    - update request_user_input and app-server tests to match the new
    Default-mode behavior
    - refactor collaboration-mode availability plumbing into
    `CollaborationModesConfig` for future mode-related flags
    
    ## Codex author
    `codex resume 019c9124-ed28-7c13-96c6-b916b1c97d49`
  • feat: adding stream parser (#12666)
    Add a stream parser to extract citations (and others) from a stream.
    This support cases where markers are split in differen tokens.
    
    Codex never manage to make this code work so everything was done
    manually. Please review correctly and do not touch this part of the code
    without a very clear understanding of it
  • fix: temp remove citation (#12711)
    - **temp remove citation**
  • memories: tighten memory lookup guidance and citation requirements (#12635)
    ## Summary
    - tighten the memory-use decision boundary so agents skip memory only
    for clearly self-contained asks
    - make the quick memory pass more explicit and bounded (including a
    lightweight search budget)
    - add structured `<memory_citation>` requirements and examples for final
    replies
    - clarify memory update guidance and end-state wording for memory lookup
    
    ## Why
    The previous template was directionally correct, but still left room for
    inconsistent memory lookup behavior and citation formatting. This change
    makes the default behavior, quick-pass scope, and citation output
    contract much more explicit.
    
    ## Testing
    - not run (prompt/template text change only)
    
    Co-authored-by: jif-oai <jif@openai.com>
  • memories: tighten consolidation prompt schema and indexing guidance (#12653)
    ## Summary
    - tighten the Phase 2 consolidation prompt for task-oriented `MEMORY.md`
    generation
    - address Phase 2 under-coverage / "laziness" with stronger workflow +
    final-pass checks
    - improve recency/ordering behavior for `MEMORY.md` and
    `memory_summary.md`
    - rewrite `## What's in Memory` as a clearer routing index with explicit
    recent-3-day structure
    
    ## Key Changes
    - `MEMORY.md` schema cleanup:
    - align on `## Task <n>` task sections (remove stale `task:`
    rule/example references)
      - include `thread_id` in rollout provenance examples
      - compact comma-separated `### keywords` format
    - Phase 2 completeness guardrails:
      - chunked INIT coverage pass over `raw_memories.md`
      - incremental net-new indexing / routing steps
    - stronger final checks (day ordering, topic coverage, keyword
    searchability, accidental duplication)
    - Recency / ordering rules:
    - clearer scan-order guidance for raw memories (newest-first bias in
    incremental mode)
    - utility+recency ordering guidance for `MEMORY.md` task groups and
    summary topics
      - rebuild recent active window from current `updated_at` coverage
    - `## What's in Memory` rewrite:
      - index/routing-layer framing (not a mini-handbook)
      - explicit recent 3 distinct memory-day layout
      - richer recent-topic entries + compact lower-priority routing entries
    - clearer `desc` / `learnings` expectations and separation from `##
    General Tips`
    - Explicitly allow rollout-summary reuse across multiple tasks/blocks
    when it supports distinct task angles (with distinct task-local value)
    
    ## Notes
    - Prompt-template only:
    `codex-rs/core/templates/memories/consolidation.md`
    - No runtime/code changes
    
    ## Validation
    - Manual diff review only
  • memories: add rollout_summary_file header to raw memories and tune prompts (#12221)
    ## Summary
    - Add `rollout_summary_file: <generated>.md` to each thread header in
    `raw_memories.md` so Phase 2 can reliably reference the canonical
    rollout summary filename.
    - Update the memory prompts/templates (`stage_one_system`,
    `consolidation`, `read_path`) for the new task-oriented raw-memory /
    MEMORY.md schema and stronger consolidation guidance.
    
    ## Details
    - `codex-rs/core/src/memories/storage.rs`
    - Writes the generated `rollout_summary_file` path into the per-thread
    metadata header when rebuilding `raw_memories.md`.
    - `codex-rs/core/src/memories/tests.rs`
    - Verifies the canonical `rollout_summary_file` header is present and
    ordered after `updated_at`/`cwd` in `raw_memories.md`.
    - Verifies task-structured raw-memory content is preserved while the
    canonical header is added.
    - `codex-rs/core/templates/memories/*.md`
    - Updates the stage-1 raw-memory format to task-grouped sections
    (`task`, `task_group`, `task_outcome`).
    - Updates Phase 2 consolidation guidance around recency (`updated_at`),
    task-oriented `MEMORY.md` blocks, and richer evidence-backed
    consolidation.
    - Tweaks the quick memory pass wording to emphasize topics/workflows in
    addition to keywords.
    
    ## Testing
    - `cargo test -p codex-core memories`
  • Clarify cumulative proposed_plan behavior in Plan mode (#12265)
    ## Summary
    - Require revised `<proposed_plan>` blocks in the same planning session
    to be complete replacements, not partial/delta plans.
    - Scope that cumulative replacement rule to the current planning session
    only.
    - Clarify that after leaving Plan mode (for example switching to Default
    mode to implement) or when explicitly asked for a new plan, the model
    should produce a new self-contained plan without inheriting prior plan
    blocks unless requested.
    
    ## Testing
    - Not run (prompt/template text-only change).
  • fix: Remove citation (#12187)
    Remove citation requirement until we figure out a better visualization
  • [apps] Fix app mention syntax. (#11894)
    - [x] Fix app mention syntax.
  • feat: persist and restore codex app's tools after search (#11780)
    ### What changed
    1. Removed per-turn MCP selection reset in `core/src/tasks/mod.rs`.
    2. Added `SessionState::set_mcp_tool_selection(Vec<String>)` in
    `core/src/state/session.rs` for authoritative restore behavior (deduped,
    order-preserving, empty clears).
    3. Added rollout parsing in `core/src/codex.rs` to recover
    `active_selected_tools` from prior `search_tool_bm25` outputs:
       - tracks matching `call_id`s
       - parses function output text JSON
       - extracts `active_selected_tools`
       - latest valid payload wins
       - malformed/non-matching payloads are ignored
    4. Applied restore logic to resumed and forked startup paths in
    `core/src/codex.rs`.
    5. Updated instruction text to session/thread scope in
    `core/templates/search_tool/tool_description.md`.
    6. Expanded tests in `core/tests/suite/search_tool.rs`, plus unit
    coverage in:
       - `core/src/codex.rs`
       - `core/src/state/session.rs`
    
    ### Behavior after change
    1. Search activates matched tools.
    2. Additional searches union into active selection.
    3. Selection survives new turns in the same thread.
    4. Resume/fork restores selection from rollout history.
    5. Separate threads do not inherit selection unless forked.
  • Update read_path prompt (#11763)
    ## Summary
    
    - Created branch zuxin/read-path-update from main.
    - Copied codex-rs/core/templates/memories/read_path.md from the current
    branch.
    - Committed the content change.
    
    ## Testing
    Not run (content copy + commit only).
  • core: limit search_tool_bm25 to Apps and clarify discovery guidance (#11669)
    ## Summary
    - Limit `search_tool_bm25` indexing to `codex_apps` tools only, so
    non-Apps MCP servers are no longer discoverable through this search
    path.
    - Move search-tool discovery guidance into the `search_tool_bm25` tool
    description (via template include) instead of injecting it as a separate
    developer message.
    - Update Apps discovery guidance wording to clarify when to use
    `search_tool_bm25` for Apps-backed systems (for example Slack, Google
    Drive, Jira, Notion) and when to call tools directly.
    - Remove dead `core` helper code (`filter_codex_apps_mcp_tools` and
    `codex_apps_connector_id`) that is no longer used after the
    tool-selection refactor.
    - Update `core` search-tool tests to assert codex-apps-only behavior and
    to validate guidance from the tool description.
    
    ## Validation
    -  `just fmt`
    -  `cargo test -p codex-core search_tool`
    - ⚠️ `cargo test -p codex-core` was attempted, but the run repeatedly
    stalled on
    `tools::js_repl::tests::js_repl_can_attach_image_via_view_image_tool`.
    
    ## Tickets
    - None