Skip to content

Persist todo changes made inside Codemode across reloads - #401

Merged
ilovepixelart merged 2 commits into
ilovepixelart:mainfrom
nikunj95:fix/pi-code-todo-pr-r16
Oct 12, 2026
Merged

ilovepixelart merged 2 commits into
ilovepixelart:mainfrom
nikunj95:fix/pi-code-todo-pr-r16

Conversation

@nikunj95

@nikunj95 nikunj95 commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Todo changes made inside Codemode were lost on reload or restart, and the next add could reuse an existing ID: replay only read direct todo tool results, and nested calls leave none in the transcript.

Each successful mutation now also saves a copied { todos, nextId } snapshot with pi.appendEntry('pi-code:todo', ...); list calls and rejected operations save nothing. Replay prefers these snapshots on the active branch and still reads direct results in sessions recorded before this change.

  • npm run check passes (Biome, strict tsc, Vitest)
  • Tests cover the change

Persist copied provider snapshots at each successful mutation so nested
tool calls survive replay. Prefer those branch-local snapshots over
legacy direct results to preserve mutation ordering during concurrent
completions, while retaining legacy-only branch compatibility.

@ilovepixelart ilovepixelart left a comment •

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Looks good. Before merge:

  1. Dropped the fix(todo): prefix from the title (CONTRIBUTING).
  2. Rewrote the body to the PR template.
  3. Added a test where an incomplete pi-code:todo entry comes before a legacy result, asserting the legacy state is restored.

@ilovepixelart

ilovepixelart commented Oct 12, 2026 •

Copy link
Copy Markdown
Owner

Thank you for the contribution, @nikunj95. The bug was real, the fix is clean, and the tests pin it well. Your note about the shellWords property also surfaced a bash-version issue in our own test suite. Much appreciated.

@ilovepixelart ilovepixelart changed the title fix(todo): persist todo snapshots so Codemode-created tasks survive reload Persist todo changes made inside Codemode across reloads Oct 12, 2026
@ilovepixelart
ilovepixelart merged commit f6a9e65 into ilovepixelart:main Oct 12, 2026
12 checks passed
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