Repository navigation
fix(graph): apply updateState routing deltas exactly once - #157
Merged
Aias00 merged 1 commit intoOct 13, 2026
Merged
Conversation
Contributor
|
thx for your contributation, pls add my wechat: aias00 |
Aias00
reviewed
Oct 13, 2026
Aias00
left a comment
Contributor
There was a problem hiding this comment.
No blocking findings. The delta-only route handling and persisted nextNodeId match the resume contract and prevent non-idempotent key strategies from reapplying the full checkpoint state.
Non-blocking follow-ups:
- The new regression matrix covers
MemorySaverandVersionedMemoryCheckpointSaver, but notMemoryLeasedCheckpointSaverdirectly. The leased path sharesVersionedCheckpointScope.put, so this is low risk; a small leased-saver case would close the remaining coverage gap. GraphRunnerContext.nextNodeIdmutates in-memory state, whileCompiledGraph.nextNodeIdnow returns a delta for checkpoint updates. The current comments explain the new contract, but keeping these two semantics explicit in future refactors is important.
Verified locally:
- 14 new
CompiledGraphUpdateStateTestcases - related interruption, state-history, versioned-scope, and subgraph tests
git diff --check
All GitHub checks are green and the PR is cleanly mergeable.
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.
Describe what this PR does / why we need it
Fix duplicate state updates when calling
CompiledGraph.updateState(config, values, asNode). Existing APPEND values and other non-idempotent state were being merged again because routing returned the full state instead of a delta.Does this pull request fix one issue?
Fixes #155
Describe how you did it
Describe how to verify it
Validated on main
e10f9ab2c836ab6a9d5e722fbc243a323c9ef878, using JDK 21 with the project's Java 17 target, without model credentials or external services.Before the production fix: 12 regression cases failed, with the two no-asNode controls passing. After the fix: all 14 pass.
mvn -o -B -ntp -pl :argi-agent-framework -am \ -Dtest=CompiledGraphUpdateStateTest,ReactAgentVersionedCheckpointTest,ReactAgentCheckpointExecutionQueueTest,AbstractInterruptableModelHookTest \ -Dsurefire.failIfNoSpecifiedTests=false -Dspotless.skip=true testResult: 14 graph regression cases and 12 related Agent tests passed.
Result: 561 tests, 0 failures, 0 errors, 13 skipped (548 passed). The six external database/Docker test classes listed above were excluded.
Checkstyle reported no violations during the test build. Targeted Spotless validation passed for both changed Java files:
mvn -o -B -ntp -pl :argi-graph-core \ '-DspotlessFiles=.*(CompiledGraph|CompiledGraphUpdateStateTest)\.java' spotless:checkSpecial notes for reviews
Only one production file and one regression test file are changed. No public API or dependency changes. Parallel conditional dispatch remains deferred until resume. External database integration tests and the full multi-module suite were not run.