Skip to content

fix(codex): drop transient rs_tmp reasoning replay state - #11038

Closed
kpadilha wants to merge 1 commit into
NousResearch:mainfrom
kpadilha:fix/codex-rs-tmp-replay-source
Closed

fix(codex): drop transient rs_tmp reasoning replay state#11038
kpadilha wants to merge 1 commit into
NousResearch:mainfrom
kpadilha:fix/codex-rs-tmp-replay-source

Conversation

@kpadilha

@kpadilha kpadilha commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

Stops Hermes from persisting transient Codex reasoning replay items whose ids use the rs_tmp_* prefix.

These temporary blobs later contaminate replay state and can surface as invalid_encrypted_content failures. Hermes already has runtime recovery in another patch; this PR addresses the contamination at the source by avoiding persistence of the transient replay state in the first place.

Related Issue

No tracked issue. This PR complements existing Codex replay recovery work by preventing the bad transient state from being written.

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

  • Updated _normalize_codex_response() to drop transient rs_tmp_* reasoning replay items.
  • Preserved incomplete handling for reasoning-only responses even when the transient replay blob is skipped.
  • Kept stable rs_* reasoning replay state intact.
  • Added regression coverage in tests/run_agent/test_run_agent_codex_responses.py for:
    • transient drop
    • no-summary incomplete behavior
    • stable rs_* preservation

How to Test

  1. Run:
    • python -m pytest -o addopts='' tests/run_agent/test_run_agent_codex_responses.py -q
  2. Verify the targeted suite passes (47 passed locally when validated).
  3. Confirm transient rs_tmp_* items are dropped while stable rs_* items are preserved.

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: Debian GNU/Linux 13 (trixie)

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

Screenshots / Logs

python -m pytest -o addopts='' tests/run_agent/test_run_agent_codex_responses.py -q
47 passed

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint provider/openai OpenAI / Codex Responses API labels Apr 25, 2026
@kpadilha
kpadilha force-pushed the fix/codex-rs-tmp-replay-source branch 2 times, most recently from f31172b to a138d32 Compare May 13, 2026 14:58
@teknium1

Copy link
Copy Markdown
Contributor

Salvaged onto current main via #33146 (merged as b1a46b3). Your authorship is preserved in git log on the fix commit. Thanks @kpadilha — exactly the right prevention layer to pair with the recovery path that landed in #33035. Stops the contamination at the source instead of unwinding it after the HTTP 400.

@teknium1 teknium1 closed this May 27, 2026
mathias3 pushed a commit to mathias3/hermes-agent that referenced this pull request May 28, 2026
Bryce-huang pushed a commit to wbkunlun/hermes-agent that referenced this pull request May 29, 2026
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
T02200059 pushed a commit to T02200059/hermes-agent that referenced this pull request Jun 18, 2026
xyshanren pushed a commit to xyshanren/hermes-agent-cn that referenced this pull request Jun 25, 2026
waefrebeorn pushed a commit to waefrebeorn/slermes that referenced this pull request Jul 2, 2026
santhreal pushed a commit to santhreal/hermes-agent that referenced this pull request Jul 13, 2026
donbowman pushed a commit to donbowman/hermes-agent that referenced this pull request Jul 13, 2026
Gravezzz pushed a commit to Gravezzz/hermes-agent that referenced this pull request Jul 21, 2026
melon-xf added a commit to melon-xf/hermes-agent that referenced this pull request Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint P2 Medium — degraded but workaround exists provider/openai OpenAI / Codex Responses API type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants