Skip to content

feat: enhance research functionality with query building and refinement tracking - #37

Merged
JesseLiberty merged 1 commit into
mainfrom
revision-implementation-continued
Sep 11, 2026
Merged

JesseLiberty merged 1 commit into
mainfrom
revision-implementation-continued

Conversation

@JesseLiberty

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI lite review requested due to automatic review settings September 11, 2026 13:10
@JesseLiberty
JesseLiberty merged commit cb4f77a into main Sep 11, 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 research path is bypassed, and query context can grow recursively.

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

Pull request overview

Enhances research follow-ups with contextual query construction, refinement tracking, output formatting changes, and tests.

Changes:

  • Tracks refinements and prior findings in research queries.
  • Uses constructed queries in ResearcherAgent.
  • Adjusts result metadata output and adds query-building tests.
File summaries
File Summary Findings
ResearchState.cs Tracks refinements and builds contextual queries. Moderate (1 vote): Query context can grow recursively, including failed queries. Nit (3 votes): The active subtask may be duplicated in refinement history.
ResearcherAgent.cs Sends constructed queries to the research agent. Critical (2 votes): Follow-up flow bypasses the refinement query and research stage.
Program.cs Reorders result metadata output. Nit (3 votes): Duplicate and misplaced result separators remain.
BlogWriter.Tests/ResearchStateTests.cs Tests query composition. No findings.
Review details

Suppressed comments (1)

ResearchState.cs:69

  • Passing every prior finding through the next query makes the request grow on every refinement. If the hosted agent rejects an oversized query, InvokeAsync falls back with a string containing the entire query, and this code stores that string as another finding, so later queries can recursively balloon and repeatedly fail. Bound or summarize the prior context and avoid persisting the failed query as a finding.
            string context = string.Join("\n\n", ResearchFindings
                .Where(f => !string.IsNullOrWhiteSpace(f))
                .Select(f => f.Trim()));
  • Files reviewed: 4/4 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 ResearcherAgent.cs
{
string subTask = !string.IsNullOrEmpty(state.CurrentSubTask) ? state.CurrentSubTask : state.MainTask;
_logger.LogInformation("Researching: {SubTask}", subTask);
string query = state.BuildResearchQuery();
Comment thread Program.cs
Comment on lines 211 to +214
Console.WriteLine("=============================");
Console.WriteLine($"\n\nRevision Number: {result.RevisionNumber}");
Console.WriteLine($"\nSession: {session.Id}\n");
Console.WriteLine("=============================");
Comment thread ResearchState.cs
Comment on lines +55 to +57
string uniqueRefinements = string.Join(" | ", SearchRefinements
.Where(r => !string.IsNullOrWhiteSpace(r))
.Distinct(StringComparer.OrdinalIgnoreCase));
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