feat: pi v4 sessions, web workstream, and Open Connector (post-beta.43) - #139
Draft
geminixiang wants to merge 13 commits into
Draft
geminixiang wants to merge 13 commits into
geminixiang wants to merge 13 commits into
Conversation
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.
…e and personal GitHub (#137)
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Holds everything that landed on
mainafter1.0.0-beta.43(95736a1), beforemainwas reset to that tag. Parked here until upstream pi's session rework (WP05/WP06 onearendil-works/pidev) settles into a release.Contents (13 commits)
pi v4 session migration (blocked on upstream):
eb7d8b8feat(harness): upgrade pi to 0.84.2 with v3 session shim7a61b7bfeat(harness)!: adopt pi v4 sessions with migration CLI5658232refactor(harness): simplify v4 session facade5962860fix(sessions): serialize pi v4 session writers85ef8f7fix(sessions): enforce single-writer ownershipWeb workstream (partially depends on v4
SessionStoreasync API):57e85f3feat(web): add durable OAuth account authority3fbebb8feat(web): add authorized workspace APIs066ab69feat(web): add runtime adapter and scoped streamingf67ff51feat(web): add formal React applicationIndependent of v4:
d5759acfeat(connector): host-side Open Connector gateway (feat(connector): host-side Open Connector gateway for Google Workspace and personal GitHub #137) — integration quality not up to standard; do NOT cherry-pick as-is, re-integrate deliberately later1a7dd0bfix(slack-e2e): mark synthetic event origin5e288bddocs(agents): consolidate duplicate rules in AGENTS.md (docs(agents): consolidate duplicate rules in AGENTS.md #138)Depends on v4 (heavy
readHeader/async usage):8e389d4fix(runtime): centralize implicit lifecycle rulesWhy main was reset
Upstream pi dev is actively reshaping the v4 JSONL format (header shape changed to
{"kind":"header","v":4},storageVersion/nextSeqadded, headermetadataremoved, v3 now upgraded transparently at open). Adopting 0.84.2's v4 now means migrating twice.mainstays on pi 0.83.0 / v3 sessions until a stable release.Before merging
session-store.tsfacade with the released header shape (esp. mikan header-extras strategy, since headermetadatamay be gone)mikan sessions migrateagainst the released format