8000 feat(codemode): keep store values across scripts in a conversation by geminixiang · Pull Request #163 · geminixiang/mikan · GitHub
[go: up one dir, main page]

Skip to content

feat(codemode): keep store values across scripts in a conversation - #163

Merged
geminixiang merged 1 commit into
mainfrom
feat/codemode-store
Oct 9, 2026
Merged

geminixiang merged 1 commit into
mainfrom
feat/codemode-store

Conversation

@geminixiang
Copy link
Copy Markdown
Owner

Codemode store(key, value) / load(key) keep JSON values across scripts in a conversation, as in Pi.

Change

  • Values live in mikan.script-store, a pi-durable conversation document (history: "rewindable", fork: "asOf"), read with api.snapshot before a script and written with api.commit after a successful one. pi-codemode still enforces the size limits.
  • A thread started from a run forks the document as of that run, the way Pi's branch carries codemode-store entries.
  • /new (SessionStore.reset) clears it; Pi's /new starts a new session with an empty store.
  • The model-facing description says values last across calls.

Eval (.workspace/store-eval, Slack bot and runtime with the faux model)

Case main this branch
S1 next script, same run undefined v1
S2 next message undefined v1
S3 after a restart undefined v1
S4 after /new undefined undefined
S5 thread started from the storing run undefined channel
S6 value over the size limit RangeError RangeError

Verification

  • Failing test first (fails on main with undefined/undefined): values last across calls and a reopen, deletes apply, /new clears.
  • Full gate.
  • Local daemon on a test Slack workspace: a DM script stored color, and a script in the next message loaded orange.

pi-codemode reports a script's store writes and takes the current values, but persists nothing itself; Pi keeps them on the session branch. mikan dropped them after each script. They now live in a rewindable pi-durable document of the conversation: a successful script's writes are committed, a thread started from a run forks the values as of that run, and /new clears them.
@geminixiang
geminixiang merged commit b677576 into main Oct 9, 2026
3 checks passed
@geminixiang
geminixiang deleted the feat/codemode-store branch October 9, 2026 14:45
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

0