Skip to content

feat: pi v4 sessions, web workstream, and Open Connector (post-beta.43) - #139

Draft
geminixiang wants to merge 13 commits into
mainfrom
dev
Draft

geminixiang wants to merge 13 commits into
mainfrom
dev

Conversation

@geminixiang

@geminixiang geminixiang commented Aug 25, 2026

Copy link
Copy Markdown
Owner

Summary

Holds everything that landed on main after 1.0.0-beta.43 (95736a1), before main was reset to that tag. Parked here until upstream pi's session rework (WP05/WP06 on earendil-works/pi dev) settles into a release.

Contents (13 commits)

pi v4 session migration (blocked on upstream):

  • eb7d8b8 feat(harness): upgrade pi to 0.84.2 with v3 session shim
  • 7a61b7b feat(harness)!: adopt pi v4 sessions with migration CLI
  • 5658232 refactor(harness): simplify v4 session facade
  • 5962860 fix(sessions): serialize pi v4 session writers
  • 85ef8f7 fix(sessions): enforce single-writer ownership

Web workstream (partially depends on v4 SessionStore async API):

  • 57e85f3 feat(web): add durable OAuth account authority
  • 3fbebb8 feat(web): add authorized workspace APIs
  • 066ab69 feat(web): add runtime adapter and scoped streaming
  • f67ff51 feat(web): add formal React application

Independent of v4:

Depends on v4 (heavy readHeader/async usage):

  • 8e389d4 fix(runtime): centralize implicit lifecycle rules

Why main was reset

Upstream pi dev is actively reshaping the v4 JSONL format (header shape changed to {"kind":"header","v":4}, storageVersion/nextSeq added, header metadata removed, v3 now upgraded transparently at open). Adopting 0.84.2's v4 now means migrating twice. main stays on pi 0.83.0 / v3 sessions until a stable release.

Before merging

  • Upstream pi release with settled session format
  • Re-align session-store.ts facade with the released header shape (esp. mikan header-extras strategy, since header metadata may be gone)
  • Re-verify mikan sessions migrate against the released format
  • Full gate: lint, fmt:check, knip, build, test

geminixiang and others added 13 commits August 15, 2026 23:32
pi 0.84 moves sessions to a v4 entry model (seq, numeric timestamps,
compaction via inline retainedTail) and deletes the v3 entry types.
Mikan keeps its v3 on-disk format: the v3 types now live in
harness/types.ts, and pi-session.ts converts a v3 branch to equivalent
v4 entries at the pi boundary (context build + compaction), recovering
firstKeptEntryId from the prepared retained tail.

Also adds docs/research/web-harness-plan.md: v4 session adoption is
deferred to Phase 1 of the web harness so the format migrates once.
SessionStore is now an async facade over pi-agent-core's v4
Session/JSONL storage at mikan-chosen session-key paths; the v3
runtime shim is deleted. Session naming uses the v4 name fact
(setSessionName), custom messages persist as role:"custom" message
entries, mikan header extras ride in the v4 header metadata, and the
compaction event reports retainedMessages instead of firstKeptEntryId.

`mikan sessions migrate [--dry-run]` converts legacy v3 files: each
migrated file is re-opened with pi's reader and its rebuilt context
verified against the v3 reference semantics before replacing the
original (kept as .v3.bak). Runtime reads of v3 files fail loudly with
a pointer at the migrator — including the current-pointer path, so an
unmigrated session is never silently rotated away. Deploy order:
stop daemon, migrate, start.

Fixes flushed out by the migration: biweekly rotation now accepts the
numeric v4 createdAt header field; two floating resetSession calls in
conversation-runtime are awaited; the facade JSON round-trips payloads
at the persist boundary because pi's agent loop emits explicit
undefined props that pi's own v4 durable-payload validator rejects.
Use explicit scheduled-event origins, exhaustively classify settings effects, and resolve Session View history through durable office-scoped session identities.
Await incremental history sync and keep one writable session handle per runtime target so pi v4 sequence state cannot diverge.
Add per-path writer claims, read-only session inspection, drained close semantics, and settle-before-replace runtime lifecycle for pi v4 sessions.
Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant