Skip to content

feat: session persistence + prompt pipe - #10

Merged
Jonnytoshen merged 2 commits into
mainfrom
feat/session-prompt
Aug 17, 2026
Merged

feat: session persistence + prompt pipe#10
Jonnytoshen merged 2 commits into
mainfrom
feat/session-prompt

Conversation

@Jonnytoshen

Copy link
Copy Markdown
Owner

变更内容

  • Session 持久化:新增 src/session/store.ts,支持将对话消息落盘;新增 pnpm run continue--continue 参数)用于恢复上次会话。
  • Prompt Pipe:新增 src/context/prompt-builder.ts,将原本内联的 system prompt 字符串重构为可组合的 PromptBuilder 管道(coreRules / toolGuide / deferredTools / sessionContext),并支持 debug 输出各模块状态。

Commits

  • feat(session): add session persistence and --continue flag
  • feat(prompt): introduce PromptBuilder pipe for system prompt assembly

Copilot AI lite review requested due to automatic review settings August 17, 2026 03:08

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 SessionStore to append/load conversation messages and a pnpm run continue entrypoint to resume the last session.
  • Refactors the inline system prompt into a PromptBuilder pipeline (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.

Comment thread src/session/store.ts
Comment thread src/index.ts
Comment thread src/session/store.ts
@Jonnytoshen
Jonnytoshen merged commit 9ef8149 into main Aug 17, 2026
1 check passed
@Jonnytoshen
Jonnytoshen deleted the feat/session-prompt branch August 17, 2026 03:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants