Skip to content

Commit e676c75

Browse files
authored
Merge pull request #310 from ag-ui-protocol/fix/report-state-langgraph
fix: fix picking and reporting of state snapshots
2 parents e7067c3 + 90f6d03 commit e676c75

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

typescript-sdk/apps/dojo/src/components/sidebar/sidebar.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ export function Sidebar({ isMobile, onMobileClose }: SidebarProps) {
3333
const pathname = usePathname();
3434
const { theme, setTheme } = useTheme();
3535
const isDarkTheme = theme === "dark"
36-
console.log(isDarkTheme)
3736
const { view, frameworkPickerHidden, viewPickerHidden, featurePickerHidden, setView} = useURLParams();
3837

3938
// Extract the current integration ID from the pathname

typescript-sdk/integrations/langgraph/src/agent.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ export class LangGraphAgent extends AbstractAgent {
200200
checkpointId: fork.checkpoint.checkpoint_id!,
201201
streamMode,
202202
}),
203-
state: timeTravelCheckpoint,
203+
state: timeTravelCheckpoint as ThreadState<State>,
204204
streamMode,
205205
};
206206
}
@@ -486,7 +486,7 @@ export class LangGraphAgent extends AbstractAgent {
486486
this.endStep()
487487
this.dispatchEvent({
488488
type: EventType.STATE_SNAPSHOT,
489-
snapshot: this.getStateSnapshot(state.values),
489+
snapshot: this.getStateSnapshot(state),
490490
});
491491
this.dispatchEvent({
492492
type: EventType.MESSAGES_SNAPSHOT,
@@ -707,7 +707,7 @@ export class LangGraphAgent extends AbstractAgent {
707707
this.activeRun!.manuallyEmittedState = event.data;
708708
this.dispatchEvent({
709709
type: EventType.STATE_SNAPSHOT,
710-
snapshot: this.getStateSnapshot(this.activeRun!.manuallyEmittedState!),
710+
snapshot: this.getStateSnapshot({ values: this.activeRun!.manuallyEmittedState! } as ThreadState<State>),
711711
rawEvent: event,
712712
});
713713
}
@@ -767,7 +767,8 @@ export class LangGraphAgent extends AbstractAgent {
767767
}
768768
}
769769

770-
getStateSnapshot(state: State) {
770+
getStateSnapshot(threadState: ThreadState<State>) {
771+
let state = threadState.values
771772
const schemaKeys = this.activeRun!.schemaKeys!;
772773
// Do not emit state keys that are not part of the output schema
773774
if (schemaKeys?.output) {

0 commit comments

Comments
 (0)