@@ -50,7 +50,8 @@ namespace ai::openai::codex::backend {
5050 const ::ai::openai::codex::detail::ProtocolSurfaceEntry& registryEntry = ::ai::openai::codex::detail::entryFor (target);
5151 const std::optional<typed::DecodeDiagnostic> diagnostic =
5252 value.diagnostics .empty () ? std::nullopt : std::optional<typed::DecodeDiagnostic>{value.diagnostics .front ()};
53- return {detail::preserveUnmodeledTypedEvent ({std::string (registryEntry.key .name ), value.raw , std::nullopt , diagnostic})};
53+ return {detail::preserveUnmodeledTypedEvent (
54+ {std::string (registryEntry.key .name ), value.raw .at (" params" ), std::nullopt , diagnostic})};
5455 }
5556
5657 logger::BoundaryLogger lifecycleLog () {
@@ -330,10 +331,9 @@ namespace ai::openai::codex::backend {
330331 std::uint64_t originalDiagnosticBytes = 0 ;
331332 const auto account = [&originalDiagnosticBytes](std::size_t bytes) {
332333 const std::uint64_t value = saturatingUint64 (bytes);
333- originalDiagnosticBytes =
334- value > std::numeric_limits<std::uint64_t >::max () - originalDiagnosticBytes
335- ? std::numeric_limits<std::uint64_t >::max ()
336- : originalDiagnosticBytes + value;
334+ originalDiagnosticBytes = value > std::numeric_limits<std::uint64_t >::max () - originalDiagnosticBytes
335+ ? std::numeric_limits<std::uint64_t >::max ()
336+ : originalDiagnosticBytes + value;
337337 };
338338 account (extension.diagnostic ->surface .size ());
339339 account (extension.diagnostic ->fieldPath .size ());
@@ -430,8 +430,7 @@ namespace ai::openai::codex::backend {
430430 }
431431 state.threadList .hasLoadedPage = true ;
432432 ++state.threadList .pagesLoaded ;
433- state.threadList .nextCursor =
434- value.page .nextCursor .hasValue () ? value.page .nextCursor .value : std::nullopt ;
433+ state.threadList .nextCursor = value.page .nextCursor .hasValue () ? value.page .nextCursor .value : std::nullopt ;
435434 state.threadList .backwardsCursor =
436435 value.page .backwardsCursor .hasValue () ? value.page .backwardsCursor .value : std::nullopt ;
437436 state.threadList .complete = !value.page .nextCursor .hasValue ();
@@ -496,17 +495,16 @@ namespace ai::openai::codex::backend {
496495 }
497496 retainExtension (state,
498497 {.method = " codex/item-without-id" ,
499- .payload =
500- std::visit (
501- [](const auto & item) {
502- using Item = std::decay_t <decltype (item)>;
503- if constexpr (std::is_same_v<Item, typed::UnknownItem>) {
504- return item.raw ;
505- } else {
506- return item.metadata .raw ;
507- }
508- },
509- value.item ),
498+ .payload = std::visit (
499+ [](const auto & item) {
500+ using Item = std::decay_t <decltype (item)>;
501+ if constexpr (std::is_same_v<Item, typed::UnknownItem>) {
502+ return item.raw ;
503+ } else {
504+ return item.metadata .raw ;
505+ }
506+ },
507+ value.item ),
510508 .decodingError = " typed item has no stable id" ,
511509 .originalMethodBytes = std::nullopt ,
512510 .originalPayloadBytes = std::nullopt ,
@@ -674,16 +672,14 @@ namespace ai::openai::codex::backend {
674672 [](const typed::ItemStarted& value) -> std::vector<BackendEvent> {
675673 const auto location = itemLocation (value.item );
676674 if (!location) {
677- return {CodexExtensionReceived{
678- " item/started" , value.raw , " item event omitted threadId or turnId" , std::nullopt }};
675+ return {CodexExtensionReceived{" item/started" , value.raw , " item event omitted threadId or turnId" , std::nullopt }};
679676 }
680677 return {ItemUpserted{location->first , location->second , value.item , ItemLifecycle::Started, value.startedAtMs }};
681678 },
682679 [](const typed::ItemCompleted& value) -> std::vector<BackendEvent> {
683680 const auto location = itemLocation (value.item );
684681 if (!location) {
685- return {CodexExtensionReceived{
686- " item/completed" , value.raw , " item event omitted threadId or turnId" , std::nullopt }};
682+ return {CodexExtensionReceived{" item/completed" , value.raw , " item event omitted threadId or turnId" , std::nullopt }};
687683 }
688684 return {ItemUpserted{location->first , location->second , value.item , ItemLifecycle::Completed, value.completedAtMs }};
689685 },
@@ -793,8 +789,7 @@ namespace ai::openai::codex::backend {
793789 return {TurnErrorUpdated{value.threadId , value.turnId , value.error , value.willRetry }};
794790 },
795791 [](const typed::UnknownEvent& value) -> std::vector<BackendEvent> {
796- return {detail::preserveUnmodeledTypedEvent (
797- {value.method , value.params , value.decodingError , value.diagnostic })};
792+ return {detail::preserveUnmodeledTypedEvent ({value.method , value.params , value.decodingError , value.diagnostic })};
798793 }},
799794 event);
800795 }
0 commit comments