Repository navigation
Description
Is your feature request related to a problem? Please describe.
Automatic extraction reads the working conversation context again after eligible calls. Compaction also extracts before replacing its prefix. There is no saved extraction position, so old messages can be processed repeatedly and compaction changes the available source. Agent instances recreated for each request cannot retain an in-memory watermark.
The native Thread journal retains original messages independently of working context. The file write boundary also needs attention: separate WorkspaceManagers can read the same memory file and overwrite each other's appends, and a request-specific output limit can retain the other limit from model defaults.
Describe the solution you'd like
Consume committed original messages from an extraction position stored in workspace files. Bound each source page and model request, append each daily-ledger batch before advancing progress, and leave incomplete work for the next trigger. Native compaction should retain original messages without launching another extraction.
Include the supporting conditional UTF-8 writes and output-limit override fix in the same delivery. Conditional updates must preserve missing versus empty files, workspace namespaces, and inherited overlay content. Unsupported memory backends must report the missing capability without consuming sources or falling back to compacted context.
Provide optional serial candidate admission. Completed rejection consumes the source; an error retains the batch. Keep JevMemoryGate.assess() compatible and expose the Harness admission policy through an adapter.
Acceptance criteria:
- Recreated agents resume an acknowledged prefix independently of compaction; oversized messages continue through Unicode-safe offsets.
- A same-day ledger append followed by a failed progress write resumes its recorded end despite changed budgets or model responses.
- Conditional writes detect stale file snapshots across instances. Local writers coordinate across JVMs; remote stores use atomic versioned writes. Backends without this capability retain legacy append behavior, without concurrent-write guarantees.
- Extraction and serial admission share a configurable trigger-wide timeout that releases the local flush queue.
- Durable finalization replays completed work within the same invocation through the host workspace.
- Explicit-input and journalEnabled(false) execution remain available with their existing recovery limitations.
Describe alternatives you've considered
Prompt-only deduplication still processes old input. A working-context watermark is affected by compaction. A manager-local lock cannot coordinate replicas. A separate retry worker, deferred payload queue or persistent candidate-level progress would add lifecycle state and is outside this change.
Additional context
Target: 2.1.0-SNAPSHOT at a4306d6 (#4154), Java 17. This issue tracks the complete incremental-memory change, including its file-write and model-option support.
This does not add fact eviction, global conflict resolution or a transaction across ledger and progress files. Concurrent attempts can repeat model calls; cross-day retries can repeat facts. Admission covers extraction, not memory_save or consolidation. Persistent judge failures or an over-budget batch require backend or configuration recovery. Busy writers may exhaust bounded conflict retries and fail explicitly; the source remains available to a later trigger.
Activity