-
-
Notifications
You must be signed in to change notification settings - Fork 79.1k
Codex long-running sessions should use semantic thread/bootstrap cache ownership #86023
Copy link
Copy link
Open
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-live-reproClawSweeper needs live local, crabbox, or manual validation to confirm this issue.ClawSweeper needs live local, crabbox, or manual validation to confirm this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.Session, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🐚 platinum hermitGood issue quality with a plausible reproduction path needing some confirmation.Good issue quality with a plausible reproduction path needing some confirmation.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Codex long-running sessions should use semantic thread/bootstrap cache ownership instead of hard native-token rotation
Problem
Long-running Discord/Codex sessions can still become slow after #85978 when they do not enter or retain the context-engine
thread_bootstrappath. The local Codex app-server startup guard can still log:That means OpenClaw clears the saved native Codex thread and starts cold, even though the selected model may have much more context headroom. The 70k number is an OpenClaw native-thread reuse guard, not the model context window.
Current Understanding
contextProjection.mode = "thread_bootstrap"so OpenClaw injects assembled history once for a stable epoch and then resumes the same native thread.thread_bootstrapwith an epoch derived from summary context state rather than ordinary fresh-tail growth.Desired Architecture
For Codex app-server, native-thread rotation should be primarily semantic:
/newor/reset;thread_bootstrapnative rollout is above a hard-coded 70k guard.The native thread should be treated as a projection cache keyed by stable session/channel identity plus context-engine conversation/projection identity, not only by
sessionFile + ".codex-app-server.json".Proposed Follow-Ups
Add a Codex native-thread rotation reason enum and diagnostics block.
Log current/saved engine id, policy fingerprint, epoch/fingerprint, dynamic tools, MCP/app/environment/auth/model fingerprints, token source, native/session tokens, and whether mirrored history was projected.
Make the native reuse guard model/config/context-owner aware.
Keep strict clearing for legacy or ownerless sessions, but treat compatible context-engine
thread_bootstrapsessions as semantically owned by the context engine unless the app-server actually rejects the turn.Preserve or migrate Codex bindings across LCM/session-file rollover when conversation identity and projection epoch remain compatible.
Add explicit workspace bootstrap fingerprints to Codex thread binding/diagnostics.
Track stable inherited developer instructions, turn-scoped collaboration instructions, prompt context contributors, and native project-doc loading separately.
Revisit compaction invalidation.
Successful context-engine-owned compaction currently clears Codex bindings. If compaction does not change projection epoch/fingerprint, native reuse may be preservable.
Acceptance Criteria
thread_bootstrapepoch can exceed 70k native rollout tokens without cold-starting every turn./doctoror equivalent status output distinguishes model/provider context overflow from OpenClaw native-thread reuse guard rotation.Related
/Volumes/LEXAR/Codex/openclaw-codex-long-session-architecture-20260524.md