Skip to content

Ask minimum and maximum size for blog post - #22

Merged
JesseLiberty merged 1 commit into
mainfrom
AskSize
Sep 1, 2026
Merged

Ask minimum and maximum size for blog post#22
JesseLiberty merged 1 commit into
mainfrom
AskSize

Conversation

@JesseLiberty

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI lite review requested due to automatic review settings September 1, 2026 20:17
@JesseLiberty
JesseLiberty merged commit c923265 into main Sep 1, 2026
1 check passed

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.

🟡 Changes recommended

There are confirmed logic issues in the new word-count input handling and in failure cases where draft generation can leave an empty draft that still proceeds through review.

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

Pull request overview

This PR adds configurable target word count bounds (min/max) to the blog-writing workflow, passing them through the state into the author and reviewer prompts so drafts can be generated and evaluated against a user-provided size range.

Changes:

  • Add MinWords/MaxWords (with defaults) to ResearchState and include the range in author/reviewer turn messages.
  • Prompt the user for min/max word counts in Program.cs and thread them into the initial workflow state.
  • Update author prompt text and author agent behavior to avoid overwriting an existing draft when generation returns no content.
File summaries
File Description
ReviewerAgent.cs Includes the target word-count range in the reviewer’s per-turn input message.
ResearchState.cs Adds default min/max constants plus MinWords/MaxWords to workflow state.
Prompts.cs Updates author/reviewer system prompts to reference the user-provided word-count range.
Program.cs Prompts for min/max word counts, injects into initial state, adjusts output note on revision cap, and changes temperature default.
IAuthorAgent.cs Updates the author agent contract to allow null draft output.
AuthorAgent.cs Adds word-count range to author input message and avoids clobbering existing drafts when generation yields no content.
Review details
  • Files reviewed: 6/6 changed files
  • Comments generated: 4
  • 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 AuthorAgent.cs
Comment on lines +106 to +111
if (string.IsNullOrEmpty(draft))
{
// Keep whatever draft already exists rather than clobbering it with a
// placeholder — an empty/failed generation shouldn't erase real content.
_logger.LogWarning("Author agent produced no draft; keeping the previous draft (if any).");
}
Comment thread Program.cs
var chatOptions = new ChatOptions
{
Temperature = 0,
Temperature = 1,
Comment thread Program.cs
Comment on lines +162 to +165
if (string.IsNullOrWhiteSpace(input))
{
return defaultValue;
}
Comment thread Program.cs
Comment on lines +229 to +234
if (result.RevisionNumber >= ResearchState.MaxRevisions)
{
// The revision cap terminates the loop even if the reviewer never approved —
// call that out so the draft above isn't mistaken for a reviewer-approved one.
Console.WriteLine("Note: Maximum revision limit reached; draft above printed as-is.");
}
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