chore(core): Add comprehensive tests for historical logs in ConversationHistory#1957
Open
yuyutaotao wants to merge 9 commits intomainfrom
Open
chore(core): Add comprehensive tests for historical logs in ConversationHistory#1957yuyutaotao wants to merge 9 commits intomainfrom
yuyutaotao wants to merge 9 commits intomainfrom
Conversation
Add a logs field to SubGoal that accumulates the Planning log entries while a sub-goal is running. Logs are cleared whenever the sub-goal's status or description changes. The subGoalsToText() output now includes "Actions performed for current sub-goal" so the AI has context on what has already been done for the active sub-goal. https://claude.ai/code/session_01QiNtUTmr6VYZGRxnd5QyST
…l logs Update the multi-turn conversation example to show the new "Actions performed for current sub-goal" section in user messages. Also fix the example to consistently show all 3 sub-goals from Turn 2 onwards. https://claude.ai/code/session_01QiNtUTmr6VYZGRxnd5QyST
* fix(core): set default imagesIncludeCount to 1 for non-deepThink mode Previously both deepThink and non-deepThink modes defaulted to 2 images in snapshot. Now non-deepThink defaults to 1, deepThink defaults to 2, and explicit values are respected. https://claude.ai/code/session_01K75mH3NGX6zxN5oH4A3G2a * fix(core): set imagesIncludeCount explicitly at call site, remove fallback Set deepThink ? 2 : 1 in agent.ts so the default is clear at the source. Remove ?? 2 fallback in llm-planning.ts to avoid hidden defaults. https://claude.ai/code/session_01K75mH3NGX6zxN5oH4A3G2a * fix(core): remove unnecessary undefined from imagesIncludeCount type The value is always a number now (deepThink ? 2 : 1), so the union type with undefined is no longer needed. https://claude.ai/code/session_01K75mH3NGX6zxN5oH4A3G2a --------- Co-authored-by: Claude <noreply@anthropic.com>
…#1953) reset() only cleared messages but left memories and subGoals intact, causing state to leak between separate .aiAct() calls on the same agent. https://claude.ai/code/session_01LfiNcU6BXtsmRKJUGx54yj Co-authored-by: Claude <noreply@anthropic.com>
In non-deepThink mode, accumulate planning logs across rounds and present them to the model as "Here are the steps that have been executed" so it has context about previously performed actions. https://claude.ai/code/session_01JzXg46QwwCSq16L8DKR2nQ Co-authored-by: Claude <noreply@anthropic.com>
…calLogs Cover edge cases: seed() clearing logs, compressHistory preserving logs, clearMemories not affecting logs, logs persisting through sub-goal lifecycle, and single-entry formatting. https://claude.ai/code/session_01MP3Z6qMfZC2Ry6PssDDBzo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds comprehensive unit tests for the historical logs functionality in the
ConversationHistoryclass, ensuring that historical logs are properly managed across various operations and lifecycle events.Key Changes
seed()clears historical logs while resetting conversation statesetSubGoals(),markSubGoalFinished(), andmarkAllSubGoalsFinished()operationsNotable Details
toMatchInlineSnapshot()to validate the exact formatting of historical logs outputhttps://claude.ai/code/session_01MP3Z6qMfZC2Ry6PssDDBzo