Add provider handoff compaction on model switches #1911
Closedjuliusmarmingewants to merge 2 commits into
main fromt3code/provider-switch-compactionopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:trusted
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:XL
- @@ -1144,4 +1156,3 @@1144115611451157 const shouldApplyRuntimeError = !STRICT_PROVIDER_LIFECYCLE_GUARD11461158 ? true1147- : activeTurnId === null || eventTurnId === undefined || sameId(activeTurnId, eventTurnId);@@ -0,0 +60,21 @@60+61+ return Object.entries(record).flatMap(([key, entry]) =>62+ IGNORED_OBJECT_KEYS.has(key) ? [] : extractStrings(entry, depth + 1),63+ );64+}65+66+function looksLikeCompactionItem(value: unknown): boolean {67+ if (!value || typeof value !== "object") {68+ return false;69+ }70+ const record = value as Record<string, unknown>;71+ const type = normalizeType(record.type ?? record.kind);72+ if (COMPACTION_TYPE_SNIPPETS.some((snippet) => type.includes(snippet))) {73+ return true;74+ }75+ return (76+ typeof record.compact_summary === "string" ||77+ typeof record.compactSummary === "string" ||78+ typeof record.summary === "string"79+ );80+}
juliusmarminge closed this
Sign in to join this conversation.



Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID:
ddcccd1a-acdd-46c7-b21b-68bf95362e3dYou can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment `@coderabbitai help` to get the list of available commands and usage tips.