Normalize typed provider runtime ingestion#1475
Open
juliusmarminge wants to merge 2 commits intomainfrom
Open
Conversation
- Read `turn.completed` and `runtime.error` data from typed payloads - Preserve runtime error activities when payload message is present - Add regression coverage for runtime.error activity ingestion
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
- add a type guard for legacy `turn.completed` runtime events - normalize legacy payloads with typed `ProviderRuntimeEvent` shapes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
runtime.erroractivities by ingesting the typedpayload.messagefield.payload.stateandpayload.errorMessagefields.runtime.erroractivities from typed payloads.Testing
bun fmtbun lintbun typecheckbun run testNote
Medium Risk
Changes how provider runtime events are parsed for session state and activity logging, which can affect error/turn status projection and user-visible diagnostics. Scope is localized and covered by updated tests, but mistakes could silently misclassify turn outcomes or drop error details.
Overview
Provider runtime ingestion now treats runtime events as typed data.
ProviderRuntimeIngestiondrops the legacy “payload as record” parsing helpers and readsevent.payloadfields directly forturn.completed(state + error message) andruntime.error(message).Behavioral change:
runtime.erroris always converted into a thread activity usingpayload.message(and sessionlastError), rather than conditionally emitting only when a message could be extracted.Tests update the harness to normalize legacy
turn.completedevents (status/errorMessage→ typedpayload) and add coverage assertingruntime.erroractivities persist the typed message.Written by Cursor Bugbot for commit 6774415. This will update automatically on new commits. Configure here.
Note
Normalize typed provider runtime event ingestion by reading directly from typed payload fields
asString,runtimePayloadRecord,runtimeTurnState,runtimeTurnErrorMessage,runtimeErrorMessageFromEvent) in ProviderRuntimeIngestion.ts that defensively extracted values from untyped payloads.turn.completedsession status andlastErrornow read directly fromevent.payload.stateandevent.payload.errorMessage.runtime.erroractivities are now always emitted usingevent.payload.message; previously no activity was emitted if the message was absent.turn.completedevents (with top-levelstatus/errorMessage) into the typed payload shape before publishing.runtime.errorno longer falls back to a default string forruntimeErrorMessage; ifevent.payload.messageis absent, no error message is set.Macroscope summarized 6774415.