Repository navigation
Description
Summary
Active Memory using the Codex agent harness intermittently starts multiple recall runs for one inbound turn. When a run reaches its timeout, a subsequent run often fails with Codex session generation is no longer current. Successful recalls are therefore not reliably carried through, and direct replies can be delayed by the full timeout budget multiple times.
Environment
- OpenClaw: 2026.7.1
- Platform: macOS arm64
- Node: 22.23.1
- Provider/harness: OpenAI Codex
- Active Memory model:
openai/gpt-5.6-luna - Query mode:
recent - Prompt style:
balanced - Recall timeout: 15000 ms
- Setup grace tested: 0 ms and 5000 ms
The same basic timeout pattern occurred before upgrading from 2026.6.11, while the stale-generation follow-on was observed prominently on 2026.7.1.
Reproduction
- Enable Active Memory for a direct-chat agent using the Codex harness.
- Set the model to
openai/gpt-5.6-luna,timeoutMs: 15000, andsetupGraceTimeoutMs: 5000. - Send short direct messages that ask for known durable-memory facts, one at a time.
- Inspect Active Memory and Codex harness logs for the single inbound trace.
Observed results
A five-message smoke test produced 3 passes and 2 failures:
- Successful recall pairs completed in 10.5-16.2 seconds and then used a cached result.
- One failure produced two recalls that each exhausted the 20000 ms effective budget, followed by
Codex session generation is no longer current. - Another failure had an initial successful recall at 18.9 seconds, but a follow-on recall exhausted 20000 ms and the retry then failed with the same stale-generation error.
- Increasing setup grace changed some borderline timeouts into successes, but did not eliminate the repeated-run/session-lifecycle failure.
Representative sanitized log sequence:
active-memory ... activeModel=gpt-5.6-luna start timeoutMs=15000
active-memory ... done status=ok elapsedMs=18916 summaryChars=101
active-memory ... activeModel=gpt-5.6-luna start timeoutMs=15000
lane task error: lane=active-memory durationMs=20024 error="Error: active-memory timeout after 20000ms"
active-memory ... done status=timeout elapsedMs=20000 summaryChars=0
active-memory ... activeModel=gpt-5.6-luna start timeoutMs=15000
Codex agent harness failed; not falling back to embedded OpenClaw backend
Error: Codex session generation is no longer current: active-memory-<redacted>
active-memory ... done status=failed elapsedMs=258 summaryChars=0
The behavior also reproduced with the heavier openai/gpt-5.6-sol model and shorter legacy timeout, but switching to Luna and restoring the current 15-second default did not make it reliable.
Expected behavior
- One inbound turn should not launch redundant blocking recalls, or later generations should reuse the first successful recall result.
- A timed-out Codex recall should cleanly retire/cancel its session so a retry does not fail as no longer current.
- A successful recall should remain usable even if a later internal generation/retry occurs.
Workaround
Active Memory was disabled temporarily. Explicit memory search remains functional.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon Jul 14, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed July 13, 2026, 9:38 PM ET / July 14, 2026, 01:38 UTC.
Summary
Keep this issue open: the report gives current-release reproduction steps and sanitized logs showing a real Active Memory reliability failure, while the evidence does not establish that current main fixes either redundant recalls or stale Codex generation cleanup.
Reproducibility: no. independent current-main run is available, but the issue provides a precise current-release setup, a five-turn result set, and a sanitized log sequence that identifies the failing recall and Codex generation path.
Ways to help us reproduce this
Next step
The report is concrete and bounded enough for one repair attempt, but the worker must reproduce current main and inspect the exact Codex cancellation contract before selecting the final owner boundary.
Review details
Best possible solution:
Use one stable inbound-turn key to share an in-flight Active Memory recall and preserve its first successful result, while making timeout cancellation await Codex session retirement before any retry or replacement generation starts.
Do we have a high-confidence way to reproduce the issue?
No independent current-main run is available, but the issue provides a precise current-release setup, a five-turn result set, and a sanitized log sequence that identifies the failing recall and Codex generation path.
Is this the best way to solve the issue?
Unclear until the same-turn hook callers and Codex cancellation contract are traced together; fixing only the timeout value or adding another retry would not address redundant execution or stale generation ownership.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
Codex review notes: model internal, reasoning high; reviewed against e330e4a17d3c.
Label changes
Label changes:
P1: A documented agent workflow intermittently blocks direct replies for multiple timeout budgets and then loses usable recall behavior on the latest release.impact:session-state: The failure crosses recall retries and Codex generation ownership, producing stale session-generation state and discarded successful recall results.issue-rating: 🐚 platinum hermit: Current issue advisory state selects this label.clawsweeper:needs-live-repro: Current issue advisory state selects this label.Label justifications:
P1: A documented agent workflow intermittently blocks direct replies for multiple timeout budgets and then loses usable recall behavior on the latest release.impact:session-state: The failure crosses recall retries and Codex generation ownership, producing stale session-generation state and discarded successful recall results.Evidence reviewed
Acceptance criteria:
What I checked:
docs/concepts/active-memory.md. (docs/concepts/active-memory.md:346, e330e4a17d3c)extensions/active-memory/index.ts:1, e330e4a17d3c)../codex/codex-rs/app-server/README.md:794)Likely related people:
extensions/active-memory/index.ts)extensions/active-memory/index.ts,extensions/active-memory/index.test.ts)extensions/codex/src/app-server/run-attempt.ts)How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper autofix,@clawsweeper automerge,@clawsweeper fix ci, or@clawsweeper address review.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.reisball commentedon Jul 16, 2026
Additional sanitized live reproduction from a separate Linux installation.
Environment:
2d2ddc4)openai/gpt-5.6-lunaqueryMode: messagepromptStyle: recall-heavytimeoutMs: 30000persistTranscripts: falsememory_searchallowed, with a prompt requiring exactly one search before answering or returningNONEBefore enabling the live hook, the same model passed three isolated full-agent-harness cases (positive long-context recall, negative recall, and semantic recall) in 16.09-19.44 seconds.
One live inbound turn then produced this sequence:
The first recall was correct and called
memory_searchexactly once. Despite that successful result, the same inbound turn started another recall with a much larger prompt, then a further attempt hit the stale-generation failure.A separate canary with a local non-Codex recall model also launched multiple Active Memory recalls for one inbound turn, with recall input growing from about 9k to 17k characters. That suggests the redundant hook/run behavior is not specific to Luna, while the final stale-generation error is Codex-specific.
This appears to overlap with the raw
event.promptenvelope issue in #88077 / #92013. The installed 2026.7.1 plugin still passesevent.promptintobuildQuery, and completed-result caching is keyed by the full query text; a changed/inflated prompt therefore misses the previous result.Workaround remains disabling Active Memory. Explicit
memory_searchis healthy. No raw prompts, memory contents, identifiers, paths, or private infrastructure details are included here.ZaneMc-AO commentedon Jul 22, 2026
I can reproduce a closely related failure in WebChat using the native Codex runtime.
The user-visible error is:
Codex binding generation was retired: session-key:main:<redacted>Behaviour:
Environment:
fix(active-memory): share one recall per run across retries (#115627)
steipete commentedon Jul 29, 2026
Fixed on
mainby #115627 in 1b94810.Active Memory now keeps a per-run recall registry keyed by
ctx.runId: overlapping or changed-prompt attempts within one run join a single recall, replacement is gated until settled timeout cleanup has retired the prior manager, and the registry entry is cleared onagent_end. The earlier collision half was fixed in #105255; #115627 completes the run-scoped ownership and cleanup-ordering fix.Proof: the quiet-host Active Memory extension suite passed 195/195, the rejected-replacement regression passed in isolation, final Codex autoreview was clean, and exact-head hosted CI passed before merge.
fix(active-memory): share one recall per run across retries (openclaw…