You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Regression: #2760 dropped permission context when loading legacy v1 session state (re-opens #2768) #2888
#2769 fixed #2768 ("ReActAgent legacy-state load silently drops permissionContext (downgrades to DEFAULT)") by forwarding the caller's permCtx to LegacyStateLoader. Commit 6059782 (#2760) rewrote ReActAgent.loadOrCreateAgentStateForSlot(...) and dropped that argument, calling the 3-arg LegacyStateLoader.loadFromLegacySessionWithPresence(stateStore, userId, sessionId) overload again — so the regression described in #2768 is live on main again.
Impact
Same as #2768: any session that still has v1-era keys (memory_messages / toolkit_activeGroups) but no new-format agent_state — typically the first turn after a 1.x → 2.0 migration — gets its caller-configured permission mode (e.g. BYPASS) silently downgraded to DEFAULT.
Repro / Fix
Repro: seed v1 legacy keys, build an agent with permissionContext(BYPASS), perform the first call() — the reconstructed state comes back DEFAULT instead of BYPASS.
Category: bug | Area: area/core/agent | Status: Confirmed regression (verified against current main)
Root Cause:ReActAgent.loadOrCreateAgentStateForSlot receives the caller's permCtx and uses it for the fresh-state path, but its legacy-state path calls the 3-arg LegacyStateLoader.loadFromLegacySessionWithPresence(stateStore, userId, sessionId) overload, which forwards null and silently downgrades a caller-configured permission mode (e.g. BYPASS) to DEFAULT. This re-introduces the behaviour already fixed in #2769 for #2768 after #2760 rewrote the method. Impact: Any session that still has v1-era keys (memory_messages / toolkit_activeGroups) but no new-format state loses its permission context on load. Severity: high
The fix is to forward permCtx through the legacy load path (the same shape as #2886). Please ensure a regression test pins the legacy + permission-context combination.
The call site this regression lives in is still on 2.0.x (50886798): ReActAgent.loadOrCreateAgentStateForSlot calls the three-argument LegacyStateLoader.loadFromLegacySessionWithPresence(stateStore, userId, sessionId), so a session that only has v1 keys is reconstructed without the builder's permissionContext. main no longer has this call.
I'd like to fix it on 2.0.x, with the same shape as #2886 / #3221 (the permCtx argument forwarded), plus a regression test that pins the legacy + permission-context combination through ReActAgent. LegacyStateLoaderTest covers the loader's four-argument overload, but nothing covers the caller.
As far as I can tell from the code, the effect on 2.0.x is limited to the getAgentState(...) accessors: activateSlotForContext applies the builder's context again on the first activation of a slot, so a call() is not affected. I will confirm that with the test before opening the PR.
The test confirmed what I wrote above: with the change, a session that only has v1 keys is reconstructed with the builder's context, mode and rules, where it was DEFAULT with no rules before. Two cases pass before and after and are there to bound the change: an existing state keeps its own context, and a call() applies the builder's context on first activation. So on 2.0.x the regression was visible through getAgentState(...), not through a call.
The full agentscope-core suite has the same result before and after on Windows and in a Linux container.
Activity
oss-maintainer commentedon Sep 14, 2026
Issue Evaluation
Category:
bug| Area:area/core/agent| Status: Confirmed regression (verified against currentmain)Root Cause:
ReActAgent.loadOrCreateAgentStateForSlotreceives the caller'spermCtxand uses it for the fresh-state path, but its legacy-state path calls the 3-argLegacyStateLoader.loadFromLegacySessionWithPresence(stateStore, userId, sessionId)overload, which forwardsnulland silently downgrades a caller-configured permission mode (e.g.BYPASS) toDEFAULT. This re-introduces the behaviour already fixed in #2769 for #2768 after #2760 rewrote the method.Impact: Any session that still has v1-era keys (
memory_messages/toolkit_activeGroups) but no new-format state loses its permission context on load.Severity: high
The fix is to forward
permCtxthrough the legacy load path (the same shape as #2886). Please ensure a regression test pins the legacy + permission-context combination.Automated evaluation by github-manager-bot
aiyili commentedon Nov 27, 2026
The call site this regression lives in is still on
2.0.x(50886798):ReActAgent.loadOrCreateAgentStateForSlotcalls the three-argumentLegacyStateLoader.loadFromLegacySessionWithPresence(stateStore, userId, sessionId), so a session that only has v1 keys is reconstructed without the builder'spermissionContext.mainno longer has this call.I'd like to fix it on
2.0.x, with the same shape as #2886 / #3221 (thepermCtxargument forwarded), plus a regression test that pins the legacy + permission-context combination throughReActAgent.LegacyStateLoaderTestcovers the loader's four-argument overload, but nothing covers the caller.As far as I can tell from the code, the effect on
2.0.xis limited to thegetAgentState(...)accessors:activateSlotForContextapplies the builder's context again on the first activation of a slot, so acall()is not affected. I will confirm that with the test before opening the PR.aiyili commentedon Nov 27, 2026
Opened #4452 against
2.0.x.The test confirmed what I wrote above: with the change, a session that only has v1 keys is reconstructed with the builder's context, mode and rules, where it was
DEFAULTwith no rules before. Two cases pass before and after and are there to bound the change: an existing state keeps its own context, and acall()applies the builder's context on first activation. So on2.0.xthe regression was visible throughgetAgentState(...), not through a call.The full
agentscope-coresuite has the same result before and after on Windows and in a Linux container.fix(core): pass the builder permission context to the legacy state lo…