@code-yeongyu/senpi 2026.5.15-3 → 2026.5.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1609,14 +1609,18 @@ export class AgentSession {
1609
1609
  shouldCompact(contextUsage.tokens, contextUsage.contextWindow, settings);
1610
1610
  if (isContextOverflow(assistantMessage, contextWindow) && (sameModel || currentContextNeedsCompaction)) {
1611
1611
  if (this._overflowRecoveryAttempted) {
1612
+ const errorMessage = "Context overflow recovery failed after one compact-and-retry attempt. Try reducing context or switching to a larger-context model.";
1612
1613
  this._emit({
1613
1614
  type: "compaction_end",
1614
1615
  reason: "overflow",
1615
1616
  result: undefined,
1616
1617
  aborted: false,
1617
1618
  willRetry: false,
1618
- errorMessage: "Context overflow recovery failed after one compact-and-retry attempt. Try reducing context or switching to a larger-context model.",
1619
+ errorMessage,
1619
1620
  });
1621
+ if (requestReason === "pre_prompt") {
1622
+ throw new Error(errorMessage);
1623
+ }
1620
1624
  return;
1621
1625
  }
1622
1626
  this._overflowRecoveryAttempted = true;