Skip to content

fix(autogen-ext): preserve canvas tools when clearing memory - #8269

Open
Sunhy (Shy7777) wants to merge 1 commit into
microsoft:mainfrom
Shy7777:fix/canvas-memory-clear-tools
Open

Sunhy (Shy7777) wants to merge 1 commit into
microsoft:mainfrom
Shy7777:fix/canvas-memory-clear-tools

Conversation

@Shy7777

Copy link
Copy Markdown

Why are these changes needed?

TextCanvasMemory.clear() replaces the canvas, leaving tools already registered with an agent attached to the old instance. They still report successful writes, but those writes never reach the memory supplied to the next model call. Clear the files and revision history in place so existing update/patch tools and shared canvas references keep working.

Related issue number

Found while testing reuse of a canvas memory after clearing it. The regression tests exercise both existing tools and shared revision history; a separate offline AssistantAgent run also reproduced the lost writes before the fix.

Checks

  • I've included any doc changes needed for https://microsoft.github.io/autogen/. The clear methods describe the preserved canvas and removed history.
  • I've added tests (if relevant) corresponding to the changes introduced in this PR.
  • I've made sure all auto checks have passed.

Validation: the two new tests fail before the fix; all 65 related canvas, memory, context, and tool tests pass afterward. Package poe format and poe lint pass, as do mypy and Pyright on the canvas module and its tests. The full extension test task needs optional Playwright dependencies absent from this environment; full-package mypy also reports errors in uninstalled optional integrations. Those broader checks are not claimed as passing.

Copilot AI lite review requested due to automatic review settings September 22, 2026 07:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

This branch has not been deployed

No deployments
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