Skip to content

Migrate legacy notebooks in shared readers - #56

Draft
PiotrCzapla wants to merge 2 commits into
mainfrom
pc/notebook-migrations
Draft

Migrate legacy notebooks in shared readers#56
PiotrCzapla wants to merge 2 commits into
mainfrom
pc/notebook-migrations

Conversation

@PiotrCzapla

@PiotrCzapla PiotrCzapla commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Old CRAFT notebooks could supply an AI reply containing a tool call as ordinary text. The model could copy that example instead of calling a tool.

Notebook readers now normalize text to strings before applying migrations from v1 through v3. The migrations convert old metadata, markdown prompts, and tool calls stored in <details> blocks. Writers use nb2str to restore lists of lines on disk.

Reading preserves the source file and attachments. The migrated_ attribute records whether the dialog needs saving. A successful save clears it. Writers always use v3 and no longer accept a version argument.

Validation: all aidialog notebooks pass. The examples check tool calls, attachments, unchanged CRAFT files, repeated saves, and rejection of unsupported versions.

Companion: Solveit #1942.

@jph00

jph00 commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

This is way too heavyweight for a one-time change. Perhaps a little standalone script is better for those that need it?

@jph00

jph00 commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Remember the fundamental principle: all code is tech debt. So it must earn its place! :)

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