Serverless-harness glue: adapts the generic @sh/session-backend log store to Pi's
SessionStorageBackend, with write-behind durability.
BufferedRedisBackend— write-behind decorator (queue +flush()); implements Pi'sSessionStorageBackendover aLogStore(RedisSessionBackend).flushExtension— flushes atturn_endandsession_shutdown.cli.ts— headless one-shot smoke entry (resume viaPI_SESSION_ID).
The pi-fork workspace packages must be built before the harness can import the
compiled @earendil-works/pi-coding-agent (and @earendil-works/pi-ai). Build them in
dependency order:
for p in ai agent tui coding-agent; do pnpm -C pi-fork/packages/$p build; donepnpm -C harness test— decorator units + the SessionManager↔Redis integration test (needs Redis atREDIS_URL, defaultredis://127.0.0.1:6379).
pnpm -C harness exec tsx src/cli.ts "<prompt>"runs one turn; setPI_SESSION_IDto resume an existing session from Redis. Requires a model credential.- Gateway: pinned Pi reads
ANTHROPIC_API_KEYand a fixed base URL.cli.tsincludes an env-gated bridge so a Bearer-token gateway works viaANTHROPIC_BASE_URL+ANTHROPIC_AUTH_TOKEN(base URL is overridden and auth is sent asAuthorization: Bearer).
harness → { pi-fork, @sh/session-backend }. Pi core never imports Redis or
@sh/session-backend.