Skip to content

fix(console): force render Collapse panels to prevent memory config loss#5144

Merged
lalaliat merged 3 commits into
agentscope-ai:mainfrom
zhaozhuang521:fix/collapse-forcerender-memory-config-loss
Jun 12, 2026
Merged

fix(console): force render Collapse panels to prevent memory config loss#5144
lalaliat merged 3 commits into
agentscope-ai:mainfrom
zhaozhuang521:fix/collapse-forcerender-memory-config-loss

Conversation

@zhaozhuang521

@zhaozhuang521 zhaozhuang521 commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

##Solution

ReMeLightMemoryCard.tsx: Adds forceRender: true to the two Collapse panel items to ensure that Form.Item is rendered even when not expanded, allowing validateFields() to retrieve the complete form values.

useAgentConfig.tsx: Replaces the shallow expand merge in handleSave with a recursive deep merge (deepMergeConfig), merging nested configuration objects such as reme_light_memory_config, light_context_config, adbpg_memory_config, and auto_title_config layer by layer as a fallback to prevent nested fields from being overwritten by shallow copies in any situation.

Fixes #5137

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Refactoring

Component(s) Affected

  • Core / Backend (app, agents, config, providers, utils, local_models)
  • Console (frontend web UI)
  • Channels (DingTalk, Feishu, QQ, Discord, iMessage, etc.)
  • Skills
  • CLI
  • Documentation (website)
  • Tests
  • CI/CD
  • Scripts / Deploy

Checklist

  • I ran pre-commit run --all-files locally and it passes
  • If pre-commit auto-fixed files, I committed those changes and reran checks
  • I ran tests locally (pytest or as relevant) and they pass
  • Documentation updated (if needed)
  • Ready for review

For Channel Changes (DingTalk, Feishu, QQ, Console, etc.)

  • I ran ./scripts/check-channels.sh (or ./scripts/check-channels.sh --changed) and it passes
  • Contract test exists in tests/contract/channels/test_<channel>_contract.py (REQUIRED)
  • Contract test implements create_instance() with proper channel initialization
  • All 19 contract verification points pass (see tests/contract/channels/__init__.py)
  • Optional: Unit tests in tests/unit/channels/test_<channel>.py for complex internal logic

Testing

[How to test these changes]

Local Verification Evidence

pre-commit run --all-files
# paste summary result

pytest
# paste summary result

Additional Notes

[Optional: any other context]

zhaozhuang added 3 commits June 12, 2026 09:59
- Fix ShellCard missing isStreaming prop pass-through to ToolCardShell,
  causing no spinner when tool has no output yet
- Refactor v1Adapter status logic: only consult message-level status
  when resultItem (content[1]) exists; force 'calling' otherwise
- Extract deriveToolStatus helper with ERROR_STATUSES constant
- Add GenericToolCard as fallback for unregistered tool names
- Add withGenericFallback Proxy wrapper for customToolRenderConfig
- Fix SetTimezoneCard inlineResult showing raw MCP JSON instead of
  extracted text, use stringifyResult for proper parsing
- Fix ToolCardShell inlineResult missing title attr for hover tooltip
- Add CSS ellipsis truncation for inlineResult, flex-adaptive width
- Add tool.execute / tool.executeDefault i18n keys
When saving long-term memory settings without expanding the 'Auto Memory
Search' and 'Embedding Model Config' collapse panels, their nested config
values were lost. This happened because Ant Design's Collapse does not
render collapsed children by default, so Form.validateFields() could not
collect their values. The shallow spread in handleSave then overwrote the
complete original config with an incomplete form object.

Fix:
1. Add forceRender:true to both Collapse panel items so Form.Item
   components render even when collapsed.
2. Replace shallow spread with recursive deep-merge in handleSave as a
   safety net for all nested config sections.

Closes agentscope-ai#5137
@github-actions

Copy link
Copy Markdown

Welcome to QwenPaw! 🐾

Hi @zhaozhuang521, this is your 148th Pull Request.

📋 About PR Template

To help maintainers review your PR faster, please make sure to include:

  • Description - What this PR does and why
  • Type of Change - Bug fix / Feature / Breaking change / Documentation / Refactoring
  • Component(s) Affected - Core / Console / Channels / Skills / CLI / Documentation / Tests / CI/CD / Scripts
  • Checklist:
    • Run and pass pre-commit run --all-files
    • Run and pass relevant tests (pytest or as applicable)
    • Update documentation if needed
  • Testing - How to test these changes
  • Local Verification Evidence:
    pre-commit run --all-files
    # paste summary result
    
    pytest
    # paste summary result

Complete PR information helps speed up the review process. You can edit the PR description to add these details.

🙌 Join Developer Community

Thanks so much for your contribution! We'd love to invite you to join the official QwenPaw developer group! You can find the Discord and DingTalk group links under the "Developer Community" section on our docs page:
https://qwenpaw.agentscope.io/docs/community

We truly appreciate your enthusiasm—and look forward to your future contributions! 😊

We'll review your PR soon.

@lalaliat lalaliat left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@lalaliat lalaliat changed the title Fix/collapse forcerender memory config loss fix(console): force render Collapse panels to prevent memory config loss Jun 12, 2026
@lalaliat lalaliat merged commit 7f57212 into agentscope-ai:main Jun 12, 2026
10 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in QwenPaw Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Bug]: 向量模型自动记忆搜索配置丢失

2 participants