pi-freeflow 1.1.6 → 1.1.7

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.
Files changed (2) hide show
  1. package/extensions/index.ts +29 -11
  2. package/package.json +1 -1
@@ -1745,11 +1745,27 @@ export default async function (pi: ExtensionAPI) {
1745
1745
  ui.setStatus?.("bansos", undefined);
1746
1746
  }
1747
1747
 
1748
- // Reload persisted state on session start/resume and show status if active
1748
+ // Reload persisted state on session start/resume and show status ONLY if active model is FreeFlow
1749
1749
  pi.on?.("session_start", async (_event, ctx) => {
1750
1750
  relayState = resolveRelayState();
1751
1751
  statusUi = ctx.ui;
1752
- updateStatusBar(ctx.ui);
1752
+
1753
+ const activeModel =
1754
+ ctx && typeof ctx === "object" && "model" in ctx
1755
+ ? (ctx as { model?: { provider?: string; id?: string } }).model
1756
+ : null;
1757
+ const provider = activeModel?.provider;
1758
+ const modelId = activeModel?.id;
1759
+ const isFreeFlow =
1760
+ provider === "freeflow" ||
1761
+ Boolean(modelId && aliveCatalog.some((m) => m.id === modelId));
1762
+
1763
+ if (isFreeFlow) {
1764
+ updateStatusBar(ctx.ui);
1765
+ } else {
1766
+ // Relay status OFF / cleared when non-freeflow model is active in session
1767
+ ctx.ui?.setStatus?.("freeflow", undefined);
1768
+ }
1753
1769
  });
1754
1770
 
1755
1771
  // Update status bar immediately when user switches models
@@ -1757,16 +1773,18 @@ export default async function (pi: ExtensionAPI) {
1757
1773
  statusUi = ctx.ui;
1758
1774
  const model =
1759
1775
  event && typeof event === "object" && "model" in event
1760
- ? event.model
1761
- : null;
1762
- const provider =
1763
- model && typeof model === "object" && "provider" in model
1764
- ? String(model.provider)
1776
+ ? (event as { model?: { provider?: string; id?: string } }).model
1765
1777
  : null;
1766
- if (provider === "freeflow") {
1767
- updateStatusBar(ctx.ui, "freeflow");
1768
- } else if (provider) {
1769
- // Clear status when switched to other providers (e.g. anthropic, openai)
1778
+ const provider = model?.provider;
1779
+ const modelId = model?.id;
1780
+ const isFreeFlow =
1781
+ provider === "freeflow" ||
1782
+ Boolean(modelId && aliveCatalog.some((m) => m.id === modelId));
1783
+
1784
+ if (isFreeFlow) {
1785
+ updateStatusBar(ctx.ui);
1786
+ } else {
1787
+ // Matikan status relay seketika jika model yang dipilih bukan model FreeFlow
1770
1788
  ctx.ui?.setStatus?.("freeflow", undefined);
1771
1789
  }
1772
1790
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-freeflow",
3
3
  "type": "module",
4
- "version": "1.1.6",
4
+ "version": "1.1.7",
5
5
  "description": "Personal multi-cloud rolling fallback relay for OpenCode Zen and KiloCode models in OMP/Pi",
6
6
  "keywords": [
7
7
  "pi-package",