Skip to content

chore(core): remove sub-goals feature from LLM planning#1975

Merged
quanru merged 3 commits intomainfrom
claude/refactor-llm-planning-FFHmp
Feb 14, 2026
Merged

chore(core): remove sub-goals feature from LLM planning#1975
quanru merged 3 commits intomainfrom
claude/refactor-llm-planning-FFHmp

Conversation

@yuyutaotao
Copy link
Collaborator

Summary

This PR removes the sub-goals planning feature from the LLM planning system. The feature was previously controlled by the deepThink option and allowed the AI to break down tasks into multiple sub-goals with status tracking. This change simplifies the planning logic by removing all sub-goal related functionality.

Key Changes

  • Removed sub-goal parsing: Deleted parseSubGoalsFromXML and parseMarkFinishedIndexes utility functions that were used to extract sub-goal information from AI responses
  • Simplified XML response parsing: Removed parsing of <update-plan-content> and <mark-sub-goal-done> tags from AI responses in parseXMLPlanningResponse
  • Removed sub-goal tracking: Eliminated all sub-goal management logic from the plan() function, including:
    • conversationHistory.setSubGoals()
    • conversationHistory.markSubGoalFinished()
    • conversationHistory.appendSubGoalLog()
    • conversationHistory.markAllSubGoalsFinished()
  • Unified logging approach: Consolidated to use only appendHistoricalLog() for all execution logs, regardless of deepThink setting
  • Simplified system prompt: Removed all sub-goal related instructions, examples, and XML tag documentation from the planning system prompt
    • Removed <update-plan-content> and <mark-sub-goal-done> tag descriptions
    • Removed multi-turn conversation example with sub-goal tracking
    • Simplified step descriptions and numbering
    • Removed memory tag documentation (was only used in deepThink mode)
  • Updated function signatures: Changed includeSubGoals parameter to deepThink in systemPromptToTaskPlanning for clarity
  • Removed related tests: Deleted all test cases for sub-goal parsing and sub-goal related prompt generation

Implementation Details

The deepThink option is now passed through but no longer affects the planning behavior - it's kept for backward compatibility but doesn't change the system prompt or response parsing. The planning system now operates in a single mode that uses historical execution logs for context instead of maintaining a hierarchical sub-goal structure.

https://claude.ai/code/session_016KXax4JyZu2MKkA2XjRX6t

…al logic from planning prompt

The model no longer needs to do task decomposition (sub-goals). This
removes all goal/subGoal related logic from the planning prompt and its
caller, keeping only the simpler instruction-based flow.

https://claude.ai/code/session_016KXax4JyZu2MKkA2XjRX6t
…ferences)

Keep the full thought description telling the model what to consider
(user's requirement, current state, next action) - just without the
sub-goal related parts.

https://claude.ai/code/session_016KXax4JyZu2MKkA2XjRX6t
@netlify
Copy link

netlify bot commented Feb 10, 2026

Deploy Preview for midscene failed. Why did it fail? →

Name Link
🔨 Latest commit ba02337
🔍 Latest deploy log https://app.netlify.com/projects/midscene/deploys/698ac9932ee3c90008f9d0ca

@cloudflare-workers-and-pages
Copy link

Deploying midscene with  Cloudflare Pages  Cloudflare Pages

Latest commit: d368cc4
Status: ✅  Deploy successful!
Preview URL: https://43e101e5.midscene.pages.dev
Branch Preview URL: https://claude-refactor-llm-planning.midscene.pages.dev

View logs

@yuyutaotao yuyutaotao marked this pull request as ready for review February 12, 2026 06:35
@yuyutaotao yuyutaotao marked this pull request as draft February 12, 2026 06:35
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d368cc4118

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +150 to +153
const historicalLogsText = conversationHistory.historicalLogsToText();
const historicalLogsSection = historicalLogsText
? `\n\n${historicalLogsText}`
: '';

Choose a reason for hiding this comment

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

P1 Badge Keep deepThink history from growing quadratically

This change makes deepThink sessions include historicalLogsToText() on every turn, while each turn also appends a new historical log entry; since previous user messages (which already contain the full log text) are kept in conversationHistory.snapshot(), the same log lines get repeatedly duplicated across rounds and prompt size grows roughly O(n²). In longer multi-step tasks this can push requests over model context limits or crowd out relevant screenshot/history context, whereas the prior deepThink path only carried compact sub-goal state.

Useful? React with 👍 / 👎.

@yuyutaotao yuyutaotao marked this pull request as ready for review February 14, 2026 00:04
@quanru quanru merged commit 854510b into main Feb 14, 2026
8 checks passed
@quanru quanru deleted the claude/refactor-llm-planning-FFHmp branch February 14, 2026 02:39
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