Conversation
#545) * fix(cli)!: rename mm session start --json key stale_ended → auto_ended The JSON list returned by `mm session start --json` carries UUIDs from two distinct paths: cutoff-based stale cleanup driven by `--auto-end-stale`, and the cross-agent forced-end inside `--idempotent` when the active session belongs to a different `--agent-id`. The previous key `stale_ended` only describes the first; cross-agent ends are not stale, just superseded. The DB metadata already disambiguates them via `metadata.reason` (`stale` vs `cross_agent`) — this commit aligns the JSON key with the metadata's existing `auto_ended` flag so the CLI surface and the storage record use one vocabulary. Drops the misleading "stale" word from the text-mode print line for the same reason. The shape only shipped post-v0.1.32 (PR #543, b8a5673) and never went out in a tagged release, so no released hook caller depends on the old key. Followup item 2 from RFC `memtomem-docs#24` (per-entry `reason` shape: flat vs split vs dict-enriched) stays deferred — that decision needs a distribution measurement on `sessions.metadata.reason` after a few weeks of real hook usage. The per-row `reason` is already on disk, so no telemetry plumbing is required for that future analysis. Co-Authored-By: Claude <[email protected]> * fix(cli): show stale/cross-agent breakdown in text-mode auto-end count Per PR review: ``mm session start`` text mode previously printed ``Auto-ended N session(s)`` after the rename, dropping the "stale" hint that the prior wording carried. JSON consumers don't lose anything (``sessions.metadata.reason`` carries the per-row split), but a human running the command by hand can't tell whether the auto-ends came from cutoff age or from cross-agent forced-ends. Track per-reason counters at the two append sites — both code paths already know which reason they're handling — and emit a ``(N stale, M cross-agent)`` suffix when either is non-zero. The JSON shape (flat list of UUIDs) is untouched so the existing ``test_json_output_shape`` pin still holds. New test ``test_text_mode_breakdown_by_reason`` exercises both paths firing in the same call and pins the two count fragments, since this is the only place the per-reason split is now surfaced without going through SQL. Co-Authored-By: Claude <[email protected]> --------- Co-authored-by: pandas-studio <[email protected]> Co-authored-by: Claude <[email protected]>
…+ SessionStart hook primitives + mm upgrade CLI Behavior-change release. Highlights: - **`mm upgrade` CLI** (#443) — process-aware reinstall wrapper that preserves extras and clears stale server pidlocks; addresses the v0.1.25→v0.1.26 incident where an in-memory pre-upgrade server kept running the old code next to freshly written wheels. - **Auto LLM session summary on `mem_session_end`** (RFC P1 Phase B-1) — summarizes session-time chunks through the `archive:session:<id>` chunk path when no `summary=` is supplied and an LLM provider is configured; new `session_summary` config block gates and tunes the behavior. - **`chunk_links` provenance from session summary → source chunks** (RFC P1 Phase B-2) — the auto-summary path writes `link_type="summarizes"` rows from the new archive chunk back to each source chunk it summarized, bounded by `session_summary.max_summary_links` (default 50, newest first). - **`mm session start` SessionStart hook primitives** (#541, #543, RFC `memtomem-docs#24`) — `--idempotent`, `--auto-end-stale`, `--json` so a Claude Code SessionStart hook can resume the active session instead of orphaning it on every start; plugin `hooks.json` ships the recipe matched byte-for-byte by the `TestPluginHooksDocsParity` guard. - **`mm session start --json` output key `auto_ended`** (#545) — rename from `stale_ended` so the CLI surface matches the DB metadata's existing `auto_ended` flag and the list groups both cutoff-based stale cleanup and cross-agent forced-end UUIDs; per-row distinction is on `sessions.metadata.reason`. Pre-release rename — `stale_ended` never reached PyPI. See `CHANGELOG.md [0.1.33]` for the full set including the plugin's `PostToolUse[Write]` extension/path filter and the documented gap on rapid consecutive writes. Co-authored-by: pandas-studio <[email protected]> Co-authored-by: Claude <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
v0.1.33 release bundle — behavior-change release. Branch was cut from main on 2026-04-29 ahead of PR #545, which was retargeted into this branch so the JSON-shape rename ships in v0.1.33 (avoiding a pre-released
stale_endedkey on PyPI).Bundled PRs (post-v0.1.32)
mm upgradefor kill-then-reinstall hygiene (#443) #530 —mm upgradeCLI (closes cli: addmm upgradeto stop running server before reinstall (hygiene wrapper) #443)memtomem-docs#22)mm session startSessionStart hook primitives (RFCmemtomem-docs#24Phase 1)stale_ended→auto_endedJSON key rename + text-mode breakdown polish (RFCmemtomem-docs#24Item 3)chunk_linksprovenance work (RFC P1 Phase B).Migration notes
Continues the v0.1.32 namespace / agent_id validation contract — no new BREAKING entries in v0.1.33. Two surface changes worth noting:
mm session start --jsonnow emitsauto_ended(was unreleasedstale_endedonmainpost-v0.1.32; never tagged into PyPI).PostToolUse[Write]hook now allowlists source extensions and blocklists build/cache paths; existing pasted snippets in user~/.claude/settings.jsoncontinue with the old unfiltered behavior until re-pulled.Release mechanics
releasecommit1d97dbbbumpspyproject.toml,uv.lock, and inserts the dated## [0.1.33] — 2026-04-29CHANGELOG header.feedback_prerelease_dry_run.md):test-v0.1.33a1tag →pypienv approval → fresh-isolated smoke →v0.1.33production tag.release.ymlworkflow triggers onv[0-9]*/test-v[0-9]*; OIDC trusted publisher;pypienvironment requires manual approval.Post-merge plan
git checkout main && git pullto sync the merge commit.git tag test-v0.1.33a1 <merge-sha> && git push origin test-v0.1.33a1→ approvepypienv in browser.git tag v0.1.33 <merge-sha> && git push origin v0.1.33→ approve ifpending_deploymentsnon-empty.gh release create v0.1.33 --notes-file <changelog-section>.memtomem-docs#25already merged.)🤖 Generated with Claude Code