fix(#2475): store userId/sessionId directly on CallExecution instead of parsing slotKey - #2476
fix(#2475): store userId/sessionId directly on CallExecution instead of parsing slotKey#2476waterWang wants to merge 1 commit into
Conversation
…tion instead of parsing slotKey
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
oss-maintainer
left a comment
There was a problem hiding this comment.
Review — Approved ✅
Clean, minimal fix for the SlotRef.parse() ambiguity when sessionId contains /.
What changed
userIdandsessionIdare now stored directly onCallExecutionas separate fieldssaveStateToSession()usesscope.userId/scope.sessionIddirectly instead of round-tripping through the concatenated slot keySlotRef.parse()is removed — no longer needed- Constructor updated to accept the original identity values
Assessment
- Correctness: Eliminates the root cause entirely. No more ambiguity from
lastIndexOf('/')splitting. - Scope: 12 additions / 13 deletions in a single file — well-contained.
- Backward compatibility: The
slotKeyfield is preserved onCallExecution(still used as map key), so no downstream breakage. - Suggestion: Add a regression test with a sessionId containing
/(e.g."cidLcMOzfRs62haqnq1NO8SxeYdmc/lO8bWyidOisoKAzM=") to verify state is stored and retrievable under the correct(userId, sessionId)pair.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as abuse.
|
@oss-maintainer noted on #2475 that "a regression test covering sessionId with Commit: gxgeek-n@c664ed09 (branch
Verified both directions:
The only case green on both is the plain-sessionId one, which the bug never touched — so the suite genuinely detects the regression rather than passing vacuously. The fixture uses a real DingTalk-style Feel free to cherry-pick
|
Fixes #2475
Problem
When
RuntimeContext.sessionIdcontains a/character (e.g., DingTalkopenConversationIdvalues likecidLcMOzfRs62haqnq1NO8SxeYdmc/lO8bWyidOisoKAzM=),ReActAgentpersists theAgentStateunder a corrupted(userId, sessionId)pair becauseSlotRef.parse()splits the concatenated slot key at the last/.Root Cause
SlotRef.parse()useslastIndexOf('/')to split the concatenated key, but this is ambiguous when sessionId itself contains/:Fix
userIdandsessionIddirectly onCallExecution— the original values are now carried through the per-call scope instead of being reconstructed from the concatenated slot key.saveStateToSession()to usescope.userId/scope.sessionIddirectly.SlotRef.parse()— no longer needed.Impact
getAgentState(userId, sessionId)now works correctly for any session whose id contains/.user_idvalues.listSessionIds(userId)return correct results.Testing
A regression test should verify: run a call with a sessionId containing
/and assert the state is retrievable from the store under the untouched pair, with no sibling slot appearing under a polluted userId.