Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude/plugins/onebrain/.claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "onebrain",
"version": "3.4.12",
"version": "3.4.13",
"description": "OneBrain — Your AI Thinking Partner",
"author": {
"name": "OneBrain Contributors"
Expand Down
2 changes: 1 addition & 1 deletion .claude/plugins/onebrain/.codex-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "onebrain",
"version": "3.4.12",
"version": "3.4.13",
"description": "OneBrain — Your AI Thinking Partner",
"namespace": "onebrain",
"skills": "./skills/",
Expand Down
3 changes: 2 additions & 1 deletion .claude/plugins/onebrain/skills/pause/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,12 @@ Where `N` = `next_nn` from Step 2 (the total snapshot count for this thread incl

## Auto-Finalize (Called by AUTO-SUMMARY and /wrapup "n" branch)

When AUTO-SUMMARY or `/wrapup` "n" branch needs to finalize an active thread before writing a daily session log, it calls into this skill's auto-finalize path. Three skip conditions — if ANY is true, skip:
When AUTO-SUMMARY or `/wrapup` "n" branch needs to finalize an active thread before writing a daily session log, it calls into this skill's auto-finalize path. "Latest pause file" throughout this section means the file with the highest `NN` for the slug, tiebreak date prefix descending (same rule as `/resume` Step 2) — never file mtime, which sync tools rewrite. Four skip conditions — if ANY is true, skip:

1. **No-activity:** Glob `[logs_folder]/checkpoint/*-{current_session_token}-checkpoint-*.md` — if empty, the session produced no work; skip.
2. **Already-captured-this-session:** Find the latest pause file of `active_slug`. If its frontmatter `session_token` equals current session token AND no checkpoint file mtime > pause file mtime, the current session's work is already captured by an earlier `/pause`; skip.
3. **No-pause-files-and-untouched:** If no pause file exists yet for `active_slug` AND the newest checkpoint mtime is older than `_active.md` mtime, the slug was set but no thread activity occurred; skip.
4. **Thread-untouched:** Skip if this session did no work on the thread after the thread's latest pause file was written (if the slug has no pause files: at any point this session). "No work on the thread" requires ALL of the following after that point: the session did not `/resume` this slug, AND none of the session's checkpoint or conversation content relates to the thread's topic. Judge from the session's checkpoint files (`[logs_folder]/checkpoint/*-{current_session_token}-checkpoint-*.md`) — they survive context compaction; never judge from the visible conversation tail alone. Typical trigger: the thread's latest snapshot carries another session's `session_token` and this session worked only on unrelated topics — auto-finalizing would append that unrelated work into the thread's snapshot series and corrupt `/resume`. A session that resumed or continued the thread and ended without an explicit `/pause` does NOT match this condition — capturing that continuation is exactly what auto-finalize exists for.

If not skipped: run Steps 2–5 above, but in Step 4 frontmatter use `trigger: auto-finalize` instead of `manual`, and in Step 3's `## Where I Stopped` prepend "Auto-finalized at session end. " to the human-readable text.

Expand Down
3 changes: 2 additions & 1 deletion .claude/plugins/onebrain/skills/startup/AUTO-SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ If conditions are met:
Glob checkpoint files (post-v2.4.0: checkpoints live in flat `[logs_folder]/checkpoint/` regardless of date): `[logs_folder]/checkpoint/YYYY-MM-DD-{session_token}-checkpoint-*.md`. Also yesterday's (handles cross-midnight sessions): compute yesterday's date (accounting for month/year rollover) and glob `[logs_folder]/checkpoint/YYYY-MM-DD_PREV-{session_token}-checkpoint-*.md`. **Read every file in the glob result** and fully incorporate all of their content into the session summary (not just as background context). Any checkpoint file that exists is unmerged by definition — there is no `merged:` filter. Every checkpoint must appear in the summary before it is deleted.
- Determine NN: count existing `[logs_folder]/session/YYYY/MM/YYYY-MM-DD-session-*.md` files for today; NN = count + 1, zero-padded to 2 digits (01, 02, …). **Verify** `YYYY-MM-DD-session-NN.md` does not already exist before writing; if it does, increment NN until a free slot is found.

- **Auto-finalize active pause thread (if any) — runs before the session log write.** Read `[logs_folder]/pause/_active.md`. If absent or empty, skip this step. If a slug is present, apply the three skip conditions from `skills/pause/SKILL.md` → Auto-Finalize section (canonical source — keep in sync):
- **Auto-finalize active pause thread (if any) — runs before the session log write.** Read `[logs_folder]/pause/_active.md`. If absent or empty, skip this step. If a slug is present, apply the four skip conditions from `skills/pause/SKILL.md` → Auto-Finalize section (canonical source — keep in sync):
- No-activity: no checkpoint file exists for current session_token → skip
- Already-captured-this-session: latest pause file's session_token == current AND no checkpoint mtime > pause file mtime → skip
- No-pause-files-and-untouched: no pause file for slug AND newest checkpoint mtime < `_active.md` mtime → skip
- Thread-untouched: this session did no work on the thread after its latest pause file was written (ALL of: no /resume of this slug after that point AND no thread-related checkpoint/conversation content after it — judge from checkpoint files, which survive compaction) → skip; a session that resumed or continued the thread does NOT match

If not skipped: invoke `/pause` auto-finalize path (Steps 2–5 of `/pause`, with `trigger: auto-finalize` in frontmatter and "Auto-finalized at session end. " prefix in `## Where I Stopped`). This preserves the active pause thread's continuity when a session ends without an explicit `/pause`. Silent — no user-visible output.
- Write to `[logs_folder]/session/YYYY/MM/YYYY-MM-DD-session-NN.md` using the Session Log Format from `references/session-formats.md`:
Expand Down
5 changes: 3 additions & 2 deletions .claude/plugins/onebrain/skills/wrapup/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,12 @@ Run this BEFORE Step 1.

Runs only when `wrapup_mode = "session"` AND `_active.md` exists.

Apply the three skip conditions from `skills/pause/SKILL.md` → Auto-Finalize section:
Apply the four skip conditions from `skills/pause/SKILL.md` → Auto-Finalize section:

1. **No-activity:** if no checkpoint file exists for current `session_token`, skip Auto-Finalize.
2. **Already-captured-this-session:** if latest pause file's frontmatter `session_token` matches current AND no checkpoint mtime > pause file mtime, skip.
3. **No-pause-files-and-untouched:** if no pause file exists for slug AND newest checkpoint mtime < `_active.md` mtime, skip.
4. **Thread-untouched:** if this session did no work on the thread after the thread's latest pause file was written (ALL of: no `/resume` of this slug after that point AND no thread-related checkpoint/conversation content after it — judge from checkpoint files, which survive compaction), skip — auto-finalizing would append unrelated work into the thread. A session that resumed or continued the thread does NOT match.

If not skipped: invoke `/pause` auto-finalize path (Steps 2–5 of `/pause`, with `trigger: auto-finalize` in frontmatter and "Auto-finalized at session end. " prefix in `## Where I Stopped`).

Expand Down Expand Up @@ -657,7 +658,7 @@ Where `{P}` is `len(pause_files)`, `{C}` is the checkpoint count from Step 1. Th
📂 Auto-finalized pause thread `{slug}` (snapshot {NN}). Thread still active — /resume to continue.
```

**If `wrapup_mode = "session"` AND Step 0b Auto-Finalize was skipped due to skip-condition (1, 2, or 3):** add a line after `💾 Session Saved`:
**If `wrapup_mode = "session"` AND Step 0b Auto-Finalize was skipped due to skip-condition (1, 2, 3, or 4):** add a line after `💾 Session Saved`:

```
📂 Pause thread `{slug}` still active ({pause_count} snapshots) — /resume to continue.
Expand Down
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
latest_version: 3.4.12
released: 2026-08-28
latest_version: 3.4.13
released: 2026-08-29
---

# Changelog
Expand All @@ -11,6 +11,11 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
> **Versioning:** Plugin version is tracked in `plugin.json`. Bump when ANY harness config changes — skills, agents, hooks, INSTRUCTIONS, Gemini settings, slash commands, etc.
> For CLI binary changes, see the [`onebrain-ai/onebrain-cli`](https://github.com/onebrain-ai/onebrain-cli/blob/main/CHANGELOG.md) repository.

## v3.4.13 — 2026-08-29 — Auto-finalize skips threads the session never touched

- `/pause` Auto-Finalize gains a fourth skip condition (Thread-untouched): when the ending session did no work on the active thread since the thread's latest snapshot — e.g. the snapshots belong to another session's token and this session worked only on unrelated topics — auto-finalize skips instead of appending that unrelated work into the thread's snapshot series (which would corrupt `/resume`). The judgment is anchored in checkpoint files so it survives context compaction, and a session that resumed or continued the thread and ended without an explicit `/pause` still auto-finalizes as before.
- The Auto-Finalize section now pins "latest pause file" to the highest-NN sort `/resume` uses (never mtime); the mirrored skip-condition lists in `/wrapup` Step 0b and AUTO-SUMMARY carry the same fourth condition, and `/wrapup`'s skipped-notice wording now covers it.

## v3.4.12 — 2026-08-28 — Codex hooks survive cache refreshes

- Codex hook manifests call the cache-independent runner in OneBrain CLI v3.4.25+, so an active task no longer retains a dead path when the plugin cache refreshes.
Expand Down
Loading