Add runnable Pi session service - #4
Open
c0da-ricon wants to merge 3 commits into
Open
Conversation
This was referenced Aug 6, 2026
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
mise run serveadapter with explicit model, prompt, workspace, agent, session, token, and listen inputs0700and atomic history/session artifacts with mode0600Validation
mise run checkopenai-codex/gpt-5.6-lunaSTEIN_SMOKE_OKthrough/v1/chat/completions0600Boundary
This PR ports reusable runtime behavior, not Grow Heal Love product policy or private data. It does not add deployment, ambient credentials, tools, prompt content, or a dependency from GHL back to Stein. The live smoke used temporary local files only and left no service or model artifacts running.
Self-review correction
Adversarial review found that the Pi JSONL could advance before visible conversation history committed. A model failure, client abort, or visible-history save failure could therefore leave an abandoned turn active when the conversation retried.
The service now checkpoints the current Pi leaf before each turn and treats visible-history persistence as the commit boundary. Any pre-commit failure aborts the turn, branches or resets back to the checkpoint, appends a plain
stein.turn_rollbackmarker, and disposes the failed session before allowing a clean retry. Rollback failure preserves the original turn failure for diagnosis.Focused coverage proves model failure, active abort, visible-history save failure, prior-leaf and null-root rollback, and a real
SessionManagerreopen where the abandoned branch is inactive and the rollback marker is absent from model context. The refreshed full gate passed strict TypeScript, 40/40 tests, all six Codebase lints, and the whitespace check in 4.910 seconds. A real Luna persistence/retry smoke forced visible-history save failure and verified that a fresh retry answered from empty committed history while the abandoned turn stayed outside reopened model context; all private temporary state was removed.