Skip to content

Instantly share code, notes, and snippets.

View bdsqqq's full-sized avatar
🎨

Igor Bedesqui bdsqqq

🎨
View GitHub Profile

Durable Sessions and Reconstruction in Pi

This note explains how to think about durable state in Pi when the user navigates the session tree with /tree, starts a new session, resumes another session, or forks.

The short version:

  • Pi sessions are an append-only tree of entries with a movable leaf pointer.
  • /tree does not restart the extension runtime. It changes the active leaf and rebuilds the active conversation context.
  • If your extension keeps in-memory state, you are responsible for reconstructing it from durable session entries.
  • The central design decision is whether your state should be:
@bdsqqq
bdsqqq / git.migrate
Created February 18, 2022 18:04 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.