Skip to content

feat: implement session management for blog writing, including session persistence and follow-up handling - #32

Merged
JesseLiberty merged 1 commit into
mainfrom
short-term-memory
Sep 10, 2026
Merged

feat: implement session management for blog writing, including session persistence and follow-up handling#32
JesseLiberty merged 1 commit into
mainfrom
short-term-memory

Conversation

@JesseLiberty

Copy link
Copy Markdown
Owner

Add session object and abillty to ask follow up questions.

Copilot AI lite review requested due to automatic review settings September 10, 2026 14:35
@JesseLiberty
JesseLiberty merged commit 0005255 into main Sep 10, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The follow-up text is stored in ResearchState.CurrentSubTask, but that field is overwritten by the Blogger stage before the Author stage runs, so follow-ups won’t reliably reach the author prompt.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

This PR adds session management to the BlogWriter console workflow so users can persist state locally, resume prior sessions, and request follow-up revisions on an existing draft.

Changes:

  • Introduces a persisted BlogSession model plus an IBlogSessionStore abstraction with a JSON-on-disk FileBlogSessionStore implementation.
  • Updates the console app to create/save sessions, resume by session ID, and accept follow-up requests after printing results.
  • Extends author prompting to include an optional “user follow-up” and adds ResearchState.StartFollowUp(...) with associated tests.
File summaries
File Description
ResearchState.cs Adds StartFollowUp(...) helper to reset review-cycle state for a follow-up.
Prompts.cs Updates author instructions to mention optional user follow-up input.
Program.cs Adds session store wiring; supports resume <session-id> and follow-up loop.
IBlogSessionStore.cs New session persistence abstraction for creating/loading/saving sessions.
HostedAgents/Author/AgentPrompt.cs Keeps hosted Author prompt aligned with console app prompt changes.
FileBlogSessionStore.cs New file-backed JSON session store implementation.
BlogSession.cs New persisted session model (id/timestamps/state).
AuthorAgent.cs Includes “User Follow-Up” field in the author-turn user message; adds test-client constructor overload.
BlogWriter.Tests/ResearchStateTests.cs Adds unit test covering StartFollowUp(...) behavior.
BlogWriter.Tests/FileBlogSessionStoreTests.cs Adds round-trip test coverage for file session persistence.
docs/deployment.md Documents follow-ups, session persistence location, and resume flow.
docs/configuration.md Documents BLOG_SESSION_STORE_PATH configuration key.
Review details
  • Files reviewed: 12/12 changed files
  • Comments generated: 3
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread ResearchState.cs
Comment on lines +32 to +40
/// <summary>Prepares an approved or revision-capped draft for a user-requested follow-up.</summary>
public void StartFollowUp(string followUp)
{
ArgumentException.ThrowIfNullOrWhiteSpace(followUp);
CurrentSubTask = followUp.Trim();
ReviewNotes = "";
RevisionNumber = 0;
NextStep = "";
}
Comment thread FileBlogSessionStore.cs
Comment on lines +45 to +49
ArgumentNullException.ThrowIfNull(session);
if (!IsValidId(session.Id))
{
throw new ArgumentException("Session ID must be a 32-character hexadecimal GUID.", nameof(session));
}
Comment thread IBlogSessionStore.cs
Comment on lines +3 to +4
/// <summary>Persists completed workflow state so a user can continue a draft.</summary>
public interface IBlogSessionStore
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.

3 participants