-
Notifications
You must be signed in to change notification settings - Fork 12
Session checkpoints for --session #12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mattzcarey
wants to merge
22
commits into
main
Choose a base branch
from
session-checkpoints
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
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
- Use std.json.Value for flexible content parsing (content can be string or array) - Increase file read limit from 10MB to 500MB for large session files - Remove unused struct types (JsonMessage, JsonContent, JsonContentBlock, JsonEntry) The previous approach using typed structs with union(enum) for content didn't work because Zig's JSON parser cannot automatically determine which union variant to use from raw JSON. Using std.json.Value allows manual type checking and proper handling of both string and array content.
- Add revision range support (e.g., origin/main..HEAD) - Add --session flag to show session summary table - Show prompts per commit in markdown table format - Useful for generating PR descriptions with AI context
This reverts commit d4df440.
Tests for parseJsonlEntry, formatTimestamp, and formatSessionMarkdown functions used in session checkpoint tracking.
Implement readOpenCodeEntriesAfter function to parse OpenCode session
data with checkpoint support, similar to the existing Claude
implementation.
OpenCode stores session data in:
- ~/.local/share/opencode/storage/session/{project_id}/{session_id}.json
- ~/.local/share/opencode/storage/message/{session_id}/msg_*.json
- ~/.local/share/opencode/storage/part/{message_id}/prt_*.json
Key changes:
- Add readOpenCodeEntriesAfter to parse OpenCode sessions
- Add findOpenCodeSession to locate sessions by working directory
- Add parseOpenCodeMessage to parse message files and their parts
- Add formatEpochMs to convert OpenCode epoch timestamps to ISO format
- Add tests for all new OpenCode parsing functions
Add tests for parseOpenCodeMessage edge cases: - String timestamp fallback behavior - Empty time object handling - Extra/unknown fields gracefully ignored Add tests for convertJsonlToArray: - Single line conversion - Multiple lines conversion - Empty input handling - Blank lines filtering - Trailing newline handling - Nested JSON structure preservation
…ompt - Claude headless mode now uses --dangerously-skip-permissions -p - Add optional [prompt] argument to git agent run for operator guidance - Create docs/ralph.md documenting the RALPH agent spawning process - Update integration tests to expect new Claude flags
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
This PR adds the
--sessionflag tozagi logfor viewing AI conversation transcripts stored in git notes, along with session checkpoint support for efficient delta-based storage.Features
Session Transcripts (
--sessionflag)zagi log --sessionrefs/notes/sessionDelta-Based Storage (Checkpoints)
refs/notes/session-checkpointSession Parsing
~/.claude/projects/~/.opencode/sessions/Bug Fixes
--dangerously-skip-permissionsto Claude executor for headless mode[prompt]argument togit agent runfor operator guidanceDocumentation
docs/plan-session-checkpoints.md- Design documentdocs/ralph.md- RALPH agent loop documentationKey Changes
src/cmds/detect.zigsrc/cmds/commit.zigsrc/cmds/log.zig--sessionflag displaysrc/cmds/agent.zigUsage
Test Plan
--promptzagi log --sessiondisplays transcripts correctly--dangerously-skip-permissions -prunsubcommand🤖 Generated with Claude Code