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
[Bug]:Managed session turn fails with NullPointerException: Cannot invoke "SessionRecorder.acceptedMessageIds()" because "recorder" is null when legacy history is enabled #3771
Hi, I'd like to work on this. The repro is precise: AgentTraceMiddleware unconditionally dereferences SessionRecorder.from(...) on the legacy-history path where no recorder is attached. Plan: null-guard the recorder access (skip/empty-set fallback when absent) so the legacy AgentStateStore-slot path executes turns and writes state snapshots normally, plus a regression test for the null-recorder path. PR coming shortly.
Saw the issue was closed as completed — thanks. For the maintainers' awareness, my PR #3832 (null-guards at the three unguarded SessionRecorder deref sites) is still open. Checking current main, the settleSession site now has a null check, but beforeStep and closeFailedSessionExecution still pass the nullable recorder straight through, so the NPE path from the original repro (BUILDER_AGENT_API_LEGACY_HISTORY=true, first turn) looks reachable unless something else changed upstream of these call sites.
Two possibilities: (a) the closure was based on #3832's direction being right but wanting a different shape — happy to rebase/adjust if so; or (b) it was closed as addressed-in-spirit while the remaining guards slipped. If (b), I'd suggest keeping #3832 open (or me repushing it) until the two sites are guarded — otherwise the reporter's exact repro may still throw. Asking before pushing anything, since the issue is closed either way.
Activity
aiyili commentedon Oct 28, 2026
Hi, I'd like to work on this. The repro is precise:
AgentTraceMiddlewareunconditionally dereferencesSessionRecorder.from(...)on the legacy-history path where no recorder is attached. Plan: null-guard the recorder access (skip/empty-set fallback when absent) so the legacy AgentStateStore-slot path executes turns and writes state snapshots normally, plus a regression test for the null-recorder path. PR coming shortly.aiyili commentedon Nov 3, 2026
Saw the issue was closed as completed — thanks. For the maintainers' awareness, my PR #3832 (null-guards at the three unguarded
SessionRecorderderef sites) is still open. Checking currentmain, thesettleSessionsite now has a null check, butbeforeStepandcloseFailedSessionExecutionstill pass the nullable recorder straight through, so the NPE path from the original repro (BUILDER_AGENT_API_LEGACY_HISTORY=true, first turn) looks reachable unless something else changed upstream of these call sites.Two possibilities: (a) the closure was based on #3832's direction being right but wanting a different shape — happy to rebase/adjust if so; or (b) it was closed as addressed-in-spirit while the remaining guards slipped. If (b), I'd suggest keeping #3832 open (or me repushing it) until the two sites are guarded — otherwise the reporter's exact repro may still throw. Asking before pushing anything, since the issue is closed either way.
fix(core): null-guard SessionRecorder on the legacy-history path (#3771…