Skip to content

Simplify llm history manager#2454

Open
ShaohongZ wants to merge 2 commits intomainfrom
simplify_llm_history_manager
Open

Simplify llm history manager#2454
ShaohongZ wants to merge 2 commits intomainfrom
simplify_llm_history_manager

Conversation

@ShaohongZ
Copy link
Copy Markdown
Contributor

Overview

Simplify the LLM history manager for conversational use cases compatible with small local models. The original verbose, sensor-oriented formatting is replaced with concise, conversation-style formatting that reduces token usage and improves response quality.

Type of change

  • Bug fix
  • [v] New feature
  • Documentation improvement
  • Bounty issue submission
  • Other:

Changes

  • Simplified ACTION_MAP: Replaced verbose preambles ("**** felt: {}", "**** said: {}", "**** performed this motion: {}") with plain "{}" format strings. Added greeting_conversation action type.
  • Conversational input format: Changed input formatting from sensor-style ("TestBot sensed the following: audio. User said hello | vision. Saw a person |") to conversational style ("User: User said hello Saw a person"). When no inputs match the current tick, uses "User: (no input)".
  • Concise action messages: Changed action messages from "Given that information, **** took these actions: **** said: Hello" to "AgentName: Hello".
  • JSON response extraction: Action values wrapped in {"response": "text"} are now unwrapped to plain text before storing in history.
  • Summary prefix: Summaries are now prefixed with [Conversation summary - do not repeat] to prevent the model from echoing conversation summaries back to users.
  • Concise summarization prompts: Replaced verbose summarization system prompt and command with shorter, conversation-focused versions tuned for small models (under 100 words, no markdown/tables).
  • Added tests: 5 new tests covering ACTION_MAP contents, simplified format, JSON extraction, agent name format, and history_length=0 behavior.

@ShaohongZ ShaohongZ requested review from a team as code owners March 9, 2026 19:26
@github-actions github-actions bot added robotics Robotics code changes python Python code tests Test files labels Mar 9, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 9, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Python code robotics Robotics code changes tests Test files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant