mirror of
https://github.com/openai/codex.git
synced 2026-11-13 06:45:07 +00:00
Represent persisted world state as JSON objects (#38274)
## Why World-state snapshots and merge patches are keyed collections of sections. Allowing their persisted `state` field to contain any JSON value required replay code to handle shapes that cannot represent world state. ## What changed - Type `WorldStateItem.state` and snapshot patches as JSON object maps. - Reconstruct full snapshots directly from those maps and apply patches without fallible arbitrary-value conversions. - Regenerate the app-server protocol schema for the object-only representation. GitOrigin-RevId: 3d7662b74f3dd1f3ccc5fdd0200074c13a73cbe5
This commit is contained in:
1 parent
361fe2d202
commit
4b07886d59
13 files changed
+53
-64
No files matched your search
@@ -3362,7 +3362,7 @@ impl Session {
|
||||
state.replace_annotated_history(items, reference_context_item.clone());
|
||||
if let Some(world_state) = world_state_baseline {
|
||||
let snapshot = world_state.snapshot();
|
||||
world_state_item = Some(WorldStateItem::full(snapshot.clone().into_value()));
|
||||
world_state_item = Some(WorldStateItem::full(snapshot.clone().into_object()));
|
||||
state.history.set_world_state_baseline(snapshot);
|
||||
}
|
||||
}
|
||||
@@ -3799,7 +3799,7 @@ impl Session {
|
||||
.set_world_state_baseline(snapshot.clone());
|
||||
(
|
||||
context_items,
|
||||
Some(WorldStateItem::full(snapshot.into_value())),
|
||||
Some(WorldStateItem::full(snapshot.into_object())),
|
||||
)
|
||||
} else {
|
||||
let (world_state_items, world_state_item) = {
|
||||
|
||||
Reference in new issue
Block a user