Something went wrong. Try again.
watches turns and automatically creates and resolves tasks that get pinned into main agent context
Something went wrong. Try again.
617 B · 15 lines
TypeScript
at main
12345678910111213141516import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
/** * A reconciliation outlives the session it began in, and every extension ctx accessor throws once * that session is replaced or reloaded. Reading the branch is the only way to ask, so a replaced * session answers "no" instead of throwing into callers that have nowhere to catch it. */export function onLiveBranch(ctx: ExtensionContext, entryId: string | null): boolean { try { const branch = ctx.sessionManager.getBranch(); return entryId === null || branch.some((entry) => entry.id === entryId); } catch { return false; }}