Repository navigation
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| const selected = | ||
| message.role === "assistant" | ||
| ? message.parts.slice(-12) | ||
| : message.parts.slice(0, 12); |
There was a problem hiding this comment.
🟡 Trailing placeholders erase Assistant state
When 12 trailing placeholders follow useful state, selected drops the latest useful Assistant part. The continuation retains placeholders and labels the useful state as omitted.
Learn more
Assistant messages can contain blank text and omitted parts for native bookkeeping. The 12-part cap currently selects by position alone. Therefore, 12 trailing placeholders displace every useful text, tool, or file part before them. The later useful flag examines the complete message, so it still marks this now-empty excerpt useful and preserves it during message reduction.
Example: An Assistant message contains one text part saying Verification still pending, followed by 12 step-finish parts projected as omitted. The brief includes 12 omission placeholders and 1 earlier parts omitted, but loses the verification state.
Recommended fix: Select the newest 12 useful Assistant parts while retaining any necessary omission marker. Define usefulness consistently with the message-level predicate, and add coverage where useful text precedes at least 12 blank or omitted parts.
Was this helpful? React with 👍 or 👎 to provide feedback.
Primary change type
Problem and motivation
Oversized retained turns could lose the latest Assistant result, and a contradictory sibling legacy association could suppress the original native import.
Summary and scope
Reduce briefs structurally while preserving user context and the newest useful Assistant messages/parts, with deterministic omission markers. Reject a matching native scope whose saved workspace contradicts the requested binding before any replacement creation.
Related work
Related issue: https://linear.app/sapiom/issue/SAP-3292
Depends on #1020. Native stack target: main.
Validation
46 focused tests passed, including association, Resume receipt, brief and Continue integration cases. Full Harness server/web TypeScript, scoped ESLint and diff checks passed.
Tests and documentation
Added newest-message/part/empty-message pressure cases and legitimate-vs-contradictory sibling association cases. Updated assistant-history.md. Increment:200 changed lines including tests/docs/changeset; SDK pr:size is absent.
Compatibility and release impact
Security
AI assistance
Checklist