feat: session persistence + prompt pipe - #10
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds two user-facing capabilities to the CLI agent: persisting conversation history across runs, and restructuring the system prompt into a composable “PromptBuilder” pipeline to make prompt assembly more maintainable and inspectable.
Changes:
- Introduces a JSONL-based
SessionStoreto append/load conversation messages and apnpm run continueentrypoint to resume the last session. - Refactors the inline system prompt into a
PromptBuilderpipeline (coreRules,toolGuide,deferredTools,sessionContext) with a debug display of pipe status. - Updates gitignore to exclude persisted session files.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/session/store.ts | Adds JSONL session persistence (append/load/exists) for chat messages. |
| src/index.ts | Wires session restore/persist flow into the CLI loop and switches system prompt creation to PromptBuilder. |
| src/context/prompt-builder.ts | Adds a pipe-based system prompt builder and predefined pipe functions. |
| package.json | Adds continue script to run the CLI with --continue. |
| .gitignore | Ignores the .sessions directory used for persisted sessions. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
变更内容
src/session/store.ts,支持将对话消息落盘;新增pnpm run continue(--continue参数)用于恢复上次会话。src/context/prompt-builder.ts,将原本内联的 system prompt 字符串重构为可组合的PromptBuilder管道(coreRules/toolGuide/deferredTools/sessionContext),并支持 debug 输出各模块状态。Commits