Repository navigation
Conversation
Recovery previously replayed the whole EVENT_LOG journal, costing one remote read per commit segment (about 35s on a 445-segment session). Maintain an O(1) anchors.json next to the journal head with the latest checkpoint and run/start sequences. Anchors update only after the commit and head are durable, only increase, and are rebuilt from the committed chain when missing or corrupt. Start projection at the earlier of the two anchors so stateJson, activeRuns, and uncertainToolCalls match a full replay. Transcript now merges checkpoint state without dropping history, and the export cursor advances in batches of 200 events with at-least-once replay. Refs agentscope-ai#3987
chcodex
added a commit
to chcodex/agentscope-java
that referenced
this pull request
Nov 7, 2026
# Conflicts: # agentscope-extensions/agentscope-extensions-protocol/agentscope-extensions-agui/src/main/java/io/agentscope/core/agui/processor/AguiRequestProcessor.java # agentscope-extensions/agentscope-extensions-sandbox/agentscope-extensions-sandbox-e2b/src/main/java/io/agentscope/extensions/sandbox/e2b/E2bEnvdProcessClient.java # agentscope-extensions/agentscope-extensions-sandbox/agentscope-extensions-sandbox-e2b/src/main/java/io/agentscope/extensions/sandbox/e2b/E2bSandbox.java # agentscope-extensions/agentscope-extensions-sandbox/agentscope-extensions-sandbox-e2b/src/main/java/io/agentscope/extensions/sandbox/e2b/E2bSandboxClient.java # agentscope-extensions/agentscope-extensions-sandbox/agentscope-extensions-sandbox-e2b/src/main/java/io/agentscope/extensions/sandbox/e2b/E2bVolumeMount.java # agentscope-extensions/agentscope-extensions-sandbox/agentscope-extensions-sandbox-e2b/src/test/java/io/agentscope/extensions/sandbox/e2b/E2bEnvdProcessClientTest.java # agentscope-extensions/agentscope-extensions-sandbox/agentscope-extensions-sandbox-e2b/src/test/java/io/agentscope/extensions/sandbox/e2b/E2bVolumeMountTest.java # agentscope-extensions/agentscope-spring-boot-starters/agentscope-agui-spring-boot-starter/src/main/java/io/agentscope/spring/boot/agui/mvc/AguiMvcController.java # agentscope-extensions/agentscope-spring-boot-starters/agentscope-agui-spring-boot-starter/src/test/java/io/agentscope/spring/boot/agui/mvc/AguiMvcControllerTest.java # agentscope-harness/src/main/java/io/agentscope/harness/agent/filesystem/local/LocalFilesystem.java # agentscope-harness/src/main/java/io/agentscope/harness/agent/filesystem/remote/RemoteFilesystem.java # agentscope-harness/src/main/java/io/agentscope/harness/agent/filesystem/sandbox/BaseSandboxFilesystem.java # agentscope-harness/src/main/java/io/agentscope/harness/agent/filesystem/util/FilesystemUtils.java # agentscope-harness/src/main/java/io/agentscope/harness/agent/middleware/WorkspaceContextMiddleware.java # agentscope-harness/src/main/java/io/agentscope/harness/agent/sandbox/WorkspaceMountSupport.java # agentscope-harness/src/test/java/io/agentscope/harness/agent/filesystem/sandbox/BaseSandboxFilesystemTest.java # agentscope-harness/src/test/java/io/agentscope/harness/agent/filesystem/util/FilesystemUtilsTest.java # agentscope-harness/src/test/java/io/agentscope/harness/agent/sandbox/WorkspaceMountSupportTest.java
chcodex
added a commit
to chcodex/agentscope-java
that referenced
this pull request
Nov 7, 2026
…ts tests The anchors merge (agentscope-ai#3988) kept the local middleware implementation while the matching prompt tests came from upstream, leaving 27 harness tests failing. Restore the upstream implementation and align the local-only sandbox/composite assertions with it; the sandbox branch now describes the execution backend instead of the old container-id wording.
chcodex
added a commit
to chcodex/agentscope-java
that referenced
this pull request
Nov 9, 2026
chcodex
marked this pull request as draft
November 10, 2026 02:27
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3987.
Problem
EVENT_LOGrecovery calledlog.scan(0, head.seq())at the start of every request. On a JDBC-backed session with 445 commit segments this meant roughly one remote read per segment and about 35 seconds before the first token.Change
<session>/anchors.jsonwithlastCheckpointSeqandlastRunStartSeq.head.jsonare durable.SessionProjection.readat the earlier of the checkpoint and run-start anchors, sostateJson,activeRuns, anduncertainToolCallsstay equivalent to a full replay.SessionViews.transcriptmerges checkpoint state instead of clearing collected messages, preserving history across context replacement.SessionLogExporter.drainadvances the durable cursor every 200 events plus a final tail, keeping per-eventsink.acceptand at-least-once delivery; a crash replays at most one batch.No event format or committed journal data changes.
Verification
New coverage includes anchor create/read, missing/corrupt rebuild, lagging anchors, CAS-conflict monotonicity, out-of-range anchors, interrupted runs, unresolved tool calls, transcript history, and batched export cursor replay after a simulated crash.
Read-count comparison
Synthetic journal with 153 one-event commit segments:
Anchor lookup is now 2 file reads regardless of segment count; remaining commit reads are only the necessary replay from the anchor to head.
Merge order
feat/agui-live-handoff.