@parall/parel-channel 1.55.0 → 1.55.2

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.
package/dist/inbound.js CHANGED
@@ -636,19 +636,20 @@ async function effectsForTypedDispatch(data, ctx) {
636
636
  const results = await report(sessionId);
637
637
  if (results.includes('stale')) {
638
638
  await invalidateSession(ctx);
639
+ sessionId = null;
639
640
  const fresh = await ensureSession(ctx);
640
- if (fresh && fresh !== sessionId) {
641
- await report(fresh);
642
- sessionId = fresh;
641
+ if (fresh) {
642
+ const retry = await report(fresh);
643
+ if (!retry.includes('stale'))
644
+ sessionId = fresh;
643
645
  }
644
646
  }
645
647
  }
646
- // Typed turns carry the capability env too: a task or schedule is exactly
647
- // where "create the Feishu doc / check the calendar" work is assigned, so
648
- // the every-turn capability contract covers them (null when ungranted or
649
- // the mint degrades; never blocks the emit).
648
+ // Typed turns carry capability env too: tasks and schedules are where
649
+ // Feishu doc/calendar work is assigned. A degraded mint never blocks emit.
650
650
  const capabilityEnv = await channelCapabilityEnv(ctx);
651
651
  const typedContext = {
652
+ ...(sessionId ? { PRLL_SESSION_ID: sessionId } : {}),
652
653
  ...(plan.chatId ? { PRLL_CHAT_ID: plan.chatId, PRLL_TRIGGER_MESSAGE_ID: sourceId } : {}),
653
654
  ...(capabilityEnv ?? {}),
654
655
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parall/parel-channel",
3
- "version": "1.55.0",
3
+ "version": "1.55.2",
4
4
  "description": "Parall channel plugin for the parel runtime — lets a parel agent treat Parall as a managed_ws channel (receive dispatches, reply via the Parall API)",
5
5
  "license": "MIT",
6
6
  "repository": {
package/src/inbound.ts CHANGED
@@ -796,20 +796,20 @@ async function effectsForTypedDispatch(
796
796
  const results = await report(sessionId);
797
797
  if (results.includes('stale')) {
798
798
  await invalidateSession(ctx);
799
+ sessionId = null;
799
800
  const fresh = await ensureSession(ctx);
800
- if (fresh && fresh !== sessionId) {
801
- await report(fresh);
802
- sessionId = fresh;
801
+ if (fresh) {
802
+ const retry = await report(fresh);
803
+ if (!retry.includes('stale')) sessionId = fresh;
803
804
  }
804
805
  }
805
806
  }
806
807
 
807
- // Typed turns carry the capability env too: a task or schedule is exactly
808
- // where "create the Feishu doc / check the calendar" work is assigned, so
809
- // the every-turn capability contract covers them (null when ungranted or
810
- // the mint degrades; never blocks the emit).
808
+ // Typed turns carry capability env too: tasks and schedules are where
809
+ // Feishu doc/calendar work is assigned. A degraded mint never blocks emit.
811
810
  const capabilityEnv = await channelCapabilityEnv(ctx);
812
811
  const typedContext: Record<string, string> = {
812
+ ...(sessionId ? { PRLL_SESSION_ID: sessionId } : {}),
813
813
  ...(plan.chatId ? { PRLL_CHAT_ID: plan.chatId, PRLL_TRIGGER_MESSAGE_ID: sourceId } : {}),
814
814
  ...(capabilityEnv ?? {}),
815
815
  };