Skip to content

Vague task instruction#1

Draft
DRunkPiano114 wants to merge 3 commits intomainfrom
cursor/vague-task-instruction-a466
Draft

Vague task instruction#1
DRunkPiano114 wants to merge 3 commits intomainfrom
cursor/vague-task-instruction-a466

Conversation

@DRunkPiano114
Copy link
Owner

@DRunkPiano114 DRunkPiano114 commented Feb 27, 2026

Refactor frontend to enhance code structure, type safety, and readability by unifying submission parameters and extracting core logic.

This refactoring addresses several areas to improve maintainability and reduce potential issues:

  • Unified Submission Parameters: Replaced six positional parameters with a single ResearchRequest object across InputForm, WelcomeScreen, ChatMessagesView, and App to prevent parameter order errors and reduce coupling.
  • Extracted App Logic: Moved query construction, effort-to-config mapping, and stream event processing into pure helper functions in App.tsx for clearer separation of concerns and simplified event handling.
  • Tightened Type Definitions: Reduced any usage in App.tsx, ActivityTimeline.tsx, and ChatMessagesView.tsx by introducing explicit types like ResearchRequest, ResearchEffort, and unknown for better type safety.
  • Improved Markdown Rendering Types: Updated ChatMessagesView to use specific react-markdown Components types, removing overly broad index signatures.

Open in Web Open in Cursor 


Note

Low Risk
Primarily a TypeScript refactor that changes call signatures and type handling across several components; low functional risk but could surface runtime issues if any assumptions about stream event/message shapes were incorrect.

Overview
Refactors the frontend research flow to pass a single typed ResearchRequest object (new types/research.ts) through InputFormWelcomeScreen/ChatMessagesViewApp, replacing multiple positional args.

In App.tsx, extracts query building, effort→settings mapping, and stream update→timeline mapping into helpers, and tightens useStream callbacks to use unknown + explicit event shapes with safer error stringification.

Improves type safety and rendering robustness by changing ProcessedEvent.data to unknown, centralizing timeline data formatting, and typing react-markdown components while normalizing message content to text for markdown display/copy.

Written by Cursor Bugbot for commit bfcb3ba. This will update automatically on new commits. Configure here.

cursoragent and others added 3 commits February 27, 2026 23:08
…pers

Co-authored-by: drunkpiano <DRunkPiano114@users.noreply.github.com>
Co-authored-by: drunkpiano <DRunkPiano114@users.noreply.github.com>
Co-authored-by: drunkpiano <DRunkPiano114@users.noreply.github.com>
@cursor
Copy link

cursor bot commented Feb 27, 2026

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@DRunkPiano114
Copy link
Owner Author

@cursor review this

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Free Tier Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

// convert effort to initial_search_query_count and max_research_loops
let initial_search_query_count = 0;
let max_research_loops = 0;
switch (effort) {
Copy link

Choose a reason for hiding this comment

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

Finalize flag decoupled from event priority chain

Low Severity

The hasFinalizeEventOccurredRef.current = true check is now independent of mapUpdateEventToTimelineEvent, but in the old code it was inside the else if chain. Previously, if an event had both generate_query (or web_research/reflection) and finalize_answer, the finalize flag would not be set because the earlier else if branch would match first. Now the flag is set whenever finalize_answer is truthy regardless of other properties, which could prematurely trigger the useEffect that archives the timeline into historicalActivities.

Additional Locations (1)

Fix in Cursor Fix in Web

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