Skip to content

Local-first 🧠 memory for Hermes Agent that lives in your Obsidian vault and remembers project context. Nightly 😴 dream passes turn repeat corrections into confirmed preferences with measurable confidence. Adapters ship for Claude Code, Codex, and OpenClaw, with an MCP server for anything else.

TypeScript

ci: parallel tests, sharded Windows and a prose-only filter, with input-handling fixes (v1.73.1) (#236)

Serg Eroshec39dd67a3c93
diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json
index ad98fce6..9c608992 100644
--- a/.claude-plugin/plugin.json
+++ b/.claude-plugin/plugin.json
@@ -1,6 +1,6 @@
{
"name": "open-second-brain",
- "version": "1.73.0",
+ "version": "1.73.1",
"description": "Plugin-first second brain package for AI agents and humans.",
"author": {
"name": "Open Second Brain contributors"
diff --git a/.codex-plugin/plugin.json b/.codex-plugin/plugin.json
index 182ddb89..d74f86cc 100644
--- a/.codex-plugin/plugin.json
+++ b/.codex-plugin/plugin.json
@@ -1,6 +1,6 @@
{
"name": "open-second-brain",
- "version": "1.73.0",
+ "version": "1.73.1",
"description": "Plugin-first second brain package for Codex, Hermes, Claude Code, OpenClaw, and other agent runtimes.",
"author": {
"name": "Open Second Brain contributors",
diff --git a/.github/scripts/ci-scope.sh b/.github/scripts/ci-scope.sh
new file mode 100755
index 00000000..545debfb
--- /dev/null
+++ b/.github/scripts/ci-scope.sh
@@ -0,0 +1,35 @@
+#!/usr/bin/env bash
+# Writes `code=true|false` to $GITHUB_OUTPUT: false only for a pull request
+# whose every changed file is prose or an image under docs/, or Markdown at
+# the repository root or under .github/. Anything else - a push, any code,
+# test, fixture, script, skill, hook, plugin, manifest or workflow change,
+# a non-prose file under docs/, or a diff that cannot be read - is true, so a
+# doubtful case runs the full gate. Only the Windows shards use it: the
+# Linux suite always runs, because some tests read docs/ and CHANGELOG.md.
+#
+# Needs a checkout of the pull_request merge commit with fetch-depth 2: its
+# first parent is the base tip, so HEAD^1..HEAD is exactly the PR's change.
+# A root README, LICENSE or SECURITY edit also changes its copy under
+# plugins/codex/, so it counts as code.
+set -euo pipefail
+
+out="${GITHUB_OUTPUT:-/dev/stdout}"
+
+if [ "${GITHUB_EVENT_NAME:-}" != "pull_request" ]; then
+ echo "code=true" >> "$out"
+ exit 0
+fi
+
+if ! changed=$(git diff --name-only HEAD^1 HEAD) || [ -z "$changed" ]; then
+ echo "code=true" >> "$out"
+ exit 0
+fi
+
+printf '%s\n' "$changed"
+
+prose='^(docs/.*\.(md|txt|png|jpe?g|gif|svg|webp)|[^/]+\.md|\.github/.*\.md)$'
+if printf '%s\n' "$changed" | grep -qvE "$prose"; then
+ echo "code=true" >> "$out"
+else
+ echo "code=false" >> "$out"
+fi
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index f10d06e1..1af2d4f1 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -17,10 +17,36 @@ concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
+# Linux jobs are pinned to Ubuntu 26.04: `ubuntu-latest` moves there between
+# 2026-10-19 and 2026-11-19, and pinning means that move happened in a pull
+# request that proved it, not on a random day in the rollout window.
+
jobs:
+ # Decides whether the Windows shards are worth their runners. Only a pull
+ # request that touches nothing but prose skips them; the Linux suite in
+ # `validate` always runs, because tests under `tests/docs/` (and the
+ # egress census) read `docs/cli-reference.md` and CHANGELOG.md.
+ changes:
+ name: changes
+ runs-on: ubuntu-26.04
+ timeout-minutes: 5
+ outputs:
+ code: ${{ steps.scope.outputs.code }}
+ steps:
+ - name: Check out repository
+ uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+ with:
+ persist-credentials: false
+ fetch-depth: 2
+
+ - name: Classify the changed paths
+ id: scope
+ run: .github/scripts/ci-scope.sh
+
validate:
name: validate
- runs-on: ubuntu-latest
+ runs-on: ubuntu-26.04
+ timeout-minutes: 20
steps:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
@@ -40,75 +66,103 @@ jobs:
- name: Install JS dependencies
run: bun install --frozen-lockfile
- - name: Verify manifest version sync
- run: bun run sync-version:check
-
- # Codex caches only `plugins/codex/` and drops symlinks, so the Codex
- # plugin carries real copies of `skills/` and `hooks/hooks.json`.
- - name: Codex plugin mirrors are in sync
- run: bun run sync-plugin-mirrors:check
-
- - name: OpenClaw bundle is in sync with sources
- shell: bash
- run: |
- set -euo pipefail
- # The release workflow has always checked this, but only on a tag -
- # so a stale `openclaw/index.js` shipped to plugin users and turned
- # the release job red two versions running before anyone looked.
- # Checking it here fails the pull request that caused it instead.
- bun build src/openclaw/index.ts \
- --outfile /tmp/openclaw-rebuild.js \
- --target=node --format=esm \
- --external openclaw/plugin-sdk/plugin-entry
- diff -q /tmp/openclaw-rebuild.js openclaw/index.js \
- || { echo "openclaw/index.js is out of date; run: bun run build:openclaw" >&2; exit 1; }
-
- - name: Broken-link ratchet
- run: bun run link-ratchet:check
-
- - name: Hardcoded path hygiene (report-only)
- run: bun run check:paths
-
- - name: Formatting check
- run: bun run fmt:check
-
- - name: Lint
- run: bun run lint
-
- - name: Typecheck
- run: bun run typecheck
-
- - name: TypeScript test suite
- run: bun test
+ # Per-file durations from the last run on main. `--parallel` starts the
+ # slowest files first with them, and the Windows shards split the suite
+ # by time instead of by file count. A miss only costs the ordering.
+ - name: Restore test timings
+ uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
+ with:
+ path: .bun-timings.json
+ key: bun-timings-${{ github.run_id }}
+ restore-keys: bun-timings-
+ enableCrossOsArchive: true
# The anti-drift test compares the vendored Hermes schemas against a
# LIVE `tools/list`, and skips itself when `o2b` is not on PATH. It has
# been skipping here since it was written - `OK (skipped=1)` - so the
# one guard against a vendored copy diverging from the server ran only
# on a developer machine that happened to have the symlink. That is how
- # two tools drifted structurally and nobody was told.
+ # two tools drifted structurally and nobody was told. Published before
+ # the background Python step below, because a PATH change made by a
+ # background step is only visible after its `wait`.
- name: Publish o2b on PATH (the anti-drift test needs the live server)
run: echo "$GITHUB_WORKSPACE/scripts" >> "$GITHUB_PATH"
+ # The static checks below read the tree and write nothing in it, so
+ # they run side by side; the group takes as long as the slowest one
+ # (typecheck) instead of their sum.
+ - parallel:
+ - name: Verify manifest version sync
+ run: bun run sync-version:check
+
+ # Codex caches only `plugins/codex/` and drops symlinks, so the Codex
+ # plugin carries real copies of `skills/` and `hooks/hooks.json`.
+ - name: Codex plugin mirrors are in sync
+ run: bun run sync-plugin-mirrors:check
+
+ - name: OpenClaw bundle is in sync with sources
+ shell: bash
+ run: |
+ set -euo pipefail
+ # The release workflow has always checked this, but only on a tag -
+ # so a stale `openclaw/index.js` shipped to plugin users and turned
+ # the release job red two versions running before anyone looked.
+ # Checking it here fails the pull request that caused it instead.
+ bun build src/openclaw/index.ts \
+ --outfile "$RUNNER_TEMP/openclaw-rebuild.js" \
+ --target=node --format=esm \
+ --external openclaw/plugin-sdk/plugin-entry
+ diff -q "$RUNNER_TEMP/openclaw-rebuild.js" openclaw/index.js \
+ || { echo "openclaw/index.js is out of date; run: bun run build:openclaw" >&2; exit 1; }
+
+ - name: Broken-link ratchet
+ run: bun run link-ratchet:check
+
+ - name: Hardcoded path hygiene (report-only)
+ run: bun run check:paths
+
+ - name: Formatting check
+ run: bun run fmt:check
+
+ - name: Lint
+ run: bun run lint
+
+ - name: Typecheck
+ run: bun run typecheck
+
+ # The Python tests take seconds and share nothing with the Bun suite,
+ # so they run in the background while it does.
- name: Python plugin tests
+ id: python-tests
+ background: true
run: python -m unittest discover -s tests/python -v
+ # One worker per core (each file in a fresh global, `--parallel`
+ # implies `--isolate`): serially the suite was five to seven minutes,
+ # the whole length of this job. The run rewrites the timings file the
+ # next runs on main and on pull requests start from.
+ - name: TypeScript test suite
+ run: bun test --parallel --timings=.bun-timings.json --update-timings
+
+ - name: Wait for the Python plugin tests
+ wait: python-tests
+
# A skip is indistinguishable from a pass in the summary line, so the
- # step above is asserted rather than trusted: if the CLI stops being
- # reachable, this fails instead of quietly going back to skipping.
+ # anti-drift test is asserted rather than trusted: if the CLI stops
+ # being reachable, this fails instead of quietly going back to skipping.
- name: The anti-drift test actually ran
run: |
set -euo pipefail
python -m unittest test_static_schemas -v 2>&1 \
- | tee /tmp/anti-drift.log
- grep -q "test_static_schemas_match_live_tools_list" /tmp/anti-drift.log
+ | tee "$RUNNER_TEMP/anti-drift.log"
+ grep -q "test_static_schemas_match_live_tools_list" "$RUNNER_TEMP/anti-drift.log"
# ANY skip of that test, not one message. It skips for two reasons -
# no CLI on PATH, and a CLI that is there but whose server does not
# come up - and matching the first message alone left the second
# reading as a pass, which is the hole this step exists to close.
if grep -qE 'test_static_schemas_match_live_tools_list.* \.\.\. skipped' \
- /tmp/anti-drift.log; then
- grep -E ' \.\.\. skipped' /tmp/anti-drift.log >&2
+ "$RUNNER_TEMP/anti-drift.log"; then
+ grep -E ' \.\.\. skipped' "$RUNNER_TEMP/anti-drift.log" >&2
echo "anti-drift skipped itself; the live server was not reachable" >&2
exit 1
fi
@@ -117,6 +171,16 @@ jobs:
- name: Python package compiles
run: python -m compileall -q plugins/hermes
+ # Only main writes the timings; a pull request reads main's copy and
+ # never replaces it with its own branch's numbers.
+ - name: Save test timings
+ if: github.event_name == 'push'
+ uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
+ with:
+ path: .bun-timings.json
+ key: bun-timings-${{ github.run_id }}
+ enableCrossOsArchive: true
+
# `hermes plugins install itechmeat/open-second-brain` runs Hermes' own
# scanner over the whole clone and refuses a "dangerous" verdict with no
# override (#188). This runs that scanner, fetched at a pinned commit and
@@ -124,7 +188,7 @@ jobs:
# is the one that fails. Actions are pinned by commit SHA.
hermes-plugin-scan:
name: hermes plugin scan
- runs-on: ubuntu-latest
+ runs-on: ubuntu-26.04
timeout-minutes: 10
steps:
- name: Check out repository
@@ -154,15 +218,42 @@ jobs:
# that must be closed before a rename, in-process gzip snapshots - on the
# platform they exist for. Checks that are platform-independent are not
# repeated here.
- windows:
- name: windows
+ #
+ # The suite is bound by the disk and Defender here, not by the CPU: run
+ # with `--parallel` on one runner it took as long as serially (21 minutes,
+ # every test about 3.5x slower). So it is split across three runners,
+ # each with its own disk, and `--shard` balances them by the timings
+ # `validate` records on main.
+ windows-tests:
+ name: windows (${{ matrix.shard }}/3)
+ needs: changes
+ # Runs unless the filter positively said "prose only": a failed or
+ # empty filter falls back to running the shards, never to skipping them.
+ if: ${{ !cancelled() && needs.changes.outputs.code != 'false' }}
runs-on: windows-latest
- # The suite takes 20 minutes on a good day and has taken over 45 on a
- # slow runner (every file about 2.5x slower, nothing hung); the bound is
- # there so a hung test cannot hold a runner for GitHub's six-hour
- # default, not to police the runner's speed.
- timeout-minutes: 75
+ # A shard takes about a third of the old 20-45 minutes. The bound is there
+ # so a hung test cannot hold a runner for GitHub's six-hour default; the
+ # watchdog below fires first and records what was still running.
+ timeout-minutes: 30
+ strategy:
+ fail-fast: false
+ matrix:
+ shard: [1, 2, 3]
steps:
+ # Real-time scanning inspects every file the fixtures write and every
+ # bun.exe the hook and CLI tests spawn. The runner is thrown away after
+ # the job, so there is nothing for it to protect. Started first and in
+ # the background so it overlaps the checkout and the tool setup; a
+ # refusal only costs speed, so it may fail without failing the job.
+ - name: Turn off Defender real-time scanning
+ id: defender
+ background: true
+ continue-on-error: true
+ shell: pwsh
+ run: |
+ Set-MpPreference -DisableRealtimeMonitoring $true
+ "real-time monitoring disabled: $((Get-MpPreference).DisableRealtimeMonitoring)"
+
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
@@ -181,6 +272,18 @@ jobs:
- name: Install JS dependencies
run: bun install --frozen-lockfile
+ - name: Restore test timings
+ uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
+ with:
+ path: .bun-timings.json
+ key: bun-timings-${{ github.run_id }}
+ restore-keys: bun-timings-
+ enableCrossOsArchive: true
+
+ - name: Publish o2b on PATH (the anti-drift test needs the live server)
+ shell: bash
+ run: echo "$GITHUB_WORKSPACE/scripts" >> "$GITHUB_PATH"
+
# The one validate-job check repeated here, because it is about the
# checkout: the mirrors must come out of a Windows clone as the same
# bytes (LF, per .gitattributes) and as real files, not as symlinks
@@ -188,27 +291,98 @@ jobs:
- name: Codex plugin mirrors are in sync
run: bun run sync-plugin-mirrors:check
- - name: Typecheck
- run: bun run typecheck
+ # Steps that need to run once, not once per shard, run on shard 1. The
+ # check sits in the script rather than in `if:`, so the `wait` below
+ # always has a step to join.
+ - name: Typecheck (shard 1)
+ id: typecheck
+ background: true
+ shell: bash
+ env:
+ SHARD: ${{ matrix.shard }}
+ run: |
+ [ "$SHARD" = "1" ] || { echo "runs on shard 1"; exit 0; }
+ bun run typecheck
- # GitHub's Windows runners take about twice as long as Linux over the
- # same suite (NTFS and Defender on every file the fixtures touch), so
- # Bun's 5 s default - which also bounds beforeEach/afterEach hooks -
+ - name: Python plugin tests (shard 1)
+ id: python-tests
+ background: true
+ shell: bash
+ env:
+ SHARD: ${{ matrix.shard }}
+ run: |
+ [ "$SHARD" = "1" ] || { echo "runs on shard 1"; exit 0; }
+ python -m unittest discover -s tests/python -v
+
+ # Samples CPU, disk queue, free memory and the bun.exe count every 10 s
+ # while the suite runs, so a slow day on a slow runner shows up as data
+ # in the job's artifact instead of a guess.
+ - name: Record runner load
+ id: telemetry
+ background: true
+ # `cancel` may end it with exit code 1; a diagnostic must never fail the job.
+ continue-on-error: true
+ shell: pwsh
+ run: |
+ $out = Join-Path $env:RUNNER_TEMP 'telemetry\runner-load.csv'
+ New-Item -ItemType Directory -Force (Split-Path $out) | Out-Null
+ 'time,cpu_pct,disk_queue,free_mb,bun_procs' | Set-Content $out
+ $counters = '\Processor(_Total)\% Processor Time',
+ '\PhysicalDisk(_Total)\Current Disk Queue Length',
+ '\Memory\Available MBytes'
+ while ($true) {
+ $v = (Get-Counter $counters -ErrorAction SilentlyContinue).CounterSamples.CookedValue
+ $n = @(Get-Process bun -ErrorAction SilentlyContinue).Count
+ '{0:HH:mm:ss},{1:N0},{2:N1},{3:N0},{4}' -f (Get-Date), $v[0], $v[1], $v[2], $n |
+ Add-Content $out
+ Start-Sleep -Seconds 10
+ }
+
+ # Fires at 20 minutes, well past a healthy shard and before the job's
+ # timeout, and writes down every bun, node and python process with its
+ # command line and age: a hang leaves the name of what was stuck.
+ - name: Hang watchdog
+ id: watchdog
+ background: true
+ # `cancel` may end it with exit code 1; a diagnostic must never fail the job.
+ continue-on-error: true
+ shell: pwsh
+ run: |
+ Start-Sleep -Seconds 1200
+ $out = Join-Path $env:RUNNER_TEMP 'telemetry\hang-dump.txt'
+ New-Item -ItemType Directory -Force (Split-Path $out) | Out-Null
+ Get-CimInstance Win32_Process |
+ Where-Object { $_.Name -match '^(bun|node|python)' } |
+ Select-Object ProcessId, ParentProcessId,
+ @{ n = 'Minutes'; e = { [int]((Get-Date) - $_.CreationDate).TotalMinutes } },
+ CommandLine |
+ Format-Table -AutoSize -Wrap | Out-String -Width 400 |
+ Tee-Object -FilePath $out
+ "::warning::shard still running after 20 minutes; process dump in the windows-telemetry artifact"
+
+ - name: Wait for Defender to be off
+ wait: defender
+
+ # GitHub's Windows runners are slower than Linux over the same suite,
+ # so Bun's 5 s default - which also bounds beforeEach/afterEach hooks -
# times out tests that pass locally. Tests with their own timeout keep it.
- - name: TypeScript test suite
- run: bun test --timeout 30000
+ - name: TypeScript test suite (shard ${{ matrix.shard }}/3)
+ run: bun test --shard=${{ matrix.shard }}/3 --timings=.bun-timings.json --timeout 30000
- - name: Publish o2b on PATH (the anti-drift test needs the live server)
- shell: bash
- run: echo "$GITHUB_WORKSPACE/scripts" >> "$GITHUB_PATH"
+ - name: Wait for the typecheck and the Python plugin tests
+ wait: [typecheck, python-tests]
- - name: Python plugin tests
- run: python -m unittest discover -s tests/python -v
+ - name: Stop the load recorder
+ cancel: telemetry
+
+ - name: Stop the hang watchdog
+ cancel: watchdog
# Same assertion as in the validate job: on Windows the anti-drift test
# reaches the server through `o2b.cmd`, a path of its own, and a skip
# would read as a pass here just as it did there.
- name: The anti-drift test actually ran
+ if: matrix.shard == 1
shell: bash
run: |
set -euo pipefail
@@ -224,5 +398,32 @@ jobs:
working-directory: tests/python
- name: The .cmd launcher runs the CLI
+ if: matrix.shard == 1
shell: cmd
run: scripts\o2b.cmd --version
+
+ - name: Upload runner telemetry
+ if: always()
+ uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
+ with:
+ name: windows-telemetry-${{ matrix.shard }}
+ path: ${{ runner.temp }}/telemetry/
+ retention-days: 7
+ if-no-files-found: ignore
+
+ # One stable check name over the three shards, so a ruleset can require
+ # `windows` without listing shard names. Shards skipped for a prose-only
+ # pull request count as passed.
+ windows:
+ name: windows
+ needs: windows-tests
+ if: ${{ !cancelled() }}
+ runs-on: ubuntu-26.04
+ timeout-minutes: 2
+ steps:
+ - name: Every Windows shard passed or was skipped
+ env:
+ RESULT: ${{ needs.windows-tests.result }}
+ run: |
+ echo "windows shards: $RESULT"
+ [ "$RESULT" = "success" ] || [ "$RESULT" = "skipped" ]
diff --git a/.github/workflows/plugin-scanner.yml b/.github/workflows/plugin-scanner.yml
index f09bf0e0..c72ea19a 100644
--- a/.github/workflows/plugin-scanner.yml
+++ b/.github/workflows/plugin-scanner.yml
@@ -22,7 +22,7 @@ concurrency:
jobs:
scan:
name: plugin-scanner
- runs-on: ubuntu-latest
+ runs-on: ubuntu-26.04
steps:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index a9ba126c..008e36e6 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -16,8 +16,10 @@ on:
default: false
type: boolean
+# Read-only by default: the verify job runs the tree's own code and never
+# needs to write. Only the job that publishes the release gets write access.
permissions:
- contents: write
+ contents: read
concurrency:
group: release-${{ github.ref_name }}-${{ github.event.inputs.version || '' }}
@@ -26,10 +28,37 @@ concurrency:
jobs:
verify:
name: Verify
- runs-on: ubuntu-latest
+ runs-on: ubuntu-26.04
+ permissions:
+ contents: read
+ checks: read
steps:
- name: Check out repository
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
+ with:
+ persist-credentials: false
+
+ # A release tags a commit that already went through CI on main. When
+ # `validate` and `windows` both passed on this exact commit, running
+ # the same suites again proves nothing new; the cheap packaging checks
+ # below still run either way. No green CI on the commit (a tag pushed
+ # early, a manual dispatch elsewhere) means the suites run here.
+ - name: CI already passed on this commit?
+ id: ci
+ env:
+ GH_TOKEN: ${{ github.token }}
+ shell: bash
+ run: |
+ set -euo pipefail
+ passed=true
+ for check in validate windows; do
+ conclusion=$(gh api "repos/$GITHUB_REPOSITORY/commits/$GITHUB_SHA/check-runs?check_name=$check" \
+ -q '[.check_runs[] | select(.app.slug == "github-actions")] | sort_by(.completed_at) | last | .conclusion // ""' \
+ || true)
+ echo "$check on $GITHUB_SHA: ${conclusion:-none}"
+ [ "$conclusion" = "success" ] || passed=false
+ done
+ echo "passed=$passed" >> "$GITHUB_OUTPUT"
- name: Set up Bun
uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
@@ -54,9 +83,11 @@ jobs:
run: bun run typecheck
- name: Run TypeScript test suite (bun:test)
- run: bun test
+ if: steps.ci.outputs.passed != 'true'
+ run: bun test --parallel
- name: Run Python plugin tests
+ if: steps.ci.outputs.passed != 'true'
run: python -m unittest discover -s tests/python -v
- name: Validate manifests and CLI scripts
@@ -98,7 +129,9 @@ jobs:
release:
name: Build and publish GitHub release
needs: verify
- runs-on: ubuntu-latest
+ runs-on: ubuntu-26.04
+ permissions:
+ contents: write
# Only fire on actual release events — every push triggers `verify`,
# but only tag pushes / workflow_dispatch should publish.
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a38082fc..b1eb6392 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
+## [1.73.1] - 2026-10-07
+
+Sturdier input handling in three places, and a faster CI.
+
+### Fixed
+
+- **The HTTP transport parses the `Authorization` header in linear time.** The bearer pattern no longer lets two groups claim the same run of whitespace, so a long run of spaces cannot make the parse backtrack. Any whitespace before the key is still accepted, and a header with nothing after `Bearer` is still refused.
+- **Shell completions escape backslashes.** The fish, elvish and nushell scripts from `o2b completions` escape a backslash before quoting a word, so a word that ends in one can no longer swallow its closing quote.
+- **The brain explorer escapes every field it renders.** The node status and confidence in the details panel go through the same HTML escaping as every other field, and that escaping now covers quotes, since the status also lands in an attribute. Both values are already limited to known words by the parser, so this changes nothing a vault can produce today.
+
+### Changed
+
+- **CI:** the Linux suite runs in parallel workers, and the Windows suite in three shards on separate runners balanced by recorded timings (about 11 minutes instead of 25). Windows is skipped only for pull requests that change nothing but prose, and the release workflow reuses a green CI result on the tagged commit instead of running the suites again. The Linux jobs run on Ubuntu 26.04.
+
## [1.73.0] - 2026-10-06
Open Second Brain now makes every query embed honest and every upgrade safe: one query-embed gateway applies the caller's reach and the embedding price gate before any provider is called, for the search lane behind six MCP tools and two hooks and for the `brain_context_pack` semantic belief order, and fits the query, instruction prefix included, to the model's input window, disclosing a refusal or a cut by trail code; an operator can declare the input window of an uncurated model and send extra request fields to an OpenAI-compatible endpoint; recall feedback, benchmark, eval and tune reports name the degradations their searches met; and `o2b brain upgrade` and the automatic upgrade worker apply exactly the plan they computed, refusing a managed file edited in between instead of overwriting it.
@@ -8232,6 +8246,7 @@ plugin config (vault field)`, and exits with a clear
- Sandbox vault and plugin manifest fixtures for tests.
- GitHub release workflow for tag-based and manually dispatched releases.
+[1.73.1]: https://github.com/itechmeat/open-second-brain/compare/v1.73.0...v1.73.1
[1.73.0]: https://github.com/itechmeat/open-second-brain/compare/v1.72.0...v1.73.0
[1.72.0]: https://github.com/itechmeat/open-second-brain/compare/v1.71.0...v1.72.0
[1.71.0]: https://github.com/itechmeat/open-second-brain/compare/v1.70.0...v1.71.0
diff --git a/openclaw.plugin.json b/openclaw.plugin.json
index a51a36f0..2e66af47 100644
--- a/openclaw.plugin.json
+++ b/openclaw.plugin.json
@@ -2,7 +2,7 @@
"id": "open-second-brain",
"name": "Open Second Brain",
"description": "Second brain for AI agents using Obsidian-compatible Markdown vaults.",
- "version": "1.73.0",
+ "version": "1.73.1",
"activation": { "onStartup": true },
"skills": ["./skills"],
"contracts": {
diff --git a/package.json b/package.json
index b85e9272..319e22c0 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "open-second-brain",
- "version": "1.73.0",
+ "version": "1.73.1",
"private": false,
"description": "Second brain for AI agents using Obsidian-compatible Markdown vaults. Works with Hermes, Claude Code, Codex, and OpenClaw.",
"keywords": [
diff --git a/plugin.yaml b/plugin.yaml
index 4b67b90c..6a5ced56 100644
--- a/plugin.yaml
+++ b/plugin.yaml
@@ -1,5 +1,5 @@
name: open-second-brain
-version: "1.73.0"
+version: "1.73.1"
description: "Open Second Brain - native Hermes memory provider backed by an Obsidian-compatible Markdown vault."
author: "Open Second Brain contributors"
memory_provider: true
diff --git a/plugins/codex/.codex-plugin/plugin.json b/plugins/codex/.codex-plugin/plugin.json
index fdafe5d7..0d63043d 100644
--- a/plugins/codex/.codex-plugin/plugin.json
+++ b/plugins/codex/.codex-plugin/plugin.json
@@ -1,6 +1,6 @@
{
"name": "open-second-brain",
- "version": "1.73.0",
+ "version": "1.73.1",
"description": "Plugin-first second brain package for Codex, Hermes, Claude Code, OpenClaw, and other agent runtimes.",
"author": {
"name": "Open Second Brain contributors",
diff --git a/plugins/hermes/plugin.yaml b/plugins/hermes/plugin.yaml
index 4b67b90c..6a5ced56 100644
--- a/plugins/hermes/plugin.yaml
+++ b/plugins/hermes/plugin.yaml
@@ -1,5 +1,5 @@
name: open-second-brain
-version: "1.73.0"
+version: "1.73.1"
description: "Open Second Brain - native Hermes memory provider backed by an Obsidian-compatible Markdown vault."
author: "Open Second Brain contributors"
memory_provider: true
diff --git a/pyproject.toml b/pyproject.toml
index ea593372..1c52a63e 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -10,7 +10,7 @@ build-backend = "setuptools.build_meta"
# CLI entry points (those moved to `package.json` `bin`).
[project]
name = "open-second-brain"
-version = "1.73.0"
+version = "1.73.1"
description = "Hermes Python shim for Open Second Brain. Most of the project (CLI, MCP server, OpenClaw plugin) is TypeScript on Bun; see package.json."
readme = "README.md"
requires-python = ">=3.11"
diff --git a/src/cli/completions.ts b/src/cli/completions.ts
index d8644382..18da7c61 100644
--- a/src/cli/completions.ts
+++ b/src/cli/completions.ts
@@ -91,13 +91,13 @@ Register-ArgumentCompleter -Native -CommandName o2b -ScriptBlock {
}
function quoteFish(value: string): string {
- return `'${value.replace(/'/g, "\\'")}'`;
+ return `'${value.replace(/\\/g, "\\\\").replace(/'/g, "\\'")}'`;
}
function quoteElvish(value: string): string {
- return `"${value.replace(/"/g, '\\"')}"`;
+ return `"${value.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`;
}
function quoteNu(value: string): string {
- return `"${value.replace(/"/g, '\\"')}"`;
+ return `"${value.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`;
}
diff --git a/src/mcp/http.ts b/src/mcp/http.ts
index 815c5890..b35ecb7c 100644
--- a/src/mcp/http.ts
+++ b/src/mcp/http.ts
@@ -454,8 +454,12 @@ function originAllowed(req: IncomingMessage, boundHost: string): boolean {
function bearerToken(value: string | undefined): string | undefined {
if (value === undefined) return undefined;
- const m = /^Bearer\s+(.+)$/i.exec(value.trim());
- return m?.[1];
+ // One whitespace and then the rest, trimmed after the match: the old
+ // `\s+(.+)` let both groups claim the same spaces, which backtracks
+ // polynomially on a long run of them.
+ const m = /^Bearer\s([\s\S]*)$/i.exec(value.trim());
+ const token = m?.[1]?.trimStart();
+ return token ? token : undefined;
}
function firstHeader(value: string | string[] | undefined): string | undefined {
diff --git a/templates/brain-explorer.html b/templates/brain-explorer.html
index 92ccb8c0..aad9ef56 100644
--- a/templates/brain-explorer.html
+++ b/templates/brain-explorer.html
@@ -691,10 +691,18 @@
}
const inbound = edges.filter((e) => e.target === n.id);
const outbound = edges.filter((e) => e.source === n.id);
+ // Quotes too: the status lands inside a class attribute.
const esc = (s) =>
String(s).replace(
- /[&<>]/g,
- (c) => ({ "&": "&amp;", "<": "&lt;", ">": "&gt;" })[c],
+ /[&<>"']/g,
+ (c) =>
+ ({
+ "&": "&amp;",
+ "<": "&lt;",
+ ">": "&gt;",
+ '"': "&quot;",
+ "'": "&#39;",
+ })[c],
);
const edgeLabel = (e) => e.relation || e.kind;
const html = [
@@ -721,13 +729,13 @@
"</span></div>"
: "",
'<div class="field"><span class="k">status</span><span class="v"><span class="pill ' +
- n.status +
+ esc(n.status) +
'">' +
- n.status +
+ esc(n.status) +
"</span>" +
(n.confidence
? ' <span class="pill">' +
- n.confidence +
+ esc(n.confidence) +
(n.confidence_value !== null
? " (" + n.confidence_value.toFixed(2) + ")"
: "") +
diff --git a/tests/cli/completions.test.ts b/tests/cli/completions.test.ts
index 5e53ccae..b01a3a5f 100644
--- a/tests/cli/completions.test.ts
+++ b/tests/cli/completions.test.ts
@@ -1,6 +1,7 @@
import { describe, expect, test } from "bun:test";
import { nestedCommandGroups } from "../../src/cli/command-manifest.ts";
+import { renderCompletions } from "../../src/cli/completions.ts";
import { runCli } from "../helpers/run-cli.ts";
describe("CLI command manifest", () => {
@@ -96,3 +97,30 @@ describe("nested subcommand coverage", () => {
}
});
});
+
+describe("quoted completion words", () => {
+ // A trailing backslash used to escape the closing quote, so the word ran
+ // on into the rest of the script.
+ const manifest = {
+ command: "o2b" as const,
+ flags: [],
+ commands: [
+ { name: "a\\", summary: "" },
+ { name: "b'c\"d", summary: "" },
+ ],
+ };
+
+ test("fish escapes the backslash before the quote", () => {
+ const out = renderCompletions("fish", manifest);
+ expect(out).toContain(String.raw`-a 'a\\'`);
+ expect(out).toContain(String.raw`-a 'b\'c"d'`);
+ });
+
+ test("elvish and nushell escape the backslash before the quote", () => {
+ for (const shell of ["elvish", "nushell"] as const) {
+ const out = renderCompletions(shell, manifest);
+ expect(out).toContain(String.raw`"a\\"`);
+ expect(out).toContain(String.raw`"b'c\"d"`);
+ }
+ });
+});
diff --git a/tests/mcp/http-transport.test.ts b/tests/mcp/http-transport.test.ts
index e7df41e0..7a0ce4eb 100644
--- a/tests/mcp/http-transport.test.ts
+++ b/tests/mcp/http-transport.test.ts
@@ -214,6 +214,26 @@ describe("Streamable HTTP MCP transport", () => {
}
});
+ test("the bearer accepts any run of whitespace before the key and nothing after it", async () => {
+ const handle = await startHttp({ vault }, { apiKey: "secret", host: "127.0.0.1", port: 0 });
+ try {
+ const send = (authorization: string) =>
+ fetch(handle.url, {
+ method: "POST",
+ headers: {
+ "content-type": "application/json",
+ accept: "application/json",
+ authorization,
+ },
+ body: JSON.stringify(rpc("ping", 1)),
+ });
+ expect((await send("Bearer \t secret")).status).toBe(200);
+ expect((await send(`Bearer ${" ".repeat(64)}`)).status).toBe(401);
+ } finally {
+ await handle.close();
+ }
+ });
+
test("authenticated initialize and tools/list round-trip through JSON responses", async () => {
const handle = await startHttp({ vault }, { apiKey: "secret", host: "127.0.0.1", port: 0 });
try {
diff --git a/uv.lock b/uv.lock
index d60cc9c4..9409c171 100644
--- a/uv.lock
+++ b/uv.lock
@@ -4,5 +4,5 @@ requires-python = ">=3.11"
[[package]]
name = "open-second-brain"
-version = "1.73.0"
+version = "1.73.1"
source = { editable = "." }