Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Address PR comments
  • Loading branch information
westey-m committed Apr 30, 2026
commit 9c463a4efcf6716a5a2c4ddbb373be8feea7baa4
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,11 @@ public async Task<string> ReadSelectionAsync(string title, IList<string> choices
/// <summary>
/// Writes the stream-complete footer (handles "no text response" fallback, resets color).
/// </summary>
public async Task WriteStreamFooterAsync(bool hasApprovalRequests)
public async Task WriteStreamFooterAsync(bool hasFollowUpMessages)
{
await this._spinner.StopAsync();

if (!this._hasReceivedAnyText && !hasApprovalRequests)
if (!this._hasReceivedAnyText && !hasFollowUpMessages)
{
System.Console.ForegroundColor = ConsoleColor.DarkYellow;
System.Console.Write("\n (no text response from agent)");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ public static async Task RunAgentAsync(AIAgent agent, string title, string userP
{
options ??= new();

Comment thread
westey-m marked this conversation as resolved.
Resolved
if (options.EnablePlanningUx
&& (string.IsNullOrWhiteSpace(options.PlanningModeName) || string.IsNullOrWhiteSpace(options.ExecutionModeName)))
{
throw new ArgumentException(
"When EnablePlanningUx is true, both PlanningModeName and ExecutionModeName must be configured.",
nameof(options));
}

System.Console.WriteLine($"=== {title} ===");
System.Console.WriteLine(userPrompt);

Expand Down Expand Up @@ -162,7 +170,7 @@ private static async Task RunAgentTurnAsync(
}
}

await writer.WriteStreamFooterAsync(hasApprovalRequests: hasObserverMessages);
await writer.WriteStreamFooterAsync(hasFollowUpMessages: hasObserverMessages);
nextMessages = combinedMessages.Count > 0 ? combinedMessages : null;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public override async Task OnContentAsync(ConsoleWriter writer, AIContent conten

if (!string.IsNullOrWhiteSpace(errorContent.Details))
{
errorText += $" details: {errorContent.Details})";
errorText += $" details: {errorContent.Details}";
}

await writer.WriteInfoLineAsync(errorText, ConsoleColor.Red);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,14 @@ private async Task<string> RenderApprovalAndCollectResponseAsync(ConsoleWriter w
string? feedback = await writer.ReadLineAsync(
"Your feedback: ",
ConsoleWriter.GetModeColor(options.PlanningModeName, options.ModeColors));
return string.IsNullOrWhiteSpace(feedback) ? "Approved" : feedback;

if (string.IsNullOrWhiteSpace(feedback))
{
// Treat empty feedback as no changes — re-prompt the agent with the plan.
return "No changes suggested. Please re-present the plan for approval.";
}

return feedback;
}

// Custom freeform input — treat as suggested changes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@

1. Analyze the request with the purpose of building a research plan.
2. Create a list of todo items.
3. If needed, use the provided tools do some exploratory checks to help build a plan and determine what clarifying questions you may need from the user.
3. If needed, use the provided tools to do some exploratory checks to help build a plan and determine what clarifying questions you may need from the user.
4. Ask for clarifications from the user where needed.
1. Ask each clarification one by one.
2. When asking for clarification and you have specific options in mind, present them to the user, so they can choose the option instead of having to retype the entire response.
3. Do not proceed until you have received all the needed clarifications.
4. Do short exploratory research if it helps with being able to ask sensible clarifications from the user.
5. Write the plan to a memory file, so that it is retained even if compaction happens. Make sure to update the plan file if the user requests changes.
6. Present the plan to the user and ask for approval to switch to execute mode and process the plan.
76. When approval is granted, always switch to execute mode (using the `AgentMode_Set` tool), and follow the steps for *Execute mode*.
7. When approval is granted, always switch to execute mode (using the `AgentMode_Set` tool), and follow the steps for *Execute mode*.

*Execute Mode*

Expand Down
Loading