Skip to content

fix(session): reconcile models after branch navigation - #27

Merged
boadij merged 1 commit into
mainfrom
fix/branch-model-reconciliation
Jul 20, 2026
Merged

fix(session): reconcile models after branch navigation#27
boadij merged 1 commit into
mainfrom
fix/branch-model-reconciliation

Conversation

@boadij

@boadij boadij commented Jul 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • restore Downshift premium/economy phase from the active session-tree branch
  • reconcile model and thinking level after tree navigation and existing-session restoration
  • preserve session-wide enablement, premium capture, and safety pause state
  • fix stale persisted session IDs after fork or clone

Implementation

  • add pure branch-phase restoration
  • add position-only target reconciliation
  • handle session_tree
  • reconcile restored state during session_start
  • avoid threshold evaluation and handoff generation during navigation
  • keep switch causes separate from desired targets by routing all automated changes through switchToTarget()

Non-goals

  • changing the model used for Pi branch-summary generation
  • adding branch-aware configuration
  • changing the persisted-state schema
  • upgrading Pi dependencies

Testing

  • npm ci
  • npm run check
  • npm run release:dry
  • pi -e . startup/load smoke test: passed, with the local extension registered successfully
  • automated coverage includes session_tree, reload/resume/fork/clone restoration, fresh startup, disabled/off/paused behavior, handoff suppression, internal model-change protection, threshold downshift, compaction upshift, and matching-target no-op behavior

The full interactive /tree, reload, resume, fork, clone, and model-transition matrix was not completed in this terminal session because it requires an interactive Pi session and configured provider credentials/model operations.

Notes

Pi generates optional branch summaries before session_tree, using the source branch's active model. This PR intentionally reconciles only after successful navigation so model-change and Downshift state entries are written to the destination branch.

@boadij
boadij force-pushed the fix/branch-model-reconciliation branch from 4050aac to 989daab Compare July 20, 2026 08:12
@boadij
boadij merged commit 6cceea7 into main Jul 20, 2026
1 check 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.

1 participant