Skip to content

Commit 5ba4e43

Browse files
committed
fix(bridge): adapt pi bridge to graceful mesh degradation
MeshStore.init() no longer throws when the mesh is unavailable, so check store.connected after init and notify the user accordingly.
1 parent 3088e00 commit 5ba4e43

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

src/bridges/pi/index.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,12 @@ export default function (pi: ExtensionAPI) {
124124
pi.on("session_start", async (_event, ctx) => {
125125
uiCtx = ctx.ui;
126126

127-
try {
128-
await store.init();
129-
meshReady = true;
130-
} catch (err) {
131-
const msg = err instanceof Error ? err.message : String(err);
127+
await store.init();
128+
meshReady = store.connected;
129+
130+
if (!meshReady) {
132131
ctx.ui.notify(
133-
`Agent Comms: mesh init failed (${msg}). Running without mesh.`,
132+
"Agent Comms: mesh unavailable (no coordinator). Running without mesh.",
134133
"warning",
135134
);
136135
}

0 commit comments

Comments
 (0)