Repository navigation
feat(session): import a Claude Code session transcript as a resumable tole session - #501
Merged
Merged
Conversation
… tole session (#381) Adds tole import-claude and tole_core::ccimport: a Claude Code transcript (JSONL or claude -p stream-json) becomes a new cc-<id> session; existing sessions are untouched and a repeat import is refused. Attaching to a running claude process is deferred.
ajianaz
force-pushed
the
feat/cc-resume
branch
from
November 3, 2026 16:58
02db1fb to
5c82257
Compare
| /// checked when a new prompt starts and at end of input. | ||
| fn mark_if_settled(&mut self) { | ||
| let last_is_answer = self.entries.last().is_some_and(|e| { | ||
| e.kind.as_str() == EntryType::MESSAGE && e.payload["role"] == "assistant" |
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
…ead of poisoning every later cut point
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.
What (description of the change)
Claude Code session import (#381, import half):
tole import-claude <transcript.jsonl>turns a Claude Code session into a NEW resumable tole sessioncc-<claude-session-id>.~/.claude/projectsJSONL andclaude -p --output-format stream-jsonoutput; continue withtole resume cc-<id> "<prompt>".message;tool_use->intent(cc_<tool_use_id>,replay: never,batch: truewhen several in one response);tool_result-> result (orerrorwhenis_error), parented under its intent. Claude Code tool names are kept as history only, never executed.fact/cc_importregister; header takes the transcript'scwd; entry timestamps from the transcript.Final; a dangling prompt or open tool call is dropped and reported.claudeprocess + double-attach guard (separate slice), live provider round trip.Why (the problem you're solving)
Closes #381 — Claude Code sessions were dead ends; there was no way to carry their history into tole's durable, resumable sessions.
Testing (how you verified this works)
cargo test -p tole-core --test cc_importfailed to compile (noccimportmodule /cwd()). GREEN after implementation.cc_import8/8 (mapping, cut point, double-import refusal, malformed-line skip, fixture re-import + new turn via MockProvider with imported entries untouched);import_claude_e2e1/1.cargo fmt --all -- --checkclean;cargo clippy --workspace --all-targets -- -D warningsclean;cargo test --workspace --no-fail-fast992 passed / 0 failed (61 binaries);cargo test --workspace --no-fail-fast --no-default-features861 passed / 0 failed (59 binaries);cargo build -p tole-cli --no-default-featuresOK. No feature gates needed — the new code compiles in both profiles.