Skip to content

feat: add iFlytek Spark OpenAI-compatible preset - #4379

Merged
thedotmack merged 3 commits into
thedotmack:mainfrom
FenjuFu:feat/iflytek-preset
Oct 5, 2026
Merged

thedotmack merged 3 commits into
thedotmack:mainfrom
FenjuFu:feat/iflytek-preset

Conversation

@FenjuFu

@FenjuFu FenjuFu commented Oct 4, 2026

Copy link
Copy Markdown
Contributor

Adds an iflytek preset to the openai-compatible provider, in the same shape as the Opper and API Route presets: the worker preset, the viewer's copy of it, a row and a section in the provider docs, and a preset test.

The preset targets iFlytek's Astron MaaS platform. Its base URL is the pay-as-you-go endpoint, https://maas-api.cn-huabei-1.xf-yun.com/v2, and the default model is spark-x2.5. MaaS also sells a Token Plan, whose keys are only accepted on https://maas-token-api.cn-huabei-1.xf-yun.com/v2 (the other endpoint answers 403 with code 11200), so the docs show that case as a CLAUDE_MEM_OPENAI_COMPAT_BASE_URL override rather than adding a second preset.

spark-x2.5 is a reasoning model that returns its reasoning in a separate reasoning_content field. The provider already reads only content, so nothing else needed to change; the test pins that.

Verification:

  • bun test on the 14 test files that touch the presets or the openai-compatible provider: 151 pass, including the new preset test and the shared/viewer preset sync check.
  • tsc --noEmit for the root and viewer projects.
  • Live run through resolveOpenAICompatConfig and OpenAICompatProvider.query with a Token Plan key and the base URL override: a streamed request returned a complete observation block in about 27 seconds. I did not have a pay-as-you-go key with an active order, so the default base URL was only checked to return the documented 403 for a Token Plan key.

Disclosure: I am a member of the iFlytek Astron open source community.

Add an iflytek preset for iFlytek's Astron MaaS platform, defaulting to
the pay-as-you-go endpoint and spark-x2.5. Token Plan keys only work on
the Token Plan endpoint, which the docs show as a base URL override.

Signed-off-by: FenjuFu <[email protected]>
@greptile-apps

greptile-apps Bot commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Adds iFlytek Spark as an OpenAI-compatible provider preset.

No outstanding findings block merging.

Summary

Adds an iFlytek Spark preset to worker and viewer settings, explains the Token Plan Base URL override, and tests response handling. Both earlier findings are fixed; no outstanding issues were identified.

Reviews (3) · Last reviewed commit: "Merge origin/main into feat/iflytek-pres..."

@thedotmack
thedotmack merged commit 7406c7f into thedotmack:main Oct 5, 2026
8 checks passed
@thedotmack

Copy link
Copy Markdown
Owner

Merged, thank you @FenjuFu! The OpenAI-compatible provider now has an iflytek preset: choose "iFlytek Spark (Astron MaaS)" and it points at the pay-as-you-go MaaS endpoint with spark-x2.5. The viewer shows the Token Plan base URL right under the preset, so Token Plan keys don't run into the 403. Thanks for live-testing it and for following up on both review notes so quickly; the streamed reasoning_content test is a nice touch. I merged main before landing it.

thedotmack added a commit that referenced this pull request Oct 12, 2026
* fix(installer): select installed agents before offering Claude Code

Preselect detected agents and ask to install Claude Code only if the user selects it. Keep Claude Code as the fallback when no supported agent is detected.

* fix(integrations): close DSH dependency graph and preserve profile cleanup

Bundle the pinned pure SDK helpers with provenance and retained licenses so Bun installs do not resolve unpublished host peer packages. Keep DSH profile ownership recoverable and uninstall the native plugin before removing its package files.

Validate the standalone host contract, successful profile add/remove, failure rollback, and configured watch preservation.

* test(integrations): isolate DSH CLI fixtures from release builds

Run profile commands in a fresh process with a temporary data directory and package fixture. This makes the add/remove and rollback tests independent of generated release output and module-level path caches.

* perf(observer): send session_id and trace on OpenRouter requests (#4418)

Observer requests that reach OpenRouter (openrouter.ai, or the cmem.ai
gateway, which spreads the client body into its upstream request) now carry:

- session_id: a one-way SHA-256 of the observed session's id, stable for the
  whole Claude Code session. OpenRouter uses it as the sticky-routing key, so
  a session stays on the provider that holds its prompt cache. Broadcast maps
  it to PostHog's $ai_session_id.
- trace.trace_id: a random UUID per observer generation, minted in
  openObserverGeneration, so it changes whenever the conversation is
  recycled or restarted ($ai_trace_id).
- trace.trace_name 'claude-mem observer', trace.generation_name the request
  kind (init, observation, summary, field_compression, telegram_wrapup;
  $ai_span_name) and trace.claude_mem_version, the build-stamped plugin
  version (metadata_claude_mem_version).

The session id is derived, not stored, because the ActiveSession object
does not live as long as the session: an idle generator drops it after three
minutes and the next tool call builds a new one. No user field is sent; the
gateway sets it server-side. Custom base URLs behind the OpenRouter provider
and the openai-compatible presets get neither field.


Claude-Session: https://claude.ai/code/session_011rgzkjwPRzo2YH57oEFpaP

Co-authored-by: Claude Opus 5.5 <[email protected]>

* perf(observer): open init and continuation prompts with the same fixed instructions (#4415)

* perf(observer): open init and continuation prompts with the same fixed instructions

A provider prompt cache (OpenRouter, the cmem.ai gateway) hits only on a
byte-identical prefix. The init prompt put the per-generation
session-start context, whose first line is "# [project] recent context,
<date time>", right after system_identity and ahead of ~6.9k chars
(~1.7k tokens) of fixed instructions. The continuation prompt opened
with its greeting and that same context. No two sessions shared more
than system_identity, and an init and a continuation shared nothing.

Both prompts now open with one block that depends on the mode alone:
system_identity, observer_role, spatial_awareness, recording_focus,
skip_guidance and the observation schema. The prior context, the
user's request, the continuation greeting and continuation_instruction
follow it, and the MEMORY PROCESSING header stays last. Every piece of
text is unchanged; only its position moved. For the code mode the
shared start of two sessions' system messages grows from 422 chars
(init vs init) and 0 (init vs continuation) to ~7.26k chars.

The Claude SDK and Codex paths use the same builders, so their first
user message opens with the same block. Nothing reads the prompt's
order: the request block is found by regex and history pruning keys on
<user_request>.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011rgzkjwPRzo2YH57oEFpaP

* fix(modes): point continuation_instruction at the schema above it

The previous commit moved the observation schema into the fixed block
that now opens every continuation prompt, so continuation_instruction
follows the schema instead of preceding it. Its "using the XML
structure below" now reads "above" in all 33 modes that carry it:
code, law-study, email-investigation, meme-tokens and the 29 code
language variants, which reuse the English sentence and append a
LANGUAGE REQUIREMENTS line. Nothing else in those files changes.

The other position words in the mode prompts and in src/sdk/prompts.ts
still point the right way and stay as they are: the footer's "XML
structure above" and output_format_header's "this XML structure" sit
inside the schema next to the XML they name; "The context above" in
the prior-context wrapper refers to the block directly above it; the
observation prompt's "block above" and the summary prompt's "XML
structure above" belong to prompts this change does not reorder; and
"earlier in this session", "prior messages in this conversation" and
"previous reply" refer to time, not position.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011rgzkjwPRzo2YH57oEFpaP

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>

* chore: bump version to 13.30.0

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011rgzkjwPRzo2YH57oEFpaP

* docs: update CHANGELOG.md for v13.30.0

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011rgzkjwPRzo2YH57oEFpaP

* docs(version-bump): the agent publishes to npm with the monthly token (#4371)

The "human handoff" npm step was obsolete. Agents publish with a 30-day
granular token in the maintainer's ~/.npmrc. When it expires, open the npm
new-token page and ~/.npmrc for the maintainer instead of hunting backups or
waiting on the npm-publish workflow, whose NPM_TOKEN secret has failed every
tag since v13.26.1.


Claude-Session: https://claude.ai/code/session_013fww8bJwhSZFgYhfXs6GZm

Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(hooks): skip timeline injection on Claude Code resume (#4423)

* chore: bump version to 13.30.1

* docs: update CHANGELOG.md for v13.30.1

* perf(session-start): newest-N per project key, local-first context (#4427)

SessionStart read every observation and summary of the project family
(~21.7k rows / 63 MB on a 1.2 GB db) and sorted them to keep 50, because
`project IN (...) OR merged_into_project IN (...)` cannot stop early. Cold
pages made that 0.8-1.7 s per session start.

- v63: (key COLLATE NOCASE, created_at_epoch DESC) indexes on observations
  and session_summaries for project and merged_into_project.
- queryObservationsNewest / querySummariesMulti take the newest N per
  (column, key) and keep the newest N of the union. Same rows, same order
  (verified on a real 1.2 GB db); 3.8 ms instead of 0.05-1.7 s.
- The worker no longer waits on a sync pull before rendering SessionStart
  context; it only nudges one in the background.
- Precomputed SessionStart context is servable with cloud sync on. The local
  db is the source of truth and every op sync applies invalidates the files,
  so the files no longer wait on a Realtime channel the hub may not offer.
- cowork hook: no cmem.ai context read (SessionStart or agent prompts) on a
  machine with a local claude-mem install.


Claude-Session: https://claude.ai/code/session_011rgzkjwPRzo2YH57oEFpaP

Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(sync): preserve Retry-After minimum after jitter (#4383)

* fix(sync): preserve hub retry minimum after jitter

Signed-off-by: Rudy Celekli <[email protected]>

* Rebuild shipped source maps with checkout-local dependencies

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(logs): stop tail reads at the existing byte limit (#4393)

* fix(logs): stop tail reads at the existing byte limit

Signed-off-by: Rudy Celekli <[email protected]>

* build: regenerate portable worker source maps

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(sse): remove clients when Bun closes their socket (#4394)

* fix(sse): remove clients when Bun closes their socket

Signed-off-by: Rudy Celekli <[email protected]>

* build: regenerate portable worker source maps

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(viewer): release loading after a failed pagination request (#4387)

* fix(viewer): release pagination loading after a failed page

Signed-off-by: Rudy Celekli <[email protected]>

* fix(viewer): retain successful pages and expose manual recovery

Signed-off-by: Rudy Celekli <[email protected]>

* build(viewer): ship pagination recovery with current dependencies

Signed-off-by: Rudy Celekli <[email protected]>

* fix(viewer): scope pagination failures to the active feed

Signed-off-by: Rudy Celekli <[email protected]>

* build: refresh viewer bundle for scoped failure handling

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(worker): preserve observation context during field compression (#4403)

* fix(worker): freeze observation context before field compression

Signed-off-by: Rudy Celekli <[email protected]>

* build: ship observation compression context correction

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(smart-read): include generator functions in native outlines (#4419)

* fix(parser): retain JavaScript and TypeScript generator declarations

Signed-off-by: Rudy Celekli <[email protected]>

* build: refresh generator-aware smart outline MCP artifact

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(smart-read): preserve lexical ownership of outline symbols (#4406)

* fix(smart-read): assign symbols to their nearest lexical container

Signed-off-by: Rudy Celekli <[email protected]>

* build: ship corrected smart-outline symbol ownership

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(smart-read): retain complete multiline imports in outlines (#4409)

* fix(smart-read): preserve complete import capture ranges

Signed-off-by: Rudy Celekli <[email protected]>

* build: regenerate smart-read import capture bundle

Signed-off-by: Rudy Celekli <[email protected]>

* fix(smart-read): keep each outline import to one bounded line

A multiline import capture now prints as one line: the captured lines are
trimmed and joined with spaces, then capped at 200 characters (the
signature budget), keeping the first 140 and the last 55 so the module
source survives. Go `import ( … )` groups, Ruby calls with `do … end`
blocks and SCSS `@include { … }` are single captures that can span a whole
file; joined with newlines they broke the outline layout and could print a
spec file in full as its first "import". CRLF carriage returns are trimmed
too.

Tests cover the joined multiline import, CRLF, the 200-char cap, Go,
Ruby (`do … end` and a file-wide RSpec block) and SCSS; all seven fail
on the previous head and pass now.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(installer): report host download failures and recover selection

* feat: add iFlytek Spark OpenAI-compatible preset (#4379)

* feat: add iFlytek Spark OpenAI-compatible preset

Add an iflytek preset for iFlytek's Astron MaaS platform, defaulting to
the pay-as-you-go endpoint and spark-x2.5. Token Plan keys only work on
the Token Plan endpoint, which the docs show as a base URL override.

Signed-off-by: FenjuFu <[email protected]>

* feat(viewer): show the Token Plan base URL hint for the iFlytek preset

Signed-off-by: FenjuFu <[email protected]>

---------

Signed-off-by: FenjuFu <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(parser): omit array entries that decode to whitespace (#4397)

* fix(parser): omit decoded empty array entries

Signed-off-by: Rudy Celekli <[email protected]>

* build: ship decoded empty array fix

Signed-off-by: Rudy Celekli <[email protected]>

* build: keep bundled source maps portable

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(stream): release SSE reader when cancellation rejects (#4382)

* fix(stream): release SSE reader lock when cancellation fails

Signed-off-by: Rudy Celekli <[email protected]>

* Rebuild shipped source maps with checkout-local dependencies

Signed-off-by: Rudy Celekli <[email protected]>

* fix(stream): read non-streamed provider bodies with the shared byte-stream reader

responseChunks in streamed-chat-completion.ts was a copy of sse-reader's
iterateByteStream loop with the same bug: when reader.cancel() rejects, which
it always does on an errored body, releaseLock() was skipped. Every send with
liveness null (the cmem gateway, endpoints that refused streaming) reads its
body through responseChunks, so that path kept the bug the reader fix closed.

Export the fixed iterateByteStream and delegate to it, so there is one
implementation. The new test sends a non-streamed request whose JSON body
breaks off mid-read and fails before this change (the body stays locked).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(search): keep FTS capability probes connection-local (#4385)

* fix(search): keep FTS capability probes connection-local

Signed-off-by: Rudy Celekli <[email protected]>

* Rebuild shipped source maps with checkout-local dependencies

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(integrations): verify current DSH profiles and transcript format

* perf(sqlite): covering indexes for projectReadKeys merged-into lookups (#4429)

projectReadKeys runs on every SessionStart render (context cache). Its
`SELECT project ... WHERE merged_into_project COLLATE NOCASE IN (...)`
lookups used the single-column v55 index and then loaded every merged row
from the table to read `project`: 7,499 pages for 31 keys on a 1.2 GB db,
seen in worker stack samples as ~0.9 s on the main thread when cold.

v64 adds (merged_into_project COLLATE NOCASE, project) on observations and
session_summaries. Same keys, 355 pages, 9 ms.


Claude-Session: https://claude.ai/code/session_011rgzkjwPRzo2YH57oEFpaP

Co-authored-by: Claude Opus 5.5 <[email protected]>

* chore: bump version to 13.31.0

* docs: update CHANGELOG.md for v13.31.0

* fix(hooks): skip the pid-file probe once /api/health answered (#4249) (#4426)

An unparseable worker.pid made a healthy worker read as down and got the file deleted.

Co-authored-by: Cassian433 <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(search): finish partial FTS index initialization (#4381)

* fix(search): recover incomplete FTS index setup atomically

Signed-off-by: Rudy Celekli <[email protected]>

* Rebuild shipped source maps with checkout-local dependencies

Signed-off-by: Rudy Celekli <[email protected]>

* fix(fts): reserve writer and recheck missing-index ownership

Signed-off-by: Rudy Celekli <[email protected]>

* Rebuild shipped worker and SQLite artifacts for owned FTS initialization

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(viewer): filter multiline logs with their record (#4417)

* fix(viewer): keep multiline logs with their filtered record

Signed-off-by: Rudy Celekli <[email protected]>

* fix(viewer): hide unknown log-tail fragments under narrower filters

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(pi): accept duplicate anchors and recover after private turns

* fix(search): honor ascending file-summary pagination order (#4386)

* fix(search): honor ascending file-summary pagination order

Signed-off-by: Rudy Celekli <[email protected]>

* Rebuild shipped source maps with checkout-local dependencies

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(parser): retain notes-only summaries and show notes in the viewer (#4388)

* fix(parser): retain summaries containing only notes

Signed-off-by: Rudy Celekli <[email protected]>

* build: ship notes-only summary parser fix

Signed-off-by: Rudy Celekli <[email protected]>

* build: keep bundled source maps portable

Signed-off-by: Rudy Celekli <[email protected]>

* fix(context): preserve summary notes through next-session rendering

Signed-off-by: Rudy Celekli <[email protected]>

* build: include summary notes in delivered context bundles

Signed-off-by: Rudy Celekli <[email protected]>

* fix(viewer): include existing notes in paginated and live summary cards

Signed-off-by: Rudy Celekli <[email protected]>

* build: include summary notes in viewer and worker artifacts

Signed-off-by: Rudy Celekli <[email protected]>

* build(viewer): preserve deployed dependency versions in notes rendering

Signed-off-by: Rudy Celekli <[email protected]>

* revert(context): keep summary notes out of session-start context for now

This reverts commit e40beb620 ("fix(context): preserve summary notes
through next-session rendering").

Rendering Notes in the last-summary block adds tokens to every session's
startup context by default: CLAUDE_MEM_CONTEXT_SHOW_LAST_SUMMARY defaults
to true, and most stored summaries carry notes. Whether that's worth the
tokens is the owner's call, so it stays open as a follow-up decision
(for example, render notes only for notes-only summaries, or behind an
opt-in setting).

The prompt-builder line goes back to asking for one of the five rendered
fields, so the server model isn't steered toward notes-only output that
never reaches session context.

Kept from this PR: notes-only summaries are valid and stored (parser),
and the viewer shows Notes on summary cards.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(smart-search): retain file and directory matches without symbol hits (#4414)

* fix(smart-search): retain matching file paths in results

Signed-off-by: Rudy Celekli <[email protected]>

* build: refresh smart search MCP artifact

Signed-off-by: Rudy Celekli <[email protected]>

* fix(smart-search): reserve symbol file views before path-only results

Signed-off-by: Rudy Celekli <[email protected]>

* fix(smart-search): list path-only matches on one line instead of folding them

Files whose path matches the query but none of whose symbols are shown now
come back in their own `matchingFiles` list, one line each with language,
line count and folded-token estimate, rendered under "Matching Files" after
the folded views. `foldedFiles` and `tokenEstimate` are computed exactly as
before (symbol files only), so a symbol search's folded output is unchanged.

- Only literal substrings qualify: every query part must appear in the
  path. The fuzzy subsequence fallback stays for symbol names; on paths it
  matched most of a large repo for words like "store" or "cli".
- Hits are ranked by matchScore on the file name before capping at
  max_results (every literal hit scores the same on its full path): an
  exact name, then a name containing the query, then a directory hit.
- A query with no searchable parts (" / ") lists nothing instead of every
  file.
- The early return now fires only when both lists are empty, with "No
  matching symbols or files found.".

Measured on src/services/worker (79 files), the previous head grew symbol
searches by up to ~5,200 tokens ("session": 8,278 -> 13,450); this adds
10-266 tokens ("session": 8,544 with 10 listed paths).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* feat(quota): make the quota guard thresholds configurable per window (#4396)

* feat(quota): make the quota guard thresholds configurable per window (#4230)

The utilization thresholds that pause a subscription observer were constants.
They now come from five settings, one per window, whose defaults equal the old
constants, so nothing changes unless a user sets them. A missing or
unparseable value falls back to the default. A provider-side rejection still
stops the observer whatever the threshold, and seven_day_overage_included
keeps having no threshold.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(quota): parse quota thresholds strictly as fractions from 0 to 1

`parseFloat(x) || default` turned '0' into the default and accepted any
number, so '93' (meant as 93%) or '1.5' silently switched a window's
guard off, and a negative value paused the observer at once. Now a blank
value gives the default, a value in [0, 1] is used as-is (0 and 1
included), and anything else gives the default with one CONFIG warning
per key per process.

Tests cover both bounds, the out-of-range, malformed and blank
fallbacks, the warn-once, and thresholds read from settings.json with no
env override. The docs say thresholds are fractions, what an
out-of-range value does, and that the five-hour window still stops at
85% or more within 15 minutes of its reset.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Alex Newman <[email protected]>

* fix(search): honor requested date order in hybrid file results (#4408)

* fix(search): honor explicit date order in hybrid file results

Signed-off-by: Rudy Celekli <[email protected]>

* build(search): ship hybrid file ordering correction

Signed-off-by: Rudy Celekli <[email protected]>

* fix(search): keep tied file-search timestamps in stable ID order

Signed-off-by: Rudy Celekli <[email protected]>

* build: refresh stable file search ordering artifacts

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(report): inherit reviewer in generated review templates (#4392)

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(timeline): select ID-anchor neighbors by capture chronology (#4390)

* fix(timeline): select ID anchor neighbors by capture chronology

Signed-off-by: Rudy Celekli <[email protected]>

* Rebuild shipped source maps with checkout-local dependencies

Signed-off-by: Rudy Celekli <[email protected]>

* Preserve timeline chronology without unnecessary boundary sorts

Signed-off-by: Rudy Celekli <[email protected]>

* Rebuild timeline boundary queries in shipped artifacts

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(cli): skip Qwen sends that omit submitted_prompt entirely (#4215) (#4380)

* fix(cli): skip Qwen sends that omit submitted_prompt entirely (#4215)

#4224 taught session-init to read Qwen's `submitted_prompt` and to skip a
send when the host sends that field empty. One case is left: Qwen's docs
say continuation and ToolResult sends leave `submitted_prompt` out
entirely, so the field arrives absent (`undefined`), the handler falls back
to `prompt`, and an empty `prompt` is stored as `[media prompt]` -- a fake
prompt row once per tool round of an agent loop.

The absence cannot be read as "not a user turn" on every host: Qwen runs the
same `hook claude-code session-init` command as Claude Code, where an empty
prompt is a real image-only submission (#928). So the skip is scoped to
Qwen, recognised from `transcript_path` under `~/.qwen/`, and requires both
an absent field and an empty prompt.

- `isQwenTranscriptPath` matches `.qwen` as a whole path segment, so a
  `~/.qwen-notes/` project directory is not mistaken for the host, and it
  normalises Windows separators.
- Tests cover the Qwen skip, a whitespace-only prompt, a real Qwen text
  submission, the Claude Code #928 image-only turn, and an unidentifiable
  host. The three non-Qwen cases are what fail if the skip is not
  host-scoped.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Signed-off-by: Aniruddha Adak <[email protected]>

* fix(cli): recognise Qwen hooks by QWEN_PROJECT_DIR when transcripts move (#4215)

Qwen keeps transcripts under QWEN_RUNTIME_DIR, advanced.runtimeOutputDir or
QWEN_HOME when one is set, so a `/.qwen/` path check missed users who moved
them and their ToolResult sends kept storing `[media prompt]` rows. Qwen sets
QWEN_PROJECT_DIR for every command hook, so the guard now reads it too.

The check only applies when the event carries a transcript path. The
transcript watcher records prompts without one, from a worker that may have
inherited QWEN_PROJECT_DIR from the Qwen hook that spawned it.

Adds an end-to-end test through the real adapter, session routes and SQLite
(adapted from the reproduction in #4402): a session whose first send has no
submitted_prompt is still created with its prompt, and only the empty
ToolResult send after it is skipped.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Aniruddha Adak <[email protected]>
Co-authored-by: Aniruddha Adak <[email protected]>
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Co-authored-by: Alex Newman <[email protected]>

* fix(viewer): keep context previews scoped to the current selection (#4398)

* fix(viewer): keep context previews scoped to the current selection

Signed-off-by: Rudy Celekli <[email protected]>

* build(viewer): include scoped context preview responses and native browser regression

Signed-off-by: Rudy Celekli <[email protected]>

* build(viewer): retain deployed React and DOMPurify versions

Signed-off-by: Rudy Celekli <[email protected]>

* test(viewer): wait for context preview browser readiness

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(worker): retain the originating prompt on queued summaries (#4407)

* fix(worker): retain the originating prompt on queued summaries

Signed-off-by: Rudy Celekli <[email protected]>

* build(worker): ship queued summary prompt attribution

Signed-off-by: Rudy Celekli <[email protected]>

* fix(worker): preserve active prompt context for older summaries

Signed-off-by: Rudy Celekli <[email protected]>

* build(worker): ship summary response context isolation

Signed-off-by: Rudy Celekli <[email protected]>

* fix(worker): isolate queued observation prompt attribution

Signed-off-by: Rudy Celekli <[email protected]>

* build(worker): ship queued observation context isolation

Signed-off-by: Rudy Celekli <[email protected]>

* fix(cursor): advance an existing observer on accepted prompts

Signed-off-by: Rudy Celekli <[email protected]>

* build(worker): ship Cursor active prompt advancement

Signed-off-by: Rudy Celekli <[email protected]>

* test(worker): tolerate fixed observer instruction prefixes

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(opencode): retain built-in tool file evidence (#4421)

* fix(opencode): retain built-in tool file evidence

Signed-off-by: Rudy Celekli <[email protected]>

* fix(worker): match CLAUDE_MEM_SKIP_TOOLS case-insensitively; send apply_patch as patch

OpenCode's read/write/edit now arrive as Read/Write/Edit, so a user who
listed `read` in CLAUDE_MEM_SKIP_TOOLS would have had those tools captured
again. The skip check now lowercases both the entries and the tool name. The
exact `Skill` telemetry branch is unchanged.

apply_patch's `patchText` is renamed to the `patch` the worker reads instead
of being copied next to it, so the observer is not sent the whole patch twice.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(gemini): attribute observations to the served model (#4391)

* fix(gemini): attribute observations to the served model

Signed-off-by: Rudy Celekli <[email protected]>

* build: ship Gemini served-model attribution

Signed-off-by: Rudy Celekli <[email protected]>

* build: keep bundled source maps portable

Signed-off-by: Rudy Celekli <[email protected]>

* test: restore Gemini fixture state after setup failure

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(worker): persist the model reported by Claude assistant messages (#4405)

* fix(worker): persist the model reported by Claude assistant messages

Signed-off-by: Rudy Celekli <[email protected]>

* fix(worker): keep the requested model when a Claude frame omits it

The assistant frame's model is read off the CLI's stdout at runtime, so a
gateway or proxy behind ANTHROPIC_BASE_URL can leave it out. Passing it
through unguarded stored NULL in observations.generated_by_model and sent
'unknown' as the telemetry model, a regression from main's configured
value. Fall back to the requested model when the frame's model is missing
or empty, the same guard the Gemini, OpenRouter and OpenAI-compatible
providers use for their served model.

The new `absent` fixture kind drops `message.model` from the fake CLI's
assistant frame and expects the requested `haiku`; it fails without the
fallback (generated_by_model was null).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(worker): preserve captured file path whitespace (#4389)

* fix(worker): preserve captured file path whitespace

Signed-off-by: Rudy Celekli <[email protected]>

* build: ship exact captured file paths

Signed-off-by: Rudy Celekli <[email protected]>

* build: keep bundled source maps portable

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(search): preserve commas in explicit file paths (#4395)

* fix(search): preserve commas in explicit file paths

Signed-off-by: Rudy Celekli <[email protected]>

* build: regenerate portable worker source maps

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(worker): retain file evidence from Codex hook patches (#4411)

* fix(worker): retain file evidence from Codex hook patches

Signed-off-by: Rudy Celekli <[email protected]>

* build(worker): ship Codex hook patch file evidence

Signed-off-by: Rudy Celekli <[email protected]>

* test(worker): exercise the verbatim Codex hook fixture

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(viewer): activate the focused session control with Enter and Space (#4413)

* fix(viewer): keep session keyboard actions on their focused control

Signed-off-by: Rudy Celekli <[email protected]>

* test(viewer): give browser startup and rendering separate bounded waits

Signed-off-by: Rudy Celekli <[email protected]>

* test(viewer): wait for a complete browser debugging port

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(observer): preserve outage evidence after an empty store (#4384)

* fix(observer): report store success only after writing memory

Signed-off-by: Rudy Celekli <[email protected]>

* Rebuild shipped source maps with checkout-local dependencies

Signed-off-by: Rudy Celekli <[email protected]>

* test(observer): isolate and remove each response health ledger

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(viewer): protect settings edits while Save is pending (#4420)

* fix(viewer): prevent settings edits from being discarded during save

Signed-off-by: Rudy Celekli <[email protected]>

* test(viewer): require a browser for settings regressions in CI

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(report): export portable dates and UTF-8 HTML on Windows (#4400)

* fix(cost-report): render portable dates and UTF-8 HTML on Windows

Signed-off-by: Rudy Celekli <[email protected]>

* Continuously exercise report rendering on native Windows

Signed-off-by: Rudy Celekli <[email protected]>

* Include adjacent report formatter controls in native Windows gate

Signed-off-by: Rudy Celekli <[email protected]>

* Run native report regressions in every shipped skill distribution

Signed-off-by: Rudy Celekli <[email protected]>

* fix(report): format the measured bucket date without %-d

measure.py labelled the OpenRouter bucket with strftime('%a %-d %b').
%-d is a glibc/BSD extension, and Windows strftime rejects it with
"ValueError: Invalid format string". rollup reaches this through
measure.apply whenever measured.json has status ok, so a Windows rollup
with an OpenRouter key exited before writing any output. Compose the day
the way render.py now does, and pin both labels (week and month, with an
unpadded single-digit day) in test_measure.py.

Also write measured.json with an explicit UTF-8 encoding instead of the
locale codec.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

* fix(report): keep the last report.html when a render fails

render_file opened report.html for writing, which truncates it, before
page() built the HTML. Any failure while building or encoding the page
left a 0-byte report and wiped the last good one: #4250's
UnicodeEncodeError under cp936, or a KeyError from a malformed
report.json (which acr.py catches and turns into an error exit). Build
and encode first, then write the bytes. Binary mode also gives the same
LF output on every OS.

The new test renders a fixture, then renders a copy without line_items
into the same directory; it fails on main, where report.html is left
empty.

The date and encoding hunks in render.py come from the patch @meng823222
posted in #4250.

Co-authored-by: meng823222 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

* test(report): guard %-d on every OS; run the encoding test on Python 3.9

- The Windows child script asserted locale.getencoding(), which exists
  only on Python 3.11+, while SKILL.md supports Python 3.9+. On Windows
  Python 3.9 and 3.10 the test errored instead of testing. Use
  locale.getpreferredencoding(False), as #4401 does.
- The DateFormatting tests only fail on Windows. Add a guard that runs
  everywhere: no strftime flag of the form %-X in scripts/acr.py or
  scripts/acr/*.py. On main it lists measure.py:61,69 and
  render.py:40,47,48,49.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

* ci(report): prove the date and encoding fixes on Windows Python 3.9 and 3.13

A one-off native run for this PR's new commits: the strftime and
locale-API regressions cannot fail on macOS or Linux. Adds a Python
3.9/3.13 matrix and test_measure.py (which needs the tzdata step). The
workflow itself is removed again before merge.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

* ci(report): leave the agent-cost-report Windows workflow out of this fix

The workflow did its job on this branch: a native windows-2022 run on
Python 3.9 and 3.13 passed the date, encoding and failed-render tests
in all five copies (run 37266351986). It does not ship with the fix:

- It is one workflow per bug. #4404 adds a second one for the PDF
  lookup, and #4401's Windows tests would need a third.
- It re-runs a slice of the skill's tests (test_render*.py) over five
  byte-identical copies. Mirror drift is what `acr.py sync-check`
  catches, and no workflow runs that.
- It installs tzdata from PyPI for tests that do not need it.

Whether the Python skill gets CI at all, and in what shape, is a
follow-up decision for the owner.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

* style(report): restore test_measure comment alignment

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: meng823222 <[email protected]>

* test(viewer): wait for recovery DOM commits in headless CI

* fix(openclaw): capture actual completed tool input and output (#4422)

* fix(openclaw): capture completed tool parameters and results

Signed-off-by: Rudy Celekli <[email protected]>

* fix(openclaw): align completion verification and request deadline

Signed-off-by: Rudy Celekli <[email protected]>

* fix(openclaw): keep failed tools' error text and tolerate a missing params

after_tool_call reports a failed call in `error`, which the handler ignored,
so failed tools lost the error text main's persisted tool-result message
carried. It now leads the response, ahead of any partial result, before the
1000-character cap. A host build that omits `params` no longer throws at
`event.params.path`.

The completion fixture now waits for the worker to finish ingesting the
fire-and-forget POST instead of polling for its arrival. The architecture
diagrams line up again, and the docs mention the error text.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(kimi): preserve Read file paths across hooks (#4416)

* fix(kimi): normalize Read paths for file memory

Signed-off-by: Rudy Celekli <[email protected]>

* build(worker): ship Kimi Read path normalization

Signed-off-by: Rudy Celekli <[email protected]>

* fix(kimi): preserve canonical Read paths

Signed-off-by: Rudy Celekli <[email protected]>

* build(worker): ship Kimi canonical path preservation

Signed-off-by: Rudy Celekli <[email protected]>

* fix(kimi): keep kimi-file:// attachment references out of file reads

Kimi's Read accepts a kimi-file:// session attachment reference as `path`,
not only a file. Aliasing it to `file_path` recorded attachment ids as
files_read entries in the file index. Such a reference is now left as is.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(viewer): show producer logs when all components are selected (#4410)

* fix(viewer): include producer logs when all components are selected

Signed-off-by: Rudy Celekli <[email protected]>

* fix(viewer): filter logger components without a chip under an Other chip

The console's component filter knows 9 chips, but the logger writes 45
components. The all-selected special case only showed the other 36 while
every chip was on: deselecting any one chip (say, noisy HTTP) hid SEARCH,
QUEUE, INGEST, CLOUD_SYNC and the rest again.

Map every component without a chip of its own to a new Other chip, and
build the initial and Select-all sets from LOG_COMPONENTS so Other is on by
default and #4417's headerless-line rule (all chips on) still holds. The
browser test now checks that SEARCH, QUEUE and INGEST stay visible with
only Hook off and that Other alone shows exactly those; both fail on the
previous head. Its timeouts now match #4417's (a cold CI Chrome launch
has taken over 10 s).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

* test(viewer): give the log filter browser test a 25 s browser budget

A cold Chrome start plus the viewer bundle can take more than 9 s on Linux
CI; #4387's pagination test, with the same 9 s race, times out there. Raise
the browser race to 25 s and the test timeout to 40 s. The in-page wait for
the logs stays at the original 6 s: it starts once the page is running, so
the cold start doesn't count against it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(worker): use registered memory identity in response metadata (#4399)

* fix(worker): retain registered identity in response metadata

Signed-off-by: Rudy Celekli <[email protected]>

* build: ship registered response identity fix

Signed-off-by: Rudy Celekli <[email protected]>

* test: scope response fixture cleanup around setup

Signed-off-by: Rudy Celekli <[email protected]>

* test: await response iterator cleanup

Signed-off-by: Rudy Celekli <[email protected]>

* test: verify stored summary identity in response metadata

Signed-off-by: Rudy Celekli <[email protected]>

* fix(sqlite): carry deliberate session rekeys into tool receipts

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* test(viewer): give the pagination browser tests time for a cold Chrome start (#4451)

The first case in pagination-recovery.browser.test.ts bundles the viewer
and launches headless Chrome inside a 9 s window (12 s test timeout). On a
busy CI runner that takes about 8.4-9.8 s, so the test fails on most Linux
runs since #4387 landed, on main and on unrelated PRs alike. Locally it
passes in 3-5 s.

Raise the browser window to 25 s and the test timeout to 40 s in both
pagination browser tests, in line with the other viewer browser tests
(20-45 s). The in-page settle deadlines are unchanged, so a real
regression still fails fast inside the page.


Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(viewer): load older rows after the selected category empties (#4412)

* fix(viewer): keep pagination reachable after filtered rows disappear

Signed-off-by: Rudy Celekli <[email protected]>

* fix(viewer): ignore late load-more notifications from a removed sentinel

The empty feed now renders its pagination sentinel on mount, so the
mount observer can deliver its first notification after the initial
page started loading and failed, but before React's effect cleanup
disconnects it. Its closure still says hasMore && !isLoading &&
!loadError, so it cleared the error and fetched again: the feed retried
a failed page on its own and never showed Retry. #4387's
pagination-recovery browser cases failed in 4 of 5 runs on this branch.

Only act on a notification whose sentinel is still connected. React
renders the sentinel only while loading is allowed, so a connected
sentinel means the closure's state is current. Adds a browser case that
delivers the mount observer's notification inside the commit that
removed the sentinel, before the cleanup.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

* test(viewer): give Chrome startup its own budget in the empty-filter test

empty-filter-pagination runs before the pagination browser files in
`bun test tests`, so its first case pays for Chrome's first launch in
the CI job. That launch took 8-11 s in four of the last six CI runs, and
this branch's run finished the `more` case in 8.1 s against a 9 s
budget. The page now reports /ready before its scenario starts, startup
gets 30 s, and each scenario keeps its 9 s, the same pattern the context
preview test uses in #4398. With a simulated 10.5 s startup, the old
file times out and this one passes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

* test(viewer): give the empty-filter browser test 25 s for a cold Chrome start

A cold Chrome start on CI has taken 8-11 s, and this file's 9 s browser
race left no room for it: this branch's run finished the first case in
8.1 s. Raise the browser race to 25 s and the test timeout to 40 s, the
same budget #4451 gives the sibling pagination browser tests. The
in-page 6 s deadlines stay. This replaces the separate startup handshake
from the previous commit with that one shared budget.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(report): find installed Windows Chrome for PDF export (#4404)

* Find normally installed Windows Chrome for report PDF export

Signed-off-by: Rudy Celekli <[email protected]>

* Skip optional native Chrome fixture on hosts without Chrome

Signed-off-by: Rudy Celekli <[email protected]>

* Continuously prove installed Chrome lookup in all Windows skill mirrors

Signed-off-by: Rudy Celekli <[email protected]>

* Require installed Chrome in the native Windows CI proof

Signed-off-by: Rudy Celekli <[email protected]>

* fix(report): find Chrome's macOS app bundle for PDF export

The default lookup only knew `google-chrome` on PATH (plus, from this
PR, the Windows install locations). On a Mac, Chrome is an app bundle
with no PATH shim, so `acr.py pdf` always skipped the PDF there too.

- Factor the default lookup into _default_chrome(): `google-chrome` on
  PATH; on Windows `chrome` on PATH, then Program Files and
  LocalAppData; on macOS /Applications and ~/Applications. An explicit
  --chrome is still used as given.
- Hand Chrome a real file URI (Path.as_uri()): "file://" + abspath gave
  file://C:\... on Windows and broke on a '#' in the path everywhere.
- Decode Chrome's stderr as UTF-8 with replacement. With the locale
  codec, a decode error on Windows left r.stderr as None, and the
  failure branch raised AttributeError instead of skipping the PDF.
- Regenerate the five CHECKSUMS.txt files with `acr.py sync-check
  --write`: the test_pdf_windows.py entry was out of canonical order, so
  sync-check reported drift in all four mirrors.

The new ChromeLookup tests patch sys.platform, PATH, the install check
and the Chrome process, so the lookup for each platform runs on every
OS. The macOS, Windows and URI cases fail on main.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

* fix(report): stop Chrome once the PDF is written

Found while checking the macOS lookup live: headless Chrome 154 on macOS
writes the PDF in about 2 seconds and then never exits. Its profile
keep-alives go to zero and the profile unloads, but the browser process
stays up under every flag set tried (extensions, component updates,
background networking, mock keychain, Puppeteer's defaults). So
`acr.py pdf` sat for the full 150 s timeout and then said "PDF skipped,
HTML is canonical (chrome timed out)" with a finished report.pdf on
disk.

- Run Chrome with Popen and poll. Once the printed file is a whole PDF
  (%PDF- head, %%EOF trailer), give Chrome CHROME_EXIT_GRACE_S (5 s) to
  exit by itself, as it does on Windows and Linux, then terminate it.
  CHROME_TIMEOUT_S (150 s) still bounds the whole print.
- Print into the private .chrome-profile and move the file to
  report.pdf only when it is whole, so a failed or partial print never
  replaces the last good PDF and a stale one is never reported as new.
- Send stderr to an anonymous temp file instead of a pipe (a helper
  process can hold a pipe open after Chrome exits) and decode it as
  UTF-8 with replacement.

Live on macOS: `acr.py pdf` now prints `pdf: .../report.pdf` in 7 s
(the report's 898 KB PDF), against 150 s and a skip before. New fake
Popen tests cover a Chrome that keeps running after printing, a failed
print that keeps the previous PDF, and one that never prints.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

* ci(report): prove the new Chrome handling on Windows Python 3.9 and 3.13

A one-off native run for this PR's new commits: the default lookup and
the stop-once-printed loop now drive the real Chrome in
test_pdf_windows.py. Adds a Python 3.9/3.13 matrix and -v output. The
workflow itself is removed again before merge.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

* ci(report): leave the agent-cost-report PDF Windows workflow out of this fix

The workflow did its job on this branch: a native windows-2022 run on
Python 3.9 and 3.13 drove the real Chrome through the default lookup and
the new stop-once-printed loop in all five copies (run 37269475239). It
does not ship with the fix, for the same reasons as #4400's:

- It is one workflow per bug; #4400's sibling was left out too.
- It re-runs one test file over five byte-identical copies. Mirror drift
  (like this PR's out-of-order CHECKSUMS.txt entry) is what
  `acr.py sync-check` catches, and no workflow runs that.

Whether the Python skill gets CI at all, and in what shape, is a
follow-up decision for the owner. test_pdf_windows.py keeps its
ACR_EXPECT_WINDOWS_CHROME hook for that.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(context): pair closing tag after opening tag (#4425)

* fix(context): pair closing tag after opening tag

* fix(context): pair the context tags through one helper at every site

The stray-closing-tag bug fixed here for injectContextIntoMarkdownFile was
copied in four more places. The worst was replaceTaggedContent, the runtime
writer behind the folder CLAUDE.md files and AGENTS.md: there the copied text
grew on every refresh. `claude-mem generate` and the Codex and OpenCode
AGENTS.md cleanups had the same pairing.

findContextBlockRange() takes the first closing tag after an opening tag, and
the opening tag nearest to it, so a dangling opening tag earlier in the file
can't swallow the user's text either. The CLI writer now calls
replaceTaggedContent instead of carrying its own copy, and the Codex cleanup
takes its path as a parameter so it can be tested.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Co-authored-by: agammann <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(report): retain UTF-8 transcript and rule evidence on Windows (#4401)

* fix(report): preserve UTF-8 transcript and rule evidence

Signed-off-by: Rudy Celekli <[email protected]>

* Use the native behavior scanner return contract in encoding regression

Signed-off-by: Rudy Celekli <[email protected]>

* test(report): cover supported Windows Python and Codex encoding

Signed-off-by: Rudy Celekli <[email protected]>

* fix(report): name the encoding at every remaining text read and write

The same locale-codec defect as the five transcript and rule reads this
PR fixes remained at sites #4250 did not list. Two break on the
reporter's own locale:

- rules.py seed_rules read the bundled rules.json, which holds an em
  dash, with the locale codec. Under cp936 every period rollup exits 1
  ("'gbk' codec can't decode byte 0x94"); under cp1252 the rule names
  are mojibake.
- wins.py decoded `git` and `gh` output with the locale codec. gh
  prints UTF-8 and merged-PR titles often contain an em dash. On Windows
  the decode error happens in a reader thread, so r.stdout came back as
  None and the GitHub wins were silently empty but reported "ok". These
  now decode as UTF-8 with errors="replace".

Writes that crashed on cp1252: line-items.csv (titles come from prompts,
so emoji, arrows and CJK are normal) and the behavior-sample sheet,
whose own header has a "→".

Files a person or another tool hands us are read as utf-8-sig, so a
Windows editor's BOM no longer breaks them: `review --apply` (json.load
rejects a BOM, and per SKILL.md the reviewer edits titles in that
file), --precision, --prices, and house rule *.md files (where a BOM
hid a HARD header on line 1).

Every other text open now names UTF-8 too, so the rule is uniform and
can be guarded: acr.py collect, devices, prices.write, the rollup
outputs and inputs, sample, and sync, which also writes CHECKSUMS.txt
with LF on every OS.

Tests that run on every OS (TranscriptEncoding stays Windows-only):
- an AST guard: every text-mode open() and every text=True call passes
  encoding=. It lists 32 sites on main.
- review --apply with a reviewed file saved with a BOM, keeping a
  non-ASCII title. It fails on main with "Unexpected UTF-8 BOM".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(windsurf): inherit workspace directory in installed hooks (#4446)

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(gemini): rotate refused keys reported as HTTP 400 (#4450)

* fix(gemini): rotate refused keys reported as HTTP 400

Signed-off-by: Rudy Celekli <[email protected]>

* fix(server): classify Gemini 400 invalid-key refusals as auth_invalid

The worker now reads Google's HTTP 400 API_KEY_INVALID answer as a refused
credential. The self-hosted server's classifier still labeled the same answer
unrecoverable, which the classifier parity test says must not drift. Both
kinds are terminal on the server, so only the failed job's label and message
change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(tool-uses): read case-variant project keys consistently (#4442)

* fix(tool-uses): read case-variant project keys consistently

Signed-off-by: Rudy Celekli <[email protected]>

* perf(tool-uses): index case-insensitive project reads

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(openclaw): bracket IPv6 worker addresses in URLs (#4452)

* fix(openclaw): bracket IPv6 worker addresses in URLs

Signed-off-by: Rudy Celekli <[email protected]>

* test(openclaw): skip IPv6 cases when loopback binding is unavailable

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(search): preserve category identity for shared SQLite row IDs (#4431)

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(search): retain the Unicode token form stored in server memory (#4440)

* fix(search): retain the Unicode token form stored in server memory

Signed-off-by: Rudy Celekli <[email protected]>

* fix(search): match Unicode alternatives per query token

Signed-off-by: Rudy Celekli <[email protected]>

* fix(search): normalize compatibility symbols before discarding them

Signed-off-by: Rudy Celekli <[email protected]>

* fix(search): preserve literal symbol separators i…
thedotmack added a commit that referenced this pull request Oct 12, 2026
…4699)

* fix: stop double-encoding tool payloads in observation prompts

ingestObservation stores tool_input/tool_response as JSON text, but both

providers wrapped them in a second JSON.stringify before

buildObservationPrompt. The parse inside buildObservationPrompt then

returned the inner JSON text as a string, and truncateObservationField

re-escaped it, so every observer prompt carried the payload as a

single-line escaped string ({\"file_path\":...}, \\n) instead of

readable JSON.

Cost: 5-11% more prompt tokens per observation for the same content,

a 16k-char truncation budget partly spent on escape characters, and an

observer model reading escaped soup.

Pass the stored JSON text through untouched and embed string values raw

in truncateObservationField, which also makes the prompt builder safe

against double-encoded or plain-text payloads from other producers.

* fix: continue Codex transcripts after archival

* fix: retain partial JSONL across Codex archival

* fix: recognize custom Codex schemas during archival

* warn(session): report pending buffer counts during teardown (#4614)

* fix(installer): select installed agents before offering Claude Code

Preselect detected agents and ask to install Claude Code only if the user selects it. Keep Claude Code as the fallback when no supported agent is detected.

* fix(integrations): close DSH dependency graph and preserve profile cleanup

Bundle the pinned pure SDK helpers with provenance and retained licenses so Bun installs do not resolve unpublished host peer packages. Keep DSH profile ownership recoverable and uninstall the native plugin before removing its package files.

Validate the standalone host contract, successful profile add/remove, failure rollback, and configured watch preservation.

* test(integrations): isolate DSH CLI fixtures from release builds

Run profile commands in a fresh process with a temporary data directory and package fixture. This makes the add/remove and rollback tests independent of generated release output and module-level path caches.

* perf(observer): send session_id and trace on OpenRouter requests (#4418)

Observer requests that reach OpenRouter (openrouter.ai, or the cmem.ai
gateway, which spreads the client body into its upstream request) now carry:

- session_id: a one-way SHA-256 of the observed session's id, stable for the
  whole Claude Code session. OpenRouter uses it as the sticky-routing key, so
  a session stays on the provider that holds its prompt cache. Broadcast maps
  it to PostHog's $ai_session_id.
- trace.trace_id: a random UUID per observer generation, minted in
  openObserverGeneration, so it changes whenever the conversation is
  recycled or restarted ($ai_trace_id).
- trace.trace_name 'claude-mem observer', trace.generation_name the request
  kind (init, observation, summary, field_compression, telegram_wrapup;
  $ai_span_name) and trace.claude_mem_version, the build-stamped plugin
  version (metadata_claude_mem_version).

The session id is derived, not stored, because the ActiveSession object
does not live as long as the session: an idle generator drops it after three
minutes and the next tool call builds a new one. No user field is sent; the
gateway sets it server-side. Custom base URLs behind the OpenRouter provider
and the openai-compatible presets get neither field.


Claude-Session: https://claude.ai/code/session_011rgzkjwPRzo2YH57oEFpaP

Co-authored-by: Claude Opus 5.5 <[email protected]>

* perf(observer): open init and continuation prompts with the same fixed instructions (#4415)

* perf(observer): open init and continuation prompts with the same fixed instructions

A provider prompt cache (OpenRouter, the cmem.ai gateway) hits only on a
byte-identical prefix. The init prompt put the per-generation
session-start context, whose first line is "# [project] recent context,
<date time>", right after system_identity and ahead of ~6.9k chars
(~1.7k tokens) of fixed instructions. The continuation prompt opened
with its greeting and that same context. No two sessions shared more
than system_identity, and an init and a continuation shared nothing.

Both prompts now open with one block that depends on the mode alone:
system_identity, observer_role, spatial_awareness, recording_focus,
skip_guidance and the observation schema. The prior context, the
user's request, the continuation greeting and continuation_instruction
follow it, and the MEMORY PROCESSING header stays last. Every piece of
text is unchanged; only its position moved. For the code mode the
shared start of two sessions' system messages grows from 422 chars
(init vs init) and 0 (init vs continuation) to ~7.26k chars.

The Claude SDK and Codex paths use the same builders, so their first
user message opens with the same block. Nothing reads the prompt's
order: the request block is found by regex and history pruning keys on
<user_request>.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011rgzkjwPRzo2YH57oEFpaP

* fix(modes): point continuation_instruction at the schema above it

The previous commit moved the observation schema into the fixed block
that now opens every continuation prompt, so continuation_instruction
follows the schema instead of preceding it. Its "using the XML
structure below" now reads "above" in all 33 modes that carry it:
code, law-study, email-investigation, meme-tokens and the 29 code
language variants, which reuse the English sentence and append a
LANGUAGE REQUIREMENTS line. Nothing else in those files changes.

The other position words in the mode prompts and in src/sdk/prompts.ts
still point the right way and stay as they are: the footer's "XML
structure above" and output_format_header's "this XML structure" sit
inside the schema next to the XML they name; "The context above" in
the prior-context wrapper refers to the block directly above it; the
observation prompt's "block above" and the summary prompt's "XML
structure above" belong to prompts this change does not reorder; and
"earlier in this session", "prior messages in this conversation" and
"previous reply" refer to time, not position.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011rgzkjwPRzo2YH57oEFpaP

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>

* chore: bump version to 13.30.0

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011rgzkjwPRzo2YH57oEFpaP

* docs: update CHANGELOG.md for v13.30.0

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011rgzkjwPRzo2YH57oEFpaP

* docs(version-bump): the agent publishes to npm with the monthly token (#4371)

The "human handoff" npm step was obsolete. Agents publish with a 30-day
granular token in the maintainer's ~/.npmrc. When it expires, open the npm
new-token page and ~/.npmrc for the maintainer instead of hunting backups or
waiting on the npm-publish workflow, whose NPM_TOKEN secret has failed every
tag since v13.26.1.


Claude-Session: https://claude.ai/code/session_013fww8bJwhSZFgYhfXs6GZm

Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(hooks): skip timeline injection on Claude Code resume (#4423)

* chore: bump version to 13.30.1

* docs: update CHANGELOG.md for v13.30.1

* perf(session-start): newest-N per project key, local-first context (#4427)

SessionStart read every observation and summary of the project family
(~21.7k rows / 63 MB on a 1.2 GB db) and sorted them to keep 50, because
`project IN (...) OR merged_into_project IN (...)` cannot stop early. Cold
pages made that 0.8-1.7 s per session start.

- v63: (key COLLATE NOCASE, created_at_epoch DESC) indexes on observations
  and session_summaries for project and merged_into_project.
- queryObservationsNewest / querySummariesMulti take the newest N per
  (column, key) and keep the newest N of the union. Same rows, same order
  (verified on a real 1.2 GB db); 3.8 ms instead of 0.05-1.7 s.
- The worker no longer waits on a sync pull before rendering SessionStart
  context; it only nudges one in the background.
- Precomputed SessionStart context is servable with cloud sync on. The local
  db is the source of truth and every op sync applies invalidates the files,
  so the files no longer wait on a Realtime channel the hub may not offer.
- cowork hook: no cmem.ai context read (SessionStart or agent prompts) on a
  machine with a local claude-mem install.


Claude-Session: https://claude.ai/code/session_011rgzkjwPRzo2YH57oEFpaP

Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(sync): preserve Retry-After minimum after jitter (#4383)

* fix(sync): preserve hub retry minimum after jitter

Signed-off-by: Rudy Celekli <[email protected]>

* Rebuild shipped source maps with checkout-local dependencies

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(logs): stop tail reads at the existing byte limit (#4393)

* fix(logs): stop tail reads at the existing byte limit

Signed-off-by: Rudy Celekli <[email protected]>

* build: regenerate portable worker source maps

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(sse): remove clients when Bun closes their socket (#4394)

* fix(sse): remove clients when Bun closes their socket

Signed-off-by: Rudy Celekli <[email protected]>

* build: regenerate portable worker source maps

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(viewer): release loading after a failed pagination request (#4387)

* fix(viewer): release pagination loading after a failed page

Signed-off-by: Rudy Celekli <[email protected]>

* fix(viewer): retain successful pages and expose manual recovery

Signed-off-by: Rudy Celekli <[email protected]>

* build(viewer): ship pagination recovery with current dependencies

Signed-off-by: Rudy Celekli <[email protected]>

* fix(viewer): scope pagination failures to the active feed

Signed-off-by: Rudy Celekli <[email protected]>

* build: refresh viewer bundle for scoped failure handling

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(worker): preserve observation context during field compression (#4403)

* fix(worker): freeze observation context before field compression

Signed-off-by: Rudy Celekli <[email protected]>

* build: ship observation compression context correction

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(smart-read): include generator functions in native outlines (#4419)

* fix(parser): retain JavaScript and TypeScript generator declarations

Signed-off-by: Rudy Celekli <[email protected]>

* build: refresh generator-aware smart outline MCP artifact

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(smart-read): preserve lexical ownership of outline symbols (#4406)

* fix(smart-read): assign symbols to their nearest lexical container

Signed-off-by: Rudy Celekli <[email protected]>

* build: ship corrected smart-outline symbol ownership

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(smart-read): retain complete multiline imports in outlines (#4409)

* fix(smart-read): preserve complete import capture ranges

Signed-off-by: Rudy Celekli <[email protected]>

* build: regenerate smart-read import capture bundle

Signed-off-by: Rudy Celekli <[email protected]>

* fix(smart-read): keep each outline import to one bounded line

A multiline import capture now prints as one line: the captured lines are
trimmed and joined with spaces, then capped at 200 characters (the
signature budget), keeping the first 140 and the last 55 so the module
source survives. Go `import ( … )` groups, Ruby calls with `do … end`
blocks and SCSS `@include { … }` are single captures that can span a whole
file; joined with newlines they broke the outline layout and could print a
spec file in full as its first "import". CRLF carriage returns are trimmed
too.

Tests cover the joined multiline import, CRLF, the 200-char cap, Go,
Ruby (`do … end` and a file-wide RSpec block) and SCSS; all seven fail
on the previous head and pass now.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(installer): report host download failures and recover selection

* feat: add iFlytek Spark OpenAI-compatible preset (#4379)

* feat: add iFlytek Spark OpenAI-compatible preset

Add an iflytek preset for iFlytek's Astron MaaS platform, defaulting to
the pay-as-you-go endpoint and spark-x2.5. Token Plan keys only work on
the Token Plan endpoint, which the docs show as a base URL override.

Signed-off-by: FenjuFu <[email protected]>

* feat(viewer): show the Token Plan base URL hint for the iFlytek preset

Signed-off-by: FenjuFu <[email protected]>

---------

Signed-off-by: FenjuFu <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(parser): omit array entries that decode to whitespace (#4397)

* fix(parser): omit decoded empty array entries

Signed-off-by: Rudy Celekli <[email protected]>

* build: ship decoded empty array fix

Signed-off-by: Rudy Celekli <[email protected]>

* build: keep bundled source maps portable

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(stream): release SSE reader when cancellation rejects (#4382)

* fix(stream): release SSE reader lock when cancellation fails

Signed-off-by: Rudy Celekli <[email protected]>

* Rebuild shipped source maps with checkout-local dependencies

Signed-off-by: Rudy Celekli <[email protected]>

* fix(stream): read non-streamed provider bodies with the shared byte-stream reader

responseChunks in streamed-chat-completion.ts was a copy of sse-reader's
iterateByteStream loop with the same bug: when reader.cancel() rejects, which
it always does on an errored body, releaseLock() was skipped. Every send with
liveness null (the cmem gateway, endpoints that refused streaming) reads its
body through responseChunks, so that path kept the bug the reader fix closed.

Export the fixed iterateByteStream and delegate to it, so there is one
implementation. The new test sends a non-streamed request whose JSON body
breaks off mid-read and fails before this change (the body stays locked).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(search): keep FTS capability probes connection-local (#4385)

* fix(search): keep FTS capability probes connection-local

Signed-off-by: Rudy Celekli <[email protected]>

* Rebuild shipped source maps with checkout-local dependencies

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(integrations): verify current DSH profiles and transcript format

* perf(sqlite): covering indexes for projectReadKeys merged-into lookups (#4429)

projectReadKeys runs on every SessionStart render (context cache). Its
`SELECT project ... WHERE merged_into_project COLLATE NOCASE IN (...)`
lookups used the single-column v55 index and then loaded every merged row
from the table to read `project`: 7,499 pages for 31 keys on a 1.2 GB db,
seen in worker stack samples as ~0.9 s on the main thread when cold.

v64 adds (merged_into_project COLLATE NOCASE, project) on observations and
session_summaries. Same keys, 355 pages, 9 ms.


Claude-Session: https://claude.ai/code/session_011rgzkjwPRzo2YH57oEFpaP

Co-authored-by: Claude Opus 5.5 <[email protected]>

* chore: bump version to 13.31.0

* docs: update CHANGELOG.md for v13.31.0

* fix(hooks): skip the pid-file probe once /api/health answered (#4249) (#4426)

An unparseable worker.pid made a healthy worker read as down and got the file deleted.

Co-authored-by: Cassian433 <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(search): finish partial FTS index initialization (#4381)

* fix(search): recover incomplete FTS index setup atomically

Signed-off-by: Rudy Celekli <[email protected]>

* Rebuild shipped source maps with checkout-local dependencies

Signed-off-by: Rudy Celekli <[email protected]>

* fix(fts): reserve writer and recheck missing-index ownership

Signed-off-by: Rudy Celekli <[email protected]>

* Rebuild shipped worker and SQLite artifacts for owned FTS initialization

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(viewer): filter multiline logs with their record (#4417)

* fix(viewer): keep multiline logs with their filtered record

Signed-off-by: Rudy Celekli <[email protected]>

* fix(viewer): hide unknown log-tail fragments under narrower filters

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(pi): accept duplicate anchors and recover after private turns

* fix(search): honor ascending file-summary pagination order (#4386)

* fix(search): honor ascending file-summary pagination order

Signed-off-by: Rudy Celekli <[email protected]>

* Rebuild shipped source maps with checkout-local dependencies

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(parser): retain notes-only summaries and show notes in the viewer (#4388)

* fix(parser): retain summaries containing only notes

Signed-off-by: Rudy Celekli <[email protected]>

* build: ship notes-only summary parser fix

Signed-off-by: Rudy Celekli <[email protected]>

* build: keep bundled source maps portable

Signed-off-by: Rudy Celekli <[email protected]>

* fix(context): preserve summary notes through next-session rendering

Signed-off-by: Rudy Celekli <[email protected]>

* build: include summary notes in delivered context bundles

Signed-off-by: Rudy Celekli <[email protected]>

* fix(viewer): include existing notes in paginated and live summary cards

Signed-off-by: Rudy Celekli <[email protected]>

* build: include summary notes in viewer and worker artifacts

Signed-off-by: Rudy Celekli <[email protected]>

* build(viewer): preserve deployed dependency versions in notes rendering

Signed-off-by: Rudy Celekli <[email protected]>

* revert(context): keep summary notes out of session-start context for now

This reverts commit e40beb620 ("fix(context): preserve summary notes
through next-session rendering").

Rendering Notes in the last-summary block adds tokens to every session's
startup context by default: CLAUDE_MEM_CONTEXT_SHOW_LAST_SUMMARY defaults
to true, and most stored summaries carry notes. Whether that's worth the
tokens is the owner's call, so it stays open as a follow-up decision
(for example, render notes only for notes-only summaries, or behind an
opt-in setting).

The prompt-builder line goes back to asking for one of the five rendered
fields, so the server model isn't steered toward notes-only output that
never reaches session context.

Kept from this PR: notes-only summaries are valid and stored (parser),
and the viewer shows Notes on summary cards.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(smart-search): retain file and directory matches without symbol hits (#4414)

* fix(smart-search): retain matching file paths in results

Signed-off-by: Rudy Celekli <[email protected]>

* build: refresh smart search MCP artifact

Signed-off-by: Rudy Celekli <[email protected]>

* fix(smart-search): reserve symbol file views before path-only results

Signed-off-by: Rudy Celekli <[email protected]>

* fix(smart-search): list path-only matches on one line instead of folding them

Files whose path matches the query but none of whose symbols are shown now
come back in their own `matchingFiles` list, one line each with language,
line count and folded-token estimate, rendered under "Matching Files" after
the folded views. `foldedFiles` and `tokenEstimate` are computed exactly as
before (symbol files only), so a symbol search's folded output is unchanged.

- Only literal substrings qualify: every query part must appear in the
  path. The fuzzy subsequence fallback stays for symbol names; on paths it
  matched most of a large repo for words like "store" or "cli".
- Hits are ranked by matchScore on the file name before capping at
  max_results (every literal hit scores the same on its full path): an
  exact name, then a name containing the query, then a directory hit.
- A query with no searchable parts (" / ") lists nothing instead of every
  file.
- The early return now fires only when both lists are empty, with "No
  matching symbols or files found.".

Measured on src/services/worker (79 files), the previous head grew symbol
searches by up to ~5,200 tokens ("session": 8,278 -> 13,450); this adds
10-266 tokens ("session": 8,544 with 10 listed paths).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* feat(quota): make the quota guard thresholds configurable per window (#4396)

* feat(quota): make the quota guard thresholds configurable per window (#4230)

The utilization thresholds that pause a subscription observer were constants.
They now come from five settings, one per window, whose defaults equal the old
constants, so nothing changes unless a user sets them. A missing or
unparseable value falls back to the default. A provider-side rejection still
stops the observer whatever the threshold, and seven_day_overage_included
keeps having no threshold.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(quota): parse quota thresholds strictly as fractions from 0 to 1

`parseFloat(x) || default` turned '0' into the default and accepted any
number, so '93' (meant as 93%) or '1.5' silently switched a window's
guard off, and a negative value paused the observer at once. Now a blank
value gives the default, a value in [0, 1] is used as-is (0 and 1
included), and anything else gives the default with one CONFIG warning
per key per process.

Tests cover both bounds, the out-of-range, malformed and blank
fallbacks, the warn-once, and thresholds read from settings.json with no
env override. The docs say thresholds are fractions, what an
out-of-range value does, and that the five-hour window still stops at
85% or more within 15 minutes of its reset.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Alex Newman <[email protected]>

* fix(search): honor requested date order in hybrid file results (#4408)

* fix(search): honor explicit date order in hybrid file results

Signed-off-by: Rudy Celekli <[email protected]>

* build(search): ship hybrid file ordering correction

Signed-off-by: Rudy Celekli <[email protected]>

* fix(search): keep tied file-search timestamps in stable ID order

Signed-off-by: Rudy Celekli <[email protected]>

* build: refresh stable file search ordering artifacts

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(report): inherit reviewer in generated review templates (#4392)

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(timeline): select ID-anchor neighbors by capture chronology (#4390)

* fix(timeline): select ID anchor neighbors by capture chronology

Signed-off-by: Rudy Celekli <[email protected]>

* Rebuild shipped source maps with checkout-local dependencies

Signed-off-by: Rudy Celekli <[email protected]>

* Preserve timeline chronology without unnecessary boundary sorts

Signed-off-by: Rudy Celekli <[email protected]>

* Rebuild timeline boundary queries in shipped artifacts

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(cli): skip Qwen sends that omit submitted_prompt entirely (#4215) (#4380)

* fix(cli): skip Qwen sends that omit submitted_prompt entirely (#4215)

#4224 taught session-init to read Qwen's `submitted_prompt` and to skip a
send when the host sends that field empty. One case is left: Qwen's docs
say continuation and ToolResult sends leave `submitted_prompt` out
entirely, so the field arrives absent (`undefined`), the handler falls back
to `prompt`, and an empty `prompt` is stored as `[media prompt]` -- a fake
prompt row once per tool round of an agent loop.

The absence cannot be read as "not a user turn" on every host: Qwen runs the
same `hook claude-code session-init` command as Claude Code, where an empty
prompt is a real image-only submission (#928). So the skip is scoped to
Qwen, recognised from `transcript_path` under `~/.qwen/`, and requires both
an absent field and an empty prompt.

- `isQwenTranscriptPath` matches `.qwen` as a whole path segment, so a
  `~/.qwen-notes/` project directory is not mistaken for the host, and it
  normalises Windows separators.
- Tests cover the Qwen skip, a whitespace-only prompt, a real Qwen text
  submission, the Claude Code #928 image-only turn, and an unidentifiable
  host. The three non-Qwen cases are what fail if the skip is not
  host-scoped.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Signed-off-by: Aniruddha Adak <[email protected]>

* fix(cli): recognise Qwen hooks by QWEN_PROJECT_DIR when transcripts move (#4215)

Qwen keeps transcripts under QWEN_RUNTIME_DIR, advanced.runtimeOutputDir or
QWEN_HOME when one is set, so a `/.qwen/` path check missed users who moved
them and their ToolResult sends kept storing `[media prompt]` rows. Qwen sets
QWEN_PROJECT_DIR for every command hook, so the guard now reads it too.

The check only applies when the event carries a transcript path. The
transcript watcher records prompts without one, from a worker that may have
inherited QWEN_PROJECT_DIR from the Qwen hook that spawned it.

Adds an end-to-end test through the real adapter, session routes and SQLite
(adapted from the reproduction in #4402): a session whose first send has no
submitted_prompt is still created with its prompt, and only the empty
ToolResult send after it is skipped.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Aniruddha Adak <[email protected]>
Co-authored-by: Aniruddha Adak <[email protected]>
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Co-authored-by: Alex Newman <[email protected]>

* fix(viewer): keep context previews scoped to the current selection (#4398)

* fix(viewer): keep context previews scoped to the current selection

Signed-off-by: Rudy Celekli <[email protected]>

* build(viewer): include scoped context preview responses and native browser regression

Signed-off-by: Rudy Celekli <[email protected]>

* build(viewer): retain deployed React and DOMPurify versions

Signed-off-by: Rudy Celekli <[email protected]>

* test(viewer): wait for context preview browser readiness

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(worker): retain the originating prompt on queued summaries (#4407)

* fix(worker): retain the originating prompt on queued summaries

Signed-off-by: Rudy Celekli <[email protected]>

* build(worker): ship queued summary prompt attribution

Signed-off-by: Rudy Celekli <[email protected]>

* fix(worker): preserve active prompt context for older summaries

Signed-off-by: Rudy Celekli <[email protected]>

* build(worker): ship summary response context isolation

Signed-off-by: Rudy Celekli <[email protected]>

* fix(worker): isolate queued observation prompt attribution

Signed-off-by: Rudy Celekli <[email protected]>

* build(worker): ship queued observation context isolation

Signed-off-by: Rudy Celekli <[email protected]>

* fix(cursor): advance an existing observer on accepted prompts

Signed-off-by: Rudy Celekli <[email protected]>

* build(worker): ship Cursor active prompt advancement

Signed-off-by: Rudy Celekli <[email protected]>

* test(worker): tolerate fixed observer instruction prefixes

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(opencode): retain built-in tool file evidence (#4421)

* fix(opencode): retain built-in tool file evidence

Signed-off-by: Rudy Celekli <[email protected]>

* fix(worker): match CLAUDE_MEM_SKIP_TOOLS case-insensitively; send apply_patch as patch

OpenCode's read/write/edit now arrive as Read/Write/Edit, so a user who
listed `read` in CLAUDE_MEM_SKIP_TOOLS would have had those tools captured
again. The skip check now lowercases both the entries and the tool name. The
exact `Skill` telemetry branch is unchanged.

apply_patch's `patchText` is renamed to the `patch` the worker reads instead
of being copied next to it, so the observer is not sent the whole patch twice.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(gemini): attribute observations to the served model (#4391)

* fix(gemini): attribute observations to the served model

Signed-off-by: Rudy Celekli <[email protected]>

* build: ship Gemini served-model attribution

Signed-off-by: Rudy Celekli <[email protected]>

* build: keep bundled source maps portable

Signed-off-by: Rudy Celekli <[email protected]>

* test: restore Gemini fixture state after setup failure

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(worker): persist the model reported by Claude assistant messages (#4405)

* fix(worker): persist the model reported by Claude assistant messages

Signed-off-by: Rudy Celekli <[email protected]>

* fix(worker): keep the requested model when a Claude frame omits it

The assistant frame's model is read off the CLI's stdout at runtime, so a
gateway or proxy behind ANTHROPIC_BASE_URL can leave it out. Passing it
through unguarded stored NULL in observations.generated_by_model and sent
'unknown' as the telemetry model, a regression from main's configured
value. Fall back to the requested model when the frame's model is missing
or empty, the same guard the Gemini, OpenRouter and OpenAI-compatible
providers use for their served model.

The new `absent` fixture kind drops `message.model` from the fake CLI's
assistant frame and expects the requested `haiku`; it fails without the
fallback (generated_by_model was null).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(worker): preserve captured file path whitespace (#4389)

* fix(worker): preserve captured file path whitespace

Signed-off-by: Rudy Celekli <[email protected]>

* build: ship exact captured file paths

Signed-off-by: Rudy Celekli <[email protected]>

* build: keep bundled source maps portable

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(search): preserve commas in explicit file paths (#4395)

* fix(search): preserve commas in explicit file paths

Signed-off-by: Rudy Celekli <[email protected]>

* build: regenerate portable worker source maps

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(worker): retain file evidence from Codex hook patches (#4411)

* fix(worker): retain file evidence from Codex hook patches

Signed-off-by: Rudy Celekli <[email protected]>

* build(worker): ship Codex hook patch file evidence

Signed-off-by: Rudy Celekli <[email protected]>

* test(worker): exercise the verbatim Codex hook fixture

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(viewer): activate the focused session control with Enter and Space (#4413)

* fix(viewer): keep session keyboard actions on their focused control

Signed-off-by: Rudy Celekli <[email protected]>

* test(viewer): give browser startup and rendering separate bounded waits

Signed-off-by: Rudy Celekli <[email protected]>

* test(viewer): wait for a complete browser debugging port

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(observer): preserve outage evidence after an empty store (#4384)

* fix(observer): report store success only after writing memory

Signed-off-by: Rudy Celekli <[email protected]>

* Rebuild shipped source maps with checkout-local dependencies

Signed-off-by: Rudy Celekli <[email protected]>

* test(observer): isolate and remove each response health ledger

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(viewer): protect settings edits while Save is pending (#4420)

* fix(viewer): prevent settings edits from being discarded during save

Signed-off-by: Rudy Celekli <[email protected]>

* test(viewer): require a browser for settings regressions in CI

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(report): export portable dates and UTF-8 HTML on Windows (#4400)

* fix(cost-report): render portable dates and UTF-8 HTML on Windows

Signed-off-by: Rudy Celekli <[email protected]>

* Continuously exercise report rendering on native Windows

Signed-off-by: Rudy Celekli <[email protected]>

* Include adjacent report formatter controls in native Windows gate

Signed-off-by: Rudy Celekli <[email protected]>

* Run native report regressions in every shipped skill distribution

Signed-off-by: Rudy Celekli <[email protected]>

* fix(report): format the measured bucket date without %-d

measure.py labelled the OpenRouter bucket with strftime('%a %-d %b').
%-d is a glibc/BSD extension, and Windows strftime rejects it with
"ValueError: Invalid format string". rollup reaches this through
measure.apply whenever measured.json has status ok, so a Windows rollup
with an OpenRouter key exited before writing any output. Compose the day
the way render.py now does, and pin both labels (week and month, with an
unpadded single-digit day) in test_measure.py.

Also write measured.json with an explicit UTF-8 encoding instead of the
locale codec.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

* fix(report): keep the last report.html when a render fails

render_file opened report.html for writing, which truncates it, before
page() built the HTML. Any failure while building or encoding the page
left a 0-byte report and wiped the last good one: #4250's
UnicodeEncodeError under cp936, or a KeyError from a malformed
report.json (which acr.py catches and turns into an error exit). Build
and encode first, then write the bytes. Binary mode also gives the same
LF output on every OS.

The new test renders a fixture, then renders a copy without line_items
into the same directory; it fails on main, where report.html is left
empty.

The date and encoding hunks in render.py come from the patch @meng823222
posted in #4250.

Co-authored-by: meng823222 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

* test(report): guard %-d on every OS; run the encoding test on Python 3.9

- The Windows child script asserted locale.getencoding(), which exists
  only on Python 3.11+, while SKILL.md supports Python 3.9+. On Windows
  Python 3.9 and 3.10 the test errored instead of testing. Use
  locale.getpreferredencoding(False), as #4401 does.
- The DateFormatting tests only fail on Windows. Add a guard that runs
  everywhere: no strftime flag of the form %-X in scripts/acr.py or
  scripts/acr/*.py. On main it lists measure.py:61,69 and
  render.py:40,47,48,49.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

* ci(report): prove the date and encoding fixes on Windows Python 3.9 and 3.13

A one-off native run for this PR's new commits: the strftime and
locale-API regressions cannot fail on macOS or Linux. Adds a Python
3.9/3.13 matrix and test_measure.py (which needs the tzdata step). The
workflow itself is removed again before merge.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

* ci(report): leave the agent-cost-report Windows workflow out of this fix

The workflow did its job on this branch: a native windows-2022 run on
Python 3.9 and 3.13 passed the date, encoding and failed-render tests
in all five copies (run 37266351986). It does not ship with the fix:

- It is one workflow per bug. #4404 adds a second one for the PDF
  lookup, and #4401's Windows tests would need a third.
- It re-runs a slice of the skill's tests (test_render*.py) over five
  byte-identical copies. Mirror drift is what `acr.py sync-check`
  catches, and no workflow runs that.
- It installs tzdata from PyPI for tests that do not need it.

Whether the Python skill gets CI at all, and in what shape, is a
follow-up decision for the owner.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

* style(report): restore test_measure comment alignment

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: meng823222 <[email protected]>

* test(viewer): wait for recovery DOM commits in headless CI

* fix(openclaw): capture actual completed tool input and output (#4422)

* fix(openclaw): capture completed tool parameters and results

Signed-off-by: Rudy Celekli <[email protected]>

* fix(openclaw): align completion verification and request deadline

Signed-off-by: Rudy Celekli <[email protected]>

* fix(openclaw): keep failed tools' error text and tolerate a missing params

after_tool_call reports a failed call in `error`, which the handler ignored,
so failed tools lost the error text main's persisted tool-result message
carried. It now leads the response, ahead of any partial result, before the
1000-character cap. A host build that omits `params` no longer throws at
`event.params.path`.

The completion fixture now waits for the worker to finish ingesting the
fire-and-forget POST instead of polling for its arrival. The architecture
diagrams line up again, and the docs mention the error text.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(kimi): preserve Read file paths across hooks (#4416)

* fix(kimi): normalize Read paths for file memory

Signed-off-by: Rudy Celekli <[email protected]>

* build(worker): ship Kimi Read path normalization

Signed-off-by: Rudy Celekli <[email protected]>

* fix(kimi): preserve canonical Read paths

Signed-off-by: Rudy Celekli <[email protected]>

* build(worker): ship Kimi canonical path preservation

Signed-off-by: Rudy Celekli <[email protected]>

* fix(kimi): keep kimi-file:// attachment references out of file reads

Kimi's Read accepts a kimi-file:// session attachment reference as `path`,
not only a file. Aliasing it to `file_path` recorded attachment ids as
files_read entries in the file index. Such a reference is now left as is.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(viewer): show producer logs when all components are selected (#4410)

* fix(viewer): include producer logs when all components are selected

Signed-off-by: Rudy Celekli <[email protected]>

* fix(viewer): filter logger components without a chip under an Other chip

The console's component filter knows 9 chips, but the logger writes 45
components. The all-selected special case only showed the other 36 while
every chip was on: deselecting any one chip (say, noisy HTTP) hid SEARCH,
QUEUE, INGEST, CLOUD_SYNC and the rest again.

Map every component without a chip of its own to a new Other chip, and
build the initial and Select-all sets from LOG_COMPONENTS so Other is on by
default and #4417's headerless-line rule (all chips on) still holds. The
browser test now checks that SEARCH, QUEUE and INGEST stay visible with
only Hook off and that Other alone shows exactly those; both fail on the
previous head. Its timeouts now match #4417's (a cold CI Chrome launch
has taken over 10 s).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

* test(viewer): give the log filter browser test a 25 s browser budget

A cold Chrome start plus the viewer bundle can take more than 9 s on Linux
CI; #4387's pagination test, with the same 9 s race, times out there. Raise
the browser race to 25 s and the test timeout to 40 s. The in-page wait for
the logs stays at the original 6 s: it starts once the page is running, so
the cold start doesn't count against it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(worker): use registered memory identity in response metadata (#4399)

* fix(worker): retain registered identity in response metadata

Signed-off-by: Rudy Celekli <[email protected]>

* build: ship registered response identity fix

Signed-off-by: Rudy Celekli <[email protected]>

* test: scope response fixture cleanup around setup

Signed-off-by: Rudy Celekli <[email protected]>

* test: await response iterator cleanup

Signed-off-by: Rudy Celekli <[email protected]>

* test: verify stored summary identity in response metadata

Signed-off-by: Rudy Celekli <[email protected]>

* fix(sqlite): carry deliberate session rekeys into tool receipts

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* test(viewer): give the pagination browser tests time for a cold Chrome start (#4451)

The first case in pagination-recovery.browser.test.ts bundles the viewer
and launches headless Chrome inside a 9 s window (12 s test timeout). On a
busy CI runner that takes about 8.4-9.8 s, so the test fails on most Linux
runs since #4387 landed, on main and on unrelated PRs alike. Locally it
passes in 3-5 s.

Raise the browser window to 25 s and the test timeout to 40 s in both
pagination browser tests, in line with the other viewer browser tests
(20-45 s). The in-page settle deadlines are unchanged, so a real
regression still fails fast inside the page.


Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(viewer): load older rows after the selected category empties (#4412)

* fix(viewer): keep pagination reachable after filtered rows disappear

Signed-off-by: Rudy Celekli <[email protected]>

* fix(viewer): ignore late load-more notifications from a removed sentinel

The empty feed now renders its pagination sentinel on mount, so the
mount observer can deliver its first notification after the initial
page started loading and failed, but before React's effect cleanup
disconnects it. Its closure still says hasMore && !isLoading &&
!loadError, so it cleared the error and fetched again: the feed retried
a failed page on its own and never showed Retry. #4387's
pagination-recovery browser cases failed in 4 of 5 runs on this branch.

Only act on a notification whose sentinel is still connected. React
renders the sentinel only while loading is allowed, so a connected
sentinel means the closure's state is current. Adds a browser case that
delivers the mount observer's notification inside the commit that
removed the sentinel, before the cleanup.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

* test(viewer): give Chrome startup its own budget in the empty-filter test

empty-filter-pagination runs before the pagination browser files in
`bun test tests`, so its first case pays for Chrome's first launch in
the CI job. That launch took 8-11 s in four of the last six CI runs, and
this branch's run finished the `more` case in 8.1 s against a 9 s
budget. The page now reports /ready before its scenario starts, startup
gets 30 s, and each scenario keeps its 9 s, the same pattern the context
preview test uses in #4398. With a simulated 10.5 s startup, the old
file times out and this one passes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

* test(viewer): give the empty-filter browser test 25 s for a cold Chrome start

A cold Chrome start on CI has taken 8-11 s, and this file's 9 s browser
race left no room for it: this branch's run finished the first case in
8.1 s. Raise the browser race to 25 s and the test timeout to 40 s, the
same budget #4451 gives the sibling pagination browser tests. The
in-page 6 s deadlines stay. This replaces the separate startup handshake
from the previous commit with that one shared budget.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(report): find installed Windows Chrome for PDF export (#4404)

* Find normally installed Windows Chrome for report PDF export

Signed-off-by: Rudy Celekli <[email protected]>

* Skip optional native Chrome fixture on hosts without Chrome

Signed-off-by: Rudy Celekli <[email protected]>

* Continuously prove installed Chrome lookup in all Windows skill mirrors

Signed-off-by: Rudy Celekli <[email protected]>

* Require installed Chrome in the native Windows CI proof

Signed-off-by: Rudy Celekli <[email protected]>

* fix(report): find Chrome's macOS app bundle for PDF export

The default lookup only knew `google-chrome` on PATH (plus, from this
PR, the Windows install locations). On a Mac, Chrome is an app bundle
with no PATH shim, so `acr.py pdf` always skipped the PDF there too.

- Factor the default lookup into _default_chrome(): `google-chrome` on
  PATH; on Windows `chrome` on PATH, then Program Files and
  LocalAppData; on macOS /Applications and ~/Applications. An explicit
  --chrome is still used as given.
- Hand Chrome a real file URI (Path.as_uri()): "file://" + abspath gave
  file://C:\... on Windows and broke on a '#' in the path everywhere.
- Decode Chrome's stderr as UTF-8 with replacement. With the locale
  codec, a decode error on Windows left r.stderr as None, and the
  failure branch raised AttributeError instead of skipping the PDF.
- Regenerate the five CHECKSUMS.txt files with `acr.py sync-check
  --write`: the test_pdf_windows.py entry was out of canonical order, so
  sync-check reported drift in all four mirrors.

The new ChromeLookup tests patch sys.platform, PATH, the install check
and the Chrome process, so the lookup for each platform runs on every
OS. The macOS, Windows and URI cases fail on main.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

* fix(report): stop Chrome once the PDF is written

Found while checking the macOS lookup live: headless Chrome 154 on macOS
writes the PDF in about 2 seconds and then never exits. Its profile
keep-alives go to zero and the profile unloads, but the browser process
stays up under every flag set tried (extensions, component updates,
background networking, mock keychain, Puppeteer's defaults). So
`acr.py pdf` sat for the full 150 s timeout and then said "PDF skipped,
HTML is canonical (chrome timed out)" with a finished report.pdf on
disk.

- Run Chrome with Popen and poll. Once the printed file is a whole PDF
  (%PDF- head, %%EOF trailer), give Chrome CHROME_EXIT_GRACE_S (5 s) to
  exit by itself, as it does on Windows and Linux, then terminate it.
  CHROME_TIMEOUT_S (150 s) still bounds the whole print.
- Print into the private .chrome-profile and move the file to
  report.pdf only when it is whole, so a failed or partial print never
  replaces the last good PDF and a stale one is never reported as new.
- Send stderr to an anonymous temp file instead of a pipe (a helper
  process can hold a pipe open after Chrome exits) and decode it as
  UTF-8 with replacement.

Live on macOS: `acr.py pdf` now prints `pdf: .../report.pdf` in 7 s
(the report's 898 KB PDF), against 150 s and a skip before. New fake
Popen tests cover a Chrome that keeps running after printing, a failed
print that keeps the previous PDF, and one that never prints.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

* ci(report): prove the new Chrome handling on Windows Python 3.9 and 3.13

A one-off native run for this PR's new commits: the default lookup and
the stop-once-printed loop now drive the real Chrome in
test_pdf_windows.py. Adds a Python 3.9/3.13 matrix and -v output. The
workflow itself is removed again before merge.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

* ci(report): leave the agent-cost-report PDF Windows workflow out of this fix

The workflow did its job on this branch: a native windows-2022 run on
Python 3.9 and 3.13 drove the real Chrome through the default lookup and
the new stop-once-printed loop in all five copies (run 37269475239). It
does not ship with the fix, for the same reasons as #4400's:

- It is one workflow per bug; #4400's sibling was left out too.
- It re-runs one test file over five byte-identical copies. Mirror drift
  (like this PR's out-of-order CHECKSUMS.txt entry) is what
  `acr.py sync-check` catches, and no workflow runs that.

Whether the Python skill gets CI at all, and in what shape, is a
follow-up decision for the owner. test_pdf_windows.py keeps its
ACR_EXPECT_WINDOWS_CHROME hook for that.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(context): pair closing tag after opening tag (#4425)

* fix(context): pair closing tag after opening tag

* fix(context): pair the context tags through one helper at every site

The stray-closing-tag bug fixed here for injectContextIntoMarkdownFile was
copied in four more places. The worst was replaceTaggedContent, the runtime
writer behind the folder CLAUDE.md files and AGENTS.md: there the copied text
grew on every refresh. `claude-mem generate` and the Codex and OpenCode
AGENTS.md cleanups had the same pairing.

findContextBlockRange() takes the first closing tag after an opening tag, and
the opening tag nearest to it, so a dangling opening tag earlier in the file
can't swallow the user's text either. The CLI writer now calls
replaceTaggedContent instead of carrying its own copy, and the Codex cleanup
takes its path as a parameter so it can be tested.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Co-authored-by: agammann <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(report): retain UTF-8 transcript and rule evidence on Windows (#4401)

* fix(report): preserve UTF-8 transcript and rule evidence

Signed-off-by: Rudy Celekli <[email protected]>

* Use the native behavior scanner return contract in encoding regression

Signed-off-by: Rudy Celekli <[email protected]>

* test(report): cover supported Windows Python and Codex encoding

Signed-off-by: Rudy Celekli <[email protected]>

* fix(report): name the encoding at every remaining text read and write

The same locale-codec defect as the five transcript and rule reads this
PR fixes remained at sites #4250 did not list. Two break on the
reporter's own locale:

- rules.py seed_rules read the bundled rules.json, which holds an em
  dash, with the locale codec. Under cp936 every period rollup exits 1
  ("'gbk' codec can't decode byte 0x94"); under cp1252 the rule names
  are mojibake.
- wins.py decoded `git` and `gh` output with the locale codec. gh
  prints UTF-8 and merged-PR titles often contain an em dash. On Windows
  the decode error happens in a reader thread, so r.stdout came back as
  None and the GitHub wins were silently empty but reported "ok". These
  now decode as UTF-8 with errors="replace".

Writes that crashed on cp1252: line-items.csv (titles come from prompts,
so emoji, arrows and CJK are normal) and the behavior-sample sheet,
whose own header has a "→".

Files a person or another tool hands us are read as utf-8-sig, so a
Windows editor's BOM no longer breaks them: `review --apply` (json.load
rejects a BOM, and per SKILL.md the reviewer edits titles in that
file), --precision, --prices, and house rule *.md files (where a BOM
hid a HARD header on line 1).

Every other text open now names UTF-8 too, so the rule is uniform and
can be guarded: acr.py collect, devices, prices.write, the rollup
outputs and inputs, sample, and sync, which also writes CHECKSUMS.txt
with LF on every OS.

Tests that run on every OS (TranscriptEncoding stays Windows-only):
- an AST guard: every text-mode open() and every text=True call passes
  encoding=. It lists 32 sites on main.
- review --apply with a reviewed file saved with a BOM, keeping a
  non-ASCII title. It fails on main with "Unexpected UTF-8 BOM".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(windsurf): inherit workspace directory in installed hooks (#4446)

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(gemini): rotate refused keys reported as HTTP 400 (#4450)

* fix(gemini): rotate refused keys reported as HTTP 400

Signed-off-by: Rudy Celekli <[email protected]>

* fix(server): classify Gemini 400 invalid-key refusals as auth_invalid

The worker now reads Google's HTTP 400 API_KEY_INVALID answer as a refused
credential. The self-hosted server's classifier still labeled the same answer
unrecoverable, which the classifier parity test says must not drift. Both
kinds are terminal on the server, so only the failed job's label and message
change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(tool-uses): read case-variant project keys consistently (#4442)

* fix(tool-uses): read case-variant project keys consistently

Signed-off-by: Rudy Celekli <[email protected]>

* perf(tool-uses): index case-insensitive project reads

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(openclaw): bracket IPv6 worker addresses in URLs (#4452)

* fix(openclaw): bracket IPv6 worker addresses in URLs

Signed-off-by: Rudy Celekli <[email protected]>

* test(openclaw): skip IPv6 cases when loopback …
thedotmack added a commit that referenced this pull request Oct 12, 2026
…4705)

* fix: stop double-encoding tool payloads in observation prompts

ingestObservation stores tool_input/tool_response as JSON text, but both

providers wrapped them in a second JSON.stringify before

buildObservationPrompt. The parse inside buildObservationPrompt then

returned the inner JSON text as a string, and truncateObservationField

re-escaped it, so every observer prompt carried the payload as a

single-line escaped string ({\"file_path\":...}, \\n) instead of

readable JSON.

Cost: 5-11% more prompt tokens per observation for the same content,

a 16k-char truncation budget partly spent on escape characters, and an

observer model reading escaped soup.

Pass the stored JSON text through untouched and embed string values raw

in truncateObservationField, which also makes the prompt builder safe

against double-encoded or plain-text payloads from other producers.

* fix: continue Codex transcripts after archival

* fix: retain partial JSONL across Codex archival

* fix: recognize custom Codex schemas during archival

* warn(session): report pending buffer counts during teardown (#4614)

* fix(installer): select installed agents before offering Claude Code

Preselect detected agents and ask to install Claude Code only if the user selects it. Keep Claude Code as the fallback when no supported agent is detected.

* fix(integrations): close DSH dependency graph and preserve profile cleanup

Bundle the pinned pure SDK helpers with provenance and retained licenses so Bun installs do not resolve unpublished host peer packages. Keep DSH profile ownership recoverable and uninstall the native plugin before removing its package files.

Validate the standalone host contract, successful profile add/remove, failure rollback, and configured watch preservation.

* test(integrations): isolate DSH CLI fixtures from release builds

Run profile commands in a fresh process with a temporary data directory and package fixture. This makes the add/remove and rollback tests independent of generated release output and module-level path caches.

* perf(observer): send session_id and trace on OpenRouter requests (#4418)

Observer requests that reach OpenRouter (openrouter.ai, or the cmem.ai
gateway, which spreads the client body into its upstream request) now carry:

- session_id: a one-way SHA-256 of the observed session's id, stable for the
  whole Claude Code session. OpenRouter uses it as the sticky-routing key, so
  a session stays on the provider that holds its prompt cache. Broadcast maps
  it to PostHog's $ai_session_id.
- trace.trace_id: a random UUID per observer generation, minted in
  openObserverGeneration, so it changes whenever the conversation is
  recycled or restarted ($ai_trace_id).
- trace.trace_name 'claude-mem observer', trace.generation_name the request
  kind (init, observation, summary, field_compression, telegram_wrapup;
  $ai_span_name) and trace.claude_mem_version, the build-stamped plugin
  version (metadata_claude_mem_version).

The session id is derived, not stored, because the ActiveSession object
does not live as long as the session: an idle generator drops it after three
minutes and the next tool call builds a new one. No user field is sent; the
gateway sets it server-side. Custom base URLs behind the OpenRouter provider
and the openai-compatible presets get neither field.


Claude-Session: https://claude.ai/code/session_011rgzkjwPRzo2YH57oEFpaP

Co-authored-by: Claude Opus 5.5 <[email protected]>

* perf(observer): open init and continuation prompts with the same fixed instructions (#4415)

* perf(observer): open init and continuation prompts with the same fixed instructions

A provider prompt cache (OpenRouter, the cmem.ai gateway) hits only on a
byte-identical prefix. The init prompt put the per-generation
session-start context, whose first line is "# [project] recent context,
<date time>", right after system_identity and ahead of ~6.9k chars
(~1.7k tokens) of fixed instructions. The continuation prompt opened
with its greeting and that same context. No two sessions shared more
than system_identity, and an init and a continuation shared nothing.

Both prompts now open with one block that depends on the mode alone:
system_identity, observer_role, spatial_awareness, recording_focus,
skip_guidance and the observation schema. The prior context, the
user's request, the continuation greeting and continuation_instruction
follow it, and the MEMORY PROCESSING header stays last. Every piece of
text is unchanged; only its position moved. For the code mode the
shared start of two sessions' system messages grows from 422 chars
(init vs init) and 0 (init vs continuation) to ~7.26k chars.

The Claude SDK and Codex paths use the same builders, so their first
user message opens with the same block. Nothing reads the prompt's
order: the request block is found by regex and history pruning keys on
<user_request>.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011rgzkjwPRzo2YH57oEFpaP

* fix(modes): point continuation_instruction at the schema above it

The previous commit moved the observation schema into the fixed block
that now opens every continuation prompt, so continuation_instruction
follows the schema instead of preceding it. Its "using the XML
structure below" now reads "above" in all 33 modes that carry it:
code, law-study, email-investigation, meme-tokens and the 29 code
language variants, which reuse the English sentence and append a
LANGUAGE REQUIREMENTS line. Nothing else in those files changes.

The other position words in the mode prompts and in src/sdk/prompts.ts
still point the right way and stay as they are: the footer's "XML
structure above" and output_format_header's "this XML structure" sit
inside the schema next to the XML they name; "The context above" in
the prior-context wrapper refers to the block directly above it; the
observation prompt's "block above" and the summary prompt's "XML
structure above" belong to prompts this change does not reorder; and
"earlier in this session", "prior messages in this conversation" and
"previous reply" refer to time, not position.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011rgzkjwPRzo2YH57oEFpaP

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>

* chore: bump version to 13.30.0

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011rgzkjwPRzo2YH57oEFpaP

* docs: update CHANGELOG.md for v13.30.0

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011rgzkjwPRzo2YH57oEFpaP

* docs(version-bump): the agent publishes to npm with the monthly token (#4371)

The "human handoff" npm step was obsolete. Agents publish with a 30-day
granular token in the maintainer's ~/.npmrc. When it expires, open the npm
new-token page and ~/.npmrc for the maintainer instead of hunting backups or
waiting on the npm-publish workflow, whose NPM_TOKEN secret has failed every
tag since v13.26.1.


Claude-Session: https://claude.ai/code/session_013fww8bJwhSZFgYhfXs6GZm

Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(hooks): skip timeline injection on Claude Code resume (#4423)

* chore: bump version to 13.30.1

* docs: update CHANGELOG.md for v13.30.1

* perf(session-start): newest-N per project key, local-first context (#4427)

SessionStart read every observation and summary of the project family
(~21.7k rows / 63 MB on a 1.2 GB db) and sorted them to keep 50, because
`project IN (...) OR merged_into_project IN (...)` cannot stop early. Cold
pages made that 0.8-1.7 s per session start.

- v63: (key COLLATE NOCASE, created_at_epoch DESC) indexes on observations
  and session_summaries for project and merged_into_project.
- queryObservationsNewest / querySummariesMulti take the newest N per
  (column, key) and keep the newest N of the union. Same rows, same order
  (verified on a real 1.2 GB db); 3.8 ms instead of 0.05-1.7 s.
- The worker no longer waits on a sync pull before rendering SessionStart
  context; it only nudges one in the background.
- Precomputed SessionStart context is servable with cloud sync on. The local
  db is the source of truth and every op sync applies invalidates the files,
  so the files no longer wait on a Realtime channel the hub may not offer.
- cowork hook: no cmem.ai context read (SessionStart or agent prompts) on a
  machine with a local claude-mem install.


Claude-Session: https://claude.ai/code/session_011rgzkjwPRzo2YH57oEFpaP

Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(sync): preserve Retry-After minimum after jitter (#4383)

* fix(sync): preserve hub retry minimum after jitter

Signed-off-by: Rudy Celekli <[email protected]>

* Rebuild shipped source maps with checkout-local dependencies

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(logs): stop tail reads at the existing byte limit (#4393)

* fix(logs): stop tail reads at the existing byte limit

Signed-off-by: Rudy Celekli <[email protected]>

* build: regenerate portable worker source maps

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(sse): remove clients when Bun closes their socket (#4394)

* fix(sse): remove clients when Bun closes their socket

Signed-off-by: Rudy Celekli <[email protected]>

* build: regenerate portable worker source maps

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(viewer): release loading after a failed pagination request (#4387)

* fix(viewer): release pagination loading after a failed page

Signed-off-by: Rudy Celekli <[email protected]>

* fix(viewer): retain successful pages and expose manual recovery

Signed-off-by: Rudy Celekli <[email protected]>

* build(viewer): ship pagination recovery with current dependencies

Signed-off-by: Rudy Celekli <[email protected]>

* fix(viewer): scope pagination failures to the active feed

Signed-off-by: Rudy Celekli <[email protected]>

* build: refresh viewer bundle for scoped failure handling

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(worker): preserve observation context during field compression (#4403)

* fix(worker): freeze observation context before field compression

Signed-off-by: Rudy Celekli <[email protected]>

* build: ship observation compression context correction

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(smart-read): include generator functions in native outlines (#4419)

* fix(parser): retain JavaScript and TypeScript generator declarations

Signed-off-by: Rudy Celekli <[email protected]>

* build: refresh generator-aware smart outline MCP artifact

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(smart-read): preserve lexical ownership of outline symbols (#4406)

* fix(smart-read): assign symbols to their nearest lexical container

Signed-off-by: Rudy Celekli <[email protected]>

* build: ship corrected smart-outline symbol ownership

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(smart-read): retain complete multiline imports in outlines (#4409)

* fix(smart-read): preserve complete import capture ranges

Signed-off-by: Rudy Celekli <[email protected]>

* build: regenerate smart-read import capture bundle

Signed-off-by: Rudy Celekli <[email protected]>

* fix(smart-read): keep each outline import to one bounded line

A multiline import capture now prints as one line: the captured lines are
trimmed and joined with spaces, then capped at 200 characters (the
signature budget), keeping the first 140 and the last 55 so the module
source survives. Go `import ( … )` groups, Ruby calls with `do … end`
blocks and SCSS `@include { … }` are single captures that can span a whole
file; joined with newlines they broke the outline layout and could print a
spec file in full as its first "import". CRLF carriage returns are trimmed
too.

Tests cover the joined multiline import, CRLF, the 200-char cap, Go,
Ruby (`do … end` and a file-wide RSpec block) and SCSS; all seven fail
on the previous head and pass now.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(installer): report host download failures and recover selection

* feat: add iFlytek Spark OpenAI-compatible preset (#4379)

* feat: add iFlytek Spark OpenAI-compatible preset

Add an iflytek preset for iFlytek's Astron MaaS platform, defaulting to
the pay-as-you-go endpoint and spark-x2.5. Token Plan keys only work on
the Token Plan endpoint, which the docs show as a base URL override.

Signed-off-by: FenjuFu <[email protected]>

* feat(viewer): show the Token Plan base URL hint for the iFlytek preset

Signed-off-by: FenjuFu <[email protected]>

---------

Signed-off-by: FenjuFu <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(parser): omit array entries that decode to whitespace (#4397)

* fix(parser): omit decoded empty array entries

Signed-off-by: Rudy Celekli <[email protected]>

* build: ship decoded empty array fix

Signed-off-by: Rudy Celekli <[email protected]>

* build: keep bundled source maps portable

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(stream): release SSE reader when cancellation rejects (#4382)

* fix(stream): release SSE reader lock when cancellation fails

Signed-off-by: Rudy Celekli <[email protected]>

* Rebuild shipped source maps with checkout-local dependencies

Signed-off-by: Rudy Celekli <[email protected]>

* fix(stream): read non-streamed provider bodies with the shared byte-stream reader

responseChunks in streamed-chat-completion.ts was a copy of sse-reader's
iterateByteStream loop with the same bug: when reader.cancel() rejects, which
it always does on an errored body, releaseLock() was skipped. Every send with
liveness null (the cmem gateway, endpoints that refused streaming) reads its
body through responseChunks, so that path kept the bug the reader fix closed.

Export the fixed iterateByteStream and delegate to it, so there is one
implementation. The new test sends a non-streamed request whose JSON body
breaks off mid-read and fails before this change (the body stays locked).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(search): keep FTS capability probes connection-local (#4385)

* fix(search): keep FTS capability probes connection-local

Signed-off-by: Rudy Celekli <[email protected]>

* Rebuild shipped source maps with checkout-local dependencies

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(integrations): verify current DSH profiles and transcript format

* perf(sqlite): covering indexes for projectReadKeys merged-into lookups (#4429)

projectReadKeys runs on every SessionStart render (context cache). Its
`SELECT project ... WHERE merged_into_project COLLATE NOCASE IN (...)`
lookups used the single-column v55 index and then loaded every merged row
from the table to read `project`: 7,499 pages for 31 keys on a 1.2 GB db,
seen in worker stack samples as ~0.9 s on the main thread when cold.

v64 adds (merged_into_project COLLATE NOCASE, project) on observations and
session_summaries. Same keys, 355 pages, 9 ms.


Claude-Session: https://claude.ai/code/session_011rgzkjwPRzo2YH57oEFpaP

Co-authored-by: Claude Opus 5.5 <[email protected]>

* chore: bump version to 13.31.0

* docs: update CHANGELOG.md for v13.31.0

* fix(hooks): skip the pid-file probe once /api/health answered (#4249) (#4426)

An unparseable worker.pid made a healthy worker read as down and got the file deleted.

Co-authored-by: Cassian433 <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(search): finish partial FTS index initialization (#4381)

* fix(search): recover incomplete FTS index setup atomically

Signed-off-by: Rudy Celekli <[email protected]>

* Rebuild shipped source maps with checkout-local dependencies

Signed-off-by: Rudy Celekli <[email protected]>

* fix(fts): reserve writer and recheck missing-index ownership

Signed-off-by: Rudy Celekli <[email protected]>

* Rebuild shipped worker and SQLite artifacts for owned FTS initialization

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(viewer): filter multiline logs with their record (#4417)

* fix(viewer): keep multiline logs with their filtered record

Signed-off-by: Rudy Celekli <[email protected]>

* fix(viewer): hide unknown log-tail fragments under narrower filters

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(pi): accept duplicate anchors and recover after private turns

* fix(search): honor ascending file-summary pagination order (#4386)

* fix(search): honor ascending file-summary pagination order

Signed-off-by: Rudy Celekli <[email protected]>

* Rebuild shipped source maps with checkout-local dependencies

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(parser): retain notes-only summaries and show notes in the viewer (#4388)

* fix(parser): retain summaries containing only notes

Signed-off-by: Rudy Celekli <[email protected]>

* build: ship notes-only summary parser fix

Signed-off-by: Rudy Celekli <[email protected]>

* build: keep bundled source maps portable

Signed-off-by: Rudy Celekli <[email protected]>

* fix(context): preserve summary notes through next-session rendering

Signed-off-by: Rudy Celekli <[email protected]>

* build: include summary notes in delivered context bundles

Signed-off-by: Rudy Celekli <[email protected]>

* fix(viewer): include existing notes in paginated and live summary cards

Signed-off-by: Rudy Celekli <[email protected]>

* build: include summary notes in viewer and worker artifacts

Signed-off-by: Rudy Celekli <[email protected]>

* build(viewer): preserve deployed dependency versions in notes rendering

Signed-off-by: Rudy Celekli <[email protected]>

* revert(context): keep summary notes out of session-start context for now

This reverts commit e40beb620 ("fix(context): preserve summary notes
through next-session rendering").

Rendering Notes in the last-summary block adds tokens to every session's
startup context by default: CLAUDE_MEM_CONTEXT_SHOW_LAST_SUMMARY defaults
to true, and most stored summaries carry notes. Whether that's worth the
tokens is the owner's call, so it stays open as a follow-up decision
(for example, render notes only for notes-only summaries, or behind an
opt-in setting).

The prompt-builder line goes back to asking for one of the five rendered
fields, so the server model isn't steered toward notes-only output that
never reaches session context.

Kept from this PR: notes-only summaries are valid and stored (parser),
and the viewer shows Notes on summary cards.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(smart-search): retain file and directory matches without symbol hits (#4414)

* fix(smart-search): retain matching file paths in results

Signed-off-by: Rudy Celekli <[email protected]>

* build: refresh smart search MCP artifact

Signed-off-by: Rudy Celekli <[email protected]>

* fix(smart-search): reserve symbol file views before path-only results

Signed-off-by: Rudy Celekli <[email protected]>

* fix(smart-search): list path-only matches on one line instead of folding them

Files whose path matches the query but none of whose symbols are shown now
come back in their own `matchingFiles` list, one line each with language,
line count and folded-token estimate, rendered under "Matching Files" after
the folded views. `foldedFiles` and `tokenEstimate` are computed exactly as
before (symbol files only), so a symbol search's folded output is unchanged.

- Only literal substrings qualify: every query part must appear in the
  path. The fuzzy subsequence fallback stays for symbol names; on paths it
  matched most of a large repo for words like "store" or "cli".
- Hits are ranked by matchScore on the file name before capping at
  max_results (every literal hit scores the same on its full path): an
  exact name, then a name containing the query, then a directory hit.
- A query with no searchable parts (" / ") lists nothing instead of every
  file.
- The early return now fires only when both lists are empty, with "No
  matching symbols or files found.".

Measured on src/services/worker (79 files), the previous head grew symbol
searches by up to ~5,200 tokens ("session": 8,278 -> 13,450); this adds
10-266 tokens ("session": 8,544 with 10 listed paths).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* feat(quota): make the quota guard thresholds configurable per window (#4396)

* feat(quota): make the quota guard thresholds configurable per window (#4230)

The utilization thresholds that pause a subscription observer were constants.
They now come from five settings, one per window, whose defaults equal the old
constants, so nothing changes unless a user sets them. A missing or
unparseable value falls back to the default. A provider-side rejection still
stops the observer whatever the threshold, and seven_day_overage_included
keeps having no threshold.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(quota): parse quota thresholds strictly as fractions from 0 to 1

`parseFloat(x) || default` turned '0' into the default and accepted any
number, so '93' (meant as 93%) or '1.5' silently switched a window's
guard off, and a negative value paused the observer at once. Now a blank
value gives the default, a value in [0, 1] is used as-is (0 and 1
included), and anything else gives the default with one CONFIG warning
per key per process.

Tests cover both bounds, the out-of-range, malformed and blank
fallbacks, the warn-once, and thresholds read from settings.json with no
env override. The docs say thresholds are fractions, what an
out-of-range value does, and that the five-hour window still stops at
85% or more within 15 minutes of its reset.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Alex Newman <[email protected]>

* fix(search): honor requested date order in hybrid file results (#4408)

* fix(search): honor explicit date order in hybrid file results

Signed-off-by: Rudy Celekli <[email protected]>

* build(search): ship hybrid file ordering correction

Signed-off-by: Rudy Celekli <[email protected]>

* fix(search): keep tied file-search timestamps in stable ID order

Signed-off-by: Rudy Celekli <[email protected]>

* build: refresh stable file search ordering artifacts

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(report): inherit reviewer in generated review templates (#4392)

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(timeline): select ID-anchor neighbors by capture chronology (#4390)

* fix(timeline): select ID anchor neighbors by capture chronology

Signed-off-by: Rudy Celekli <[email protected]>

* Rebuild shipped source maps with checkout-local dependencies

Signed-off-by: Rudy Celekli <[email protected]>

* Preserve timeline chronology without unnecessary boundary sorts

Signed-off-by: Rudy Celekli <[email protected]>

* Rebuild timeline boundary queries in shipped artifacts

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(cli): skip Qwen sends that omit submitted_prompt entirely (#4215) (#4380)

* fix(cli): skip Qwen sends that omit submitted_prompt entirely (#4215)

#4224 taught session-init to read Qwen's `submitted_prompt` and to skip a
send when the host sends that field empty. One case is left: Qwen's docs
say continuation and ToolResult sends leave `submitted_prompt` out
entirely, so the field arrives absent (`undefined`), the handler falls back
to `prompt`, and an empty `prompt` is stored as `[media prompt]` -- a fake
prompt row once per tool round of an agent loop.

The absence cannot be read as "not a user turn" on every host: Qwen runs the
same `hook claude-code session-init` command as Claude Code, where an empty
prompt is a real image-only submission (#928). So the skip is scoped to
Qwen, recognised from `transcript_path` under `~/.qwen/`, and requires both
an absent field and an empty prompt.

- `isQwenTranscriptPath` matches `.qwen` as a whole path segment, so a
  `~/.qwen-notes/` project directory is not mistaken for the host, and it
  normalises Windows separators.
- Tests cover the Qwen skip, a whitespace-only prompt, a real Qwen text
  submission, the Claude Code #928 image-only turn, and an unidentifiable
  host. The three non-Qwen cases are what fail if the skip is not
  host-scoped.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Signed-off-by: Aniruddha Adak <[email protected]>

* fix(cli): recognise Qwen hooks by QWEN_PROJECT_DIR when transcripts move (#4215)

Qwen keeps transcripts under QWEN_RUNTIME_DIR, advanced.runtimeOutputDir or
QWEN_HOME when one is set, so a `/.qwen/` path check missed users who moved
them and their ToolResult sends kept storing `[media prompt]` rows. Qwen sets
QWEN_PROJECT_DIR for every command hook, so the guard now reads it too.

The check only applies when the event carries a transcript path. The
transcript watcher records prompts without one, from a worker that may have
inherited QWEN_PROJECT_DIR from the Qwen hook that spawned it.

Adds an end-to-end test through the real adapter, session routes and SQLite
(adapted from the reproduction in #4402): a session whose first send has no
submitted_prompt is still created with its prompt, and only the empty
ToolResult send after it is skipped.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Aniruddha Adak <[email protected]>
Co-authored-by: Aniruddha Adak <[email protected]>
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Co-authored-by: Alex Newman <[email protected]>

* fix(viewer): keep context previews scoped to the current selection (#4398)

* fix(viewer): keep context previews scoped to the current selection

Signed-off-by: Rudy Celekli <[email protected]>

* build(viewer): include scoped context preview responses and native browser regression

Signed-off-by: Rudy Celekli <[email protected]>

* build(viewer): retain deployed React and DOMPurify versions

Signed-off-by: Rudy Celekli <[email protected]>

* test(viewer): wait for context preview browser readiness

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(worker): retain the originating prompt on queued summaries (#4407)

* fix(worker): retain the originating prompt on queued summaries

Signed-off-by: Rudy Celekli <[email protected]>

* build(worker): ship queued summary prompt attribution

Signed-off-by: Rudy Celekli <[email protected]>

* fix(worker): preserve active prompt context for older summaries

Signed-off-by: Rudy Celekli <[email protected]>

* build(worker): ship summary response context isolation

Signed-off-by: Rudy Celekli <[email protected]>

* fix(worker): isolate queued observation prompt attribution

Signed-off-by: Rudy Celekli <[email protected]>

* build(worker): ship queued observation context isolation

Signed-off-by: Rudy Celekli <[email protected]>

* fix(cursor): advance an existing observer on accepted prompts

Signed-off-by: Rudy Celekli <[email protected]>

* build(worker): ship Cursor active prompt advancement

Signed-off-by: Rudy Celekli <[email protected]>

* test(worker): tolerate fixed observer instruction prefixes

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(opencode): retain built-in tool file evidence (#4421)

* fix(opencode): retain built-in tool file evidence

Signed-off-by: Rudy Celekli <[email protected]>

* fix(worker): match CLAUDE_MEM_SKIP_TOOLS case-insensitively; send apply_patch as patch

OpenCode's read/write/edit now arrive as Read/Write/Edit, so a user who
listed `read` in CLAUDE_MEM_SKIP_TOOLS would have had those tools captured
again. The skip check now lowercases both the entries and the tool name. The
exact `Skill` telemetry branch is unchanged.

apply_patch's `patchText` is renamed to the `patch` the worker reads instead
of being copied next to it, so the observer is not sent the whole patch twice.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(gemini): attribute observations to the served model (#4391)

* fix(gemini): attribute observations to the served model

Signed-off-by: Rudy Celekli <[email protected]>

* build: ship Gemini served-model attribution

Signed-off-by: Rudy Celekli <[email protected]>

* build: keep bundled source maps portable

Signed-off-by: Rudy Celekli <[email protected]>

* test: restore Gemini fixture state after setup failure

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(worker): persist the model reported by Claude assistant messages (#4405)

* fix(worker): persist the model reported by Claude assistant messages

Signed-off-by: Rudy Celekli <[email protected]>

* fix(worker): keep the requested model when a Claude frame omits it

The assistant frame's model is read off the CLI's stdout at runtime, so a
gateway or proxy behind ANTHROPIC_BASE_URL can leave it out. Passing it
through unguarded stored NULL in observations.generated_by_model and sent
'unknown' as the telemetry model, a regression from main's configured
value. Fall back to the requested model when the frame's model is missing
or empty, the same guard the Gemini, OpenRouter and OpenAI-compatible
providers use for their served model.

The new `absent` fixture kind drops `message.model` from the fake CLI's
assistant frame and expects the requested `haiku`; it fails without the
fallback (generated_by_model was null).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(worker): preserve captured file path whitespace (#4389)

* fix(worker): preserve captured file path whitespace

Signed-off-by: Rudy Celekli <[email protected]>

* build: ship exact captured file paths

Signed-off-by: Rudy Celekli <[email protected]>

* build: keep bundled source maps portable

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(search): preserve commas in explicit file paths (#4395)

* fix(search): preserve commas in explicit file paths

Signed-off-by: Rudy Celekli <[email protected]>

* build: regenerate portable worker source maps

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(worker): retain file evidence from Codex hook patches (#4411)

* fix(worker): retain file evidence from Codex hook patches

Signed-off-by: Rudy Celekli <[email protected]>

* build(worker): ship Codex hook patch file evidence

Signed-off-by: Rudy Celekli <[email protected]>

* test(worker): exercise the verbatim Codex hook fixture

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(viewer): activate the focused session control with Enter and Space (#4413)

* fix(viewer): keep session keyboard actions on their focused control

Signed-off-by: Rudy Celekli <[email protected]>

* test(viewer): give browser startup and rendering separate bounded waits

Signed-off-by: Rudy Celekli <[email protected]>

* test(viewer): wait for a complete browser debugging port

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(observer): preserve outage evidence after an empty store (#4384)

* fix(observer): report store success only after writing memory

Signed-off-by: Rudy Celekli <[email protected]>

* Rebuild shipped source maps with checkout-local dependencies

Signed-off-by: Rudy Celekli <[email protected]>

* test(observer): isolate and remove each response health ledger

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(viewer): protect settings edits while Save is pending (#4420)

* fix(viewer): prevent settings edits from being discarded during save

Signed-off-by: Rudy Celekli <[email protected]>

* test(viewer): require a browser for settings regressions in CI

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(report): export portable dates and UTF-8 HTML on Windows (#4400)

* fix(cost-report): render portable dates and UTF-8 HTML on Windows

Signed-off-by: Rudy Celekli <[email protected]>

* Continuously exercise report rendering on native Windows

Signed-off-by: Rudy Celekli <[email protected]>

* Include adjacent report formatter controls in native Windows gate

Signed-off-by: Rudy Celekli <[email protected]>

* Run native report regressions in every shipped skill distribution

Signed-off-by: Rudy Celekli <[email protected]>

* fix(report): format the measured bucket date without %-d

measure.py labelled the OpenRouter bucket with strftime('%a %-d %b').
%-d is a glibc/BSD extension, and Windows strftime rejects it with
"ValueError: Invalid format string". rollup reaches this through
measure.apply whenever measured.json has status ok, so a Windows rollup
with an OpenRouter key exited before writing any output. Compose the day
the way render.py now does, and pin both labels (week and month, with an
unpadded single-digit day) in test_measure.py.

Also write measured.json with an explicit UTF-8 encoding instead of the
locale codec.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

* fix(report): keep the last report.html when a render fails

render_file opened report.html for writing, which truncates it, before
page() built the HTML. Any failure while building or encoding the page
left a 0-byte report and wiped the last good one: #4250's
UnicodeEncodeError under cp936, or a KeyError from a malformed
report.json (which acr.py catches and turns into an error exit). Build
and encode first, then write the bytes. Binary mode also gives the same
LF output on every OS.

The new test renders a fixture, then renders a copy without line_items
into the same directory; it fails on main, where report.html is left
empty.

The date and encoding hunks in render.py come from the patch @meng823222
posted in #4250.

Co-authored-by: meng823222 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

* test(report): guard %-d on every OS; run the encoding test on Python 3.9

- The Windows child script asserted locale.getencoding(), which exists
  only on Python 3.11+, while SKILL.md supports Python 3.9+. On Windows
  Python 3.9 and 3.10 the test errored instead of testing. Use
  locale.getpreferredencoding(False), as #4401 does.
- The DateFormatting tests only fail on Windows. Add a guard that runs
  everywhere: no strftime flag of the form %-X in scripts/acr.py or
  scripts/acr/*.py. On main it lists measure.py:61,69 and
  render.py:40,47,48,49.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

* ci(report): prove the date and encoding fixes on Windows Python 3.9 and 3.13

A one-off native run for this PR's new commits: the strftime and
locale-API regressions cannot fail on macOS or Linux. Adds a Python
3.9/3.13 matrix and test_measure.py (which needs the tzdata step). The
workflow itself is removed again before merge.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

* ci(report): leave the agent-cost-report Windows workflow out of this fix

The workflow did its job on this branch: a native windows-2022 run on
Python 3.9 and 3.13 passed the date, encoding and failed-render tests
in all five copies (run 37266351986). It does not ship with the fix:

- It is one workflow per bug. #4404 adds a second one for the PDF
  lookup, and #4401's Windows tests would need a third.
- It re-runs a slice of the skill's tests (test_render*.py) over five
  byte-identical copies. Mirror drift is what `acr.py sync-check`
  catches, and no workflow runs that.
- It installs tzdata from PyPI for tests that do not need it.

Whether the Python skill gets CI at all, and in what shape, is a
follow-up decision for the owner.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

* style(report): restore test_measure comment alignment

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: meng823222 <[email protected]>

* test(viewer): wait for recovery DOM commits in headless CI

* fix(openclaw): capture actual completed tool input and output (#4422)

* fix(openclaw): capture completed tool parameters and results

Signed-off-by: Rudy Celekli <[email protected]>

* fix(openclaw): align completion verification and request deadline

Signed-off-by: Rudy Celekli <[email protected]>

* fix(openclaw): keep failed tools' error text and tolerate a missing params

after_tool_call reports a failed call in `error`, which the handler ignored,
so failed tools lost the error text main's persisted tool-result message
carried. It now leads the response, ahead of any partial result, before the
1000-character cap. A host build that omits `params` no longer throws at
`event.params.path`.

The completion fixture now waits for the worker to finish ingesting the
fire-and-forget POST instead of polling for its arrival. The architecture
diagrams line up again, and the docs mention the error text.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(kimi): preserve Read file paths across hooks (#4416)

* fix(kimi): normalize Read paths for file memory

Signed-off-by: Rudy Celekli <[email protected]>

* build(worker): ship Kimi Read path normalization

Signed-off-by: Rudy Celekli <[email protected]>

* fix(kimi): preserve canonical Read paths

Signed-off-by: Rudy Celekli <[email protected]>

* build(worker): ship Kimi canonical path preservation

Signed-off-by: Rudy Celekli <[email protected]>

* fix(kimi): keep kimi-file:// attachment references out of file reads

Kimi's Read accepts a kimi-file:// session attachment reference as `path`,
not only a file. Aliasing it to `file_path` recorded attachment ids as
files_read entries in the file index. Such a reference is now left as is.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(viewer): show producer logs when all components are selected (#4410)

* fix(viewer): include producer logs when all components are selected

Signed-off-by: Rudy Celekli <[email protected]>

* fix(viewer): filter logger components without a chip under an Other chip

The console's component filter knows 9 chips, but the logger writes 45
components. The all-selected special case only showed the other 36 while
every chip was on: deselecting any one chip (say, noisy HTTP) hid SEARCH,
QUEUE, INGEST, CLOUD_SYNC and the rest again.

Map every component without a chip of its own to a new Other chip, and
build the initial and Select-all sets from LOG_COMPONENTS so Other is on by
default and #4417's headerless-line rule (all chips on) still holds. The
browser test now checks that SEARCH, QUEUE and INGEST stay visible with
only Hook off and that Other alone shows exactly those; both fail on the
previous head. Its timeouts now match #4417's (a cold CI Chrome launch
has taken over 10 s).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

* test(viewer): give the log filter browser test a 25 s browser budget

A cold Chrome start plus the viewer bundle can take more than 9 s on Linux
CI; #4387's pagination test, with the same 9 s race, times out there. Raise
the browser race to 25 s and the test timeout to 40 s. The in-page wait for
the logs stays at the original 6 s: it starts once the page is running, so
the cold start doesn't count against it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(worker): use registered memory identity in response metadata (#4399)

* fix(worker): retain registered identity in response metadata

Signed-off-by: Rudy Celekli <[email protected]>

* build: ship registered response identity fix

Signed-off-by: Rudy Celekli <[email protected]>

* test: scope response fixture cleanup around setup

Signed-off-by: Rudy Celekli <[email protected]>

* test: await response iterator cleanup

Signed-off-by: Rudy Celekli <[email protected]>

* test: verify stored summary identity in response metadata

Signed-off-by: Rudy Celekli <[email protected]>

* fix(sqlite): carry deliberate session rekeys into tool receipts

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* test(viewer): give the pagination browser tests time for a cold Chrome start (#4451)

The first case in pagination-recovery.browser.test.ts bundles the viewer
and launches headless Chrome inside a 9 s window (12 s test timeout). On a
busy CI runner that takes about 8.4-9.8 s, so the test fails on most Linux
runs since #4387 landed, on main and on unrelated PRs alike. Locally it
passes in 3-5 s.

Raise the browser window to 25 s and the test timeout to 40 s in both
pagination browser tests, in line with the other viewer browser tests
(20-45 s). The in-page settle deadlines are unchanged, so a real
regression still fails fast inside the page.


Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(viewer): load older rows after the selected category empties (#4412)

* fix(viewer): keep pagination reachable after filtered rows disappear

Signed-off-by: Rudy Celekli <[email protected]>

* fix(viewer): ignore late load-more notifications from a removed sentinel

The empty feed now renders its pagination sentinel on mount, so the
mount observer can deliver its first notification after the initial
page started loading and failed, but before React's effect cleanup
disconnects it. Its closure still says hasMore && !isLoading &&
!loadError, so it cleared the error and fetched again: the feed retried
a failed page on its own and never showed Retry. #4387's
pagination-recovery browser cases failed in 4 of 5 runs on this branch.

Only act on a notification whose sentinel is still connected. React
renders the sentinel only while loading is allowed, so a connected
sentinel means the closure's state is current. Adds a browser case that
delivers the mount observer's notification inside the commit that
removed the sentinel, before the cleanup.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

* test(viewer): give Chrome startup its own budget in the empty-filter test

empty-filter-pagination runs before the pagination browser files in
`bun test tests`, so its first case pays for Chrome's first launch in
the CI job. That launch took 8-11 s in four of the last six CI runs, and
this branch's run finished the `more` case in 8.1 s against a 9 s
budget. The page now reports /ready before its scenario starts, startup
gets 30 s, and each scenario keeps its 9 s, the same pattern the context
preview test uses in #4398. With a simulated 10.5 s startup, the old
file times out and this one passes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

* test(viewer): give the empty-filter browser test 25 s for a cold Chrome start

A cold Chrome start on CI has taken 8-11 s, and this file's 9 s browser
race left no room for it: this branch's run finished the first case in
8.1 s. Raise the browser race to 25 s and the test timeout to 40 s, the
same budget #4451 gives the sibling pagination browser tests. The
in-page 6 s deadlines stay. This replaces the separate startup handshake
from the previous commit with that one shared budget.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(report): find installed Windows Chrome for PDF export (#4404)

* Find normally installed Windows Chrome for report PDF export

Signed-off-by: Rudy Celekli <[email protected]>

* Skip optional native Chrome fixture on hosts without Chrome

Signed-off-by: Rudy Celekli <[email protected]>

* Continuously prove installed Chrome lookup in all Windows skill mirrors

Signed-off-by: Rudy Celekli <[email protected]>

* Require installed Chrome in the native Windows CI proof

Signed-off-by: Rudy Celekli <[email protected]>

* fix(report): find Chrome's macOS app bundle for PDF export

The default lookup only knew `google-chrome` on PATH (plus, from this
PR, the Windows install locations). On a Mac, Chrome is an app bundle
with no PATH shim, so `acr.py pdf` always skipped the PDF there too.

- Factor the default lookup into _default_chrome(): `google-chrome` on
  PATH; on Windows `chrome` on PATH, then Program Files and
  LocalAppData; on macOS /Applications and ~/Applications. An explicit
  --chrome is still used as given.
- Hand Chrome a real file URI (Path.as_uri()): "file://" + abspath gave
  file://C:\... on Windows and broke on a '#' in the path everywhere.
- Decode Chrome's stderr as UTF-8 with replacement. With the locale
  codec, a decode error on Windows left r.stderr as None, and the
  failure branch raised AttributeError instead of skipping the PDF.
- Regenerate the five CHECKSUMS.txt files with `acr.py sync-check
  --write`: the test_pdf_windows.py entry was out of canonical order, so
  sync-check reported drift in all four mirrors.

The new ChromeLookup tests patch sys.platform, PATH, the install check
and the Chrome process, so the lookup for each platform runs on every
OS. The macOS, Windows and URI cases fail on main.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

* fix(report): stop Chrome once the PDF is written

Found while checking the macOS lookup live: headless Chrome 154 on macOS
writes the PDF in about 2 seconds and then never exits. Its profile
keep-alives go to zero and the profile unloads, but the browser process
stays up under every flag set tried (extensions, component updates,
background networking, mock keychain, Puppeteer's defaults). So
`acr.py pdf` sat for the full 150 s timeout and then said "PDF skipped,
HTML is canonical (chrome timed out)" with a finished report.pdf on
disk.

- Run Chrome with Popen and poll. Once the printed file is a whole PDF
  (%PDF- head, %%EOF trailer), give Chrome CHROME_EXIT_GRACE_S (5 s) to
  exit by itself, as it does on Windows and Linux, then terminate it.
  CHROME_TIMEOUT_S (150 s) still bounds the whole print.
- Print into the private .chrome-profile and move the file to
  report.pdf only when it is whole, so a failed or partial print never
  replaces the last good PDF and a stale one is never reported as new.
- Send stderr to an anonymous temp file instead of a pipe (a helper
  process can hold a pipe open after Chrome exits) and decode it as
  UTF-8 with replacement.

Live on macOS: `acr.py pdf` now prints `pdf: .../report.pdf` in 7 s
(the report's 898 KB PDF), against 150 s and a skip before. New fake
Popen tests cover a Chrome that keeps running after printing, a failed
print that keeps the previous PDF, and one that never prints.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

* ci(report): prove the new Chrome handling on Windows Python 3.9 and 3.13

A one-off native run for this PR's new commits: the default lookup and
the stop-once-printed loop now drive the real Chrome in
test_pdf_windows.py. Adds a Python 3.9/3.13 matrix and -v output. The
workflow itself is removed again before merge.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

* ci(report): leave the agent-cost-report PDF Windows workflow out of this fix

The workflow did its job on this branch: a native windows-2022 run on
Python 3.9 and 3.13 drove the real Chrome through the default lookup and
the new stop-once-printed loop in all five copies (run 37269475239). It
does not ship with the fix, for the same reasons as #4400's:

- It is one workflow per bug; #4400's sibling was left out too.
- It re-runs one test file over five byte-identical copies. Mirror drift
  (like this PR's out-of-order CHECKSUMS.txt entry) is what
  `acr.py sync-check` catches, and no workflow runs that.

Whether the Python skill gets CI at all, and in what shape, is a
follow-up decision for the owner. test_pdf_windows.py keeps its
ACR_EXPECT_WINDOWS_CHROME hook for that.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(context): pair closing tag after opening tag (#4425)

* fix(context): pair closing tag after opening tag

* fix(context): pair the context tags through one helper at every site

The stray-closing-tag bug fixed here for injectContextIntoMarkdownFile was
copied in four more places. The worst was replaceTaggedContent, the runtime
writer behind the folder CLAUDE.md files and AGENTS.md: there the copied text
grew on every refresh. `claude-mem generate` and the Codex and OpenCode
AGENTS.md cleanups had the same pairing.

findContextBlockRange() takes the first closing tag after an opening tag, and
the opening tag nearest to it, so a dangling opening tag earlier in the file
can't swallow the user's text either. The CLI writer now calls
replaceTaggedContent instead of carrying its own copy, and the Codex cleanup
takes its path as a parameter so it can be tested.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Co-authored-by: agammann <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(report): retain UTF-8 transcript and rule evidence on Windows (#4401)

* fix(report): preserve UTF-8 transcript and rule evidence

Signed-off-by: Rudy Celekli <[email protected]>

* Use the native behavior scanner return contract in encoding regression

Signed-off-by: Rudy Celekli <[email protected]>

* test(report): cover supported Windows Python and Codex encoding

Signed-off-by: Rudy Celekli <[email protected]>

* fix(report): name the encoding at every remaining text read and write

The same locale-codec defect as the five transcript and rule reads this
PR fixes remained at sites #4250 did not list. Two break on the
reporter's own locale:

- rules.py seed_rules read the bundled rules.json, which holds an em
  dash, with the locale codec. Under cp936 every period rollup exits 1
  ("'gbk' codec can't decode byte 0x94"); under cp1252 the rule names
  are mojibake.
- wins.py decoded `git` and `gh` output with the locale codec. gh
  prints UTF-8 and merged-PR titles often contain an em dash. On Windows
  the decode error happens in a reader thread, so r.stdout came back as
  None and the GitHub wins were silently empty but reported "ok". These
  now decode as UTF-8 with errors="replace".

Writes that crashed on cp1252: line-items.csv (titles come from prompts,
so emoji, arrows and CJK are normal) and the behavior-sample sheet,
whose own header has a "→".

Files a person or another tool hands us are read as utf-8-sig, so a
Windows editor's BOM no longer breaks them: `review --apply` (json.load
rejects a BOM, and per SKILL.md the reviewer edits titles in that
file), --precision, --prices, and house rule *.md files (where a BOM
hid a HARD header on line 1).

Every other text open now names UTF-8 too, so the rule is uniform and
can be guarded: acr.py collect, devices, prices.write, the rollup
outputs and inputs, sample, and sync, which also writes CHECKSUMS.txt
with LF on every OS.

Tests that run on every OS (TranscriptEncoding stays Windows-only):
- an AST guard: every text-mode open() and every text=True call passes
  encoding=. It lists 32 sites on main.
- review --apply with a reviewed file saved with a BOM, keeping a
  non-ASCII title. It fails on main with "Unexpected UTF-8 BOM".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(windsurf): inherit workspace directory in installed hooks (#4446)

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(gemini): rotate refused keys reported as HTTP 400 (#4450)

* fix(gemini): rotate refused keys reported as HTTP 400

Signed-off-by: Rudy Celekli <[email protected]>

* fix(server): classify Gemini 400 invalid-key refusals as auth_invalid

The worker now reads Google's HTTP 400 API_KEY_INVALID answer as a refused
credential. The self-hosted server's classifier still labeled the same answer
unrecoverable, which the classifier parity test says must not drift. Both
kinds are terminal on the server, so only the failed job's label and message
change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(tool-uses): read case-variant project keys consistently (#4442)

* fix(tool-uses): read case-variant project keys consistently

Signed-off-by: Rudy Celekli <[email protected]>

* perf(tool-uses): index case-insensitive project reads

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(openclaw): bracket IPv6 worker addresses in URLs (#4452)

* fix(openclaw): bracket IPv6 worker addresses in URLs

Signed-off-by: Rudy Celekli <[email protected]>

* test(openclaw): skip IPv6 cases when loopback …
thedotmack added a commit that referenced this pull request Oct 12, 2026
* fix: stop double-encoding tool payloads in observation prompts

ingestObservation stores tool_input/tool_response as JSON text, but both

providers wrapped them in a second JSON.stringify before

buildObservationPrompt. The parse inside buildObservationPrompt then

returned the inner JSON text as a string, and truncateObservationField

re-escaped it, so every observer prompt carried the payload as a

single-line escaped string ({\"file_path\":...}, \\n) instead of

readable JSON.

Cost: 5-11% more prompt tokens per observation for the same content,

a 16k-char truncation budget partly spent on escape characters, and an

observer model reading escaped soup.

Pass the stored JSON text through untouched and embed string values raw

in truncateObservationField, which also makes the prompt builder safe

against double-encoded or plain-text payloads from other producers.

* fix: continue Codex transcripts after archival

* fix: retain partial JSONL across Codex archival

* fix: recognize custom Codex schemas during archival

* warn(session): report pending buffer counts during teardown (#4614)

* fix(installer): select installed agents before offering Claude Code

Preselect detected agents and ask to install Claude Code only if the user selects it. Keep Claude Code as the fallback when no supported agent is detected.

* fix(integrations): close DSH dependency graph and preserve profile cleanup

Bundle the pinned pure SDK helpers with provenance and retained licenses so Bun installs do not resolve unpublished host peer packages. Keep DSH profile ownership recoverable and uninstall the native plugin before removing its package files.

Validate the standalone host contract, successful profile add/remove, failure rollback, and configured watch preservation.

* test(integrations): isolate DSH CLI fixtures from release builds

Run profile commands in a fresh process with a temporary data directory and package fixture. This makes the add/remove and rollback tests independent of generated release output and module-level path caches.

* perf(observer): send session_id and trace on OpenRouter requests (#4418)

Observer requests that reach OpenRouter (openrouter.ai, or the cmem.ai
gateway, which spreads the client body into its upstream request) now carry:

- session_id: a one-way SHA-256 of the observed session's id, stable for the
  whole Claude Code session. OpenRouter uses it as the sticky-routing key, so
  a session stays on the provider that holds its prompt cache. Broadcast maps
  it to PostHog's $ai_session_id.
- trace.trace_id: a random UUID per observer generation, minted in
  openObserverGeneration, so it changes whenever the conversation is
  recycled or restarted ($ai_trace_id).
- trace.trace_name 'claude-mem observer', trace.generation_name the request
  kind (init, observation, summary, field_compression, telegram_wrapup;
  $ai_span_name) and trace.claude_mem_version, the build-stamped plugin
  version (metadata_claude_mem_version).

The session id is derived, not stored, because the ActiveSession object
does not live as long as the session: an idle generator drops it after three
minutes and the next tool call builds a new one. No user field is sent; the
gateway sets it server-side. Custom base URLs behind the OpenRouter provider
and the openai-compatible presets get neither field.


Claude-Session: https://claude.ai/code/session_011rgzkjwPRzo2YH57oEFpaP

Co-authored-by: Claude Opus 5.5 <[email protected]>

* perf(observer): open init and continuation prompts with the same fixed instructions (#4415)

* perf(observer): open init and continuation prompts with the same fixed instructions

A provider prompt cache (OpenRouter, the cmem.ai gateway) hits only on a
byte-identical prefix. The init prompt put the per-generation
session-start context, whose first line is "# [project] recent context,
<date time>", right after system_identity and ahead of ~6.9k chars
(~1.7k tokens) of fixed instructions. The continuation prompt opened
with its greeting and that same context. No two sessions shared more
than system_identity, and an init and a continuation shared nothing.

Both prompts now open with one block that depends on the mode alone:
system_identity, observer_role, spatial_awareness, recording_focus,
skip_guidance and the observation schema. The prior context, the
user's request, the continuation greeting and continuation_instruction
follow it, and the MEMORY PROCESSING header stays last. Every piece of
text is unchanged; only its position moved. For the code mode the
shared start of two sessions' system messages grows from 422 chars
(init vs init) and 0 (init vs continuation) to ~7.26k chars.

The Claude SDK and Codex paths use the same builders, so their first
user message opens with the same block. Nothing reads the prompt's
order: the request block is found by regex and history pruning keys on
<user_request>.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011rgzkjwPRzo2YH57oEFpaP

* fix(modes): point continuation_instruction at the schema above it

The previous commit moved the observation schema into the fixed block
that now opens every continuation prompt, so continuation_instruction
follows the schema instead of preceding it. Its "using the XML
structure below" now reads "above" in all 33 modes that carry it:
code, law-study, email-investigation, meme-tokens and the 29 code
language variants, which reuse the English sentence and append a
LANGUAGE REQUIREMENTS line. Nothing else in those files changes.

The other position words in the mode prompts and in src/sdk/prompts.ts
still point the right way and stay as they are: the footer's "XML
structure above" and output_format_header's "this XML structure" sit
inside the schema next to the XML they name; "The context above" in
the prior-context wrapper refers to the block directly above it; the
observation prompt's "block above" and the summary prompt's "XML
structure above" belong to prompts this change does not reorder; and
"earlier in this session", "prior messages in this conversation" and
"previous reply" refer to time, not position.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011rgzkjwPRzo2YH57oEFpaP

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>

* chore: bump version to 13.30.0

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011rgzkjwPRzo2YH57oEFpaP

* docs: update CHANGELOG.md for v13.30.0

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_011rgzkjwPRzo2YH57oEFpaP

* docs(version-bump): the agent publishes to npm with the monthly token (#4371)

The "human handoff" npm step was obsolete. Agents publish with a 30-day
granular token in the maintainer's ~/.npmrc. When it expires, open the npm
new-token page and ~/.npmrc for the maintainer instead of hunting backups or
waiting on the npm-publish workflow, whose NPM_TOKEN secret has failed every
tag since v13.26.1.


Claude-Session: https://claude.ai/code/session_013fww8bJwhSZFgYhfXs6GZm

Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(hooks): skip timeline injection on Claude Code resume (#4423)

* chore: bump version to 13.30.1

* docs: update CHANGELOG.md for v13.30.1

* perf(session-start): newest-N per project key, local-first context (#4427)

SessionStart read every observation and summary of the project family
(~21.7k rows / 63 MB on a 1.2 GB db) and sorted them to keep 50, because
`project IN (...) OR merged_into_project IN (...)` cannot stop early. Cold
pages made that 0.8-1.7 s per session start.

- v63: (key COLLATE NOCASE, created_at_epoch DESC) indexes on observations
  and session_summaries for project and merged_into_project.
- queryObservationsNewest / querySummariesMulti take the newest N per
  (column, key) and keep the newest N of the union. Same rows, same order
  (verified on a real 1.2 GB db); 3.8 ms instead of 0.05-1.7 s.
- The worker no longer waits on a sync pull before rendering SessionStart
  context; it only nudges one in the background.
- Precomputed SessionStart context is servable with cloud sync on. The local
  db is the source of truth and every op sync applies invalidates the files,
  so the files no longer wait on a Realtime channel the hub may not offer.
- cowork hook: no cmem.ai context read (SessionStart or agent prompts) on a
  machine with a local claude-mem install.


Claude-Session: https://claude.ai/code/session_011rgzkjwPRzo2YH57oEFpaP

Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(sync): preserve Retry-After minimum after jitter (#4383)

* fix(sync): preserve hub retry minimum after jitter

Signed-off-by: Rudy Celekli <[email protected]>

* Rebuild shipped source maps with checkout-local dependencies

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(logs): stop tail reads at the existing byte limit (#4393)

* fix(logs): stop tail reads at the existing byte limit

Signed-off-by: Rudy Celekli <[email protected]>

* build: regenerate portable worker source maps

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(sse): remove clients when Bun closes their socket (#4394)

* fix(sse): remove clients when Bun closes their socket

Signed-off-by: Rudy Celekli <[email protected]>

* build: regenerate portable worker source maps

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(viewer): release loading after a failed pagination request (#4387)

* fix(viewer): release pagination loading after a failed page

Signed-off-by: Rudy Celekli <[email protected]>

* fix(viewer): retain successful pages and expose manual recovery

Signed-off-by: Rudy Celekli <[email protected]>

* build(viewer): ship pagination recovery with current dependencies

Signed-off-by: Rudy Celekli <[email protected]>

* fix(viewer): scope pagination failures to the active feed

Signed-off-by: Rudy Celekli <[email protected]>

* build: refresh viewer bundle for scoped failure handling

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(worker): preserve observation context during field compression (#4403)

* fix(worker): freeze observation context before field compression

Signed-off-by: Rudy Celekli <[email protected]>

* build: ship observation compression context correction

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(smart-read): include generator functions in native outlines (#4419)

* fix(parser): retain JavaScript and TypeScript generator declarations

Signed-off-by: Rudy Celekli <[email protected]>

* build: refresh generator-aware smart outline MCP artifact

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(smart-read): preserve lexical ownership of outline symbols (#4406)

* fix(smart-read): assign symbols to their nearest lexical container

Signed-off-by: Rudy Celekli <[email protected]>

* build: ship corrected smart-outline symbol ownership

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(smart-read): retain complete multiline imports in outlines (#4409)

* fix(smart-read): preserve complete import capture ranges

Signed-off-by: Rudy Celekli <[email protected]>

* build: regenerate smart-read import capture bundle

Signed-off-by: Rudy Celekli <[email protected]>

* fix(smart-read): keep each outline import to one bounded line

A multiline import capture now prints as one line: the captured lines are
trimmed and joined with spaces, then capped at 200 characters (the
signature budget), keeping the first 140 and the last 55 so the module
source survives. Go `import ( … )` groups, Ruby calls with `do … end`
blocks and SCSS `@include { … }` are single captures that can span a whole
file; joined with newlines they broke the outline layout and could print a
spec file in full as its first "import". CRLF carriage returns are trimmed
too.

Tests cover the joined multiline import, CRLF, the 200-char cap, Go,
Ruby (`do … end` and a file-wide RSpec block) and SCSS; all seven fail
on the previous head and pass now.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(installer): report host download failures and recover selection

* feat: add iFlytek Spark OpenAI-compatible preset (#4379)

* feat: add iFlytek Spark OpenAI-compatible preset

Add an iflytek preset for iFlytek's Astron MaaS platform, defaulting to
the pay-as-you-go endpoint and spark-x2.5. Token Plan keys only work on
the Token Plan endpoint, which the docs show as a base URL override.

Signed-off-by: FenjuFu <[email protected]>

* feat(viewer): show the Token Plan base URL hint for the iFlytek preset

Signed-off-by: FenjuFu <[email protected]>

---------

Signed-off-by: FenjuFu <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(parser): omit array entries that decode to whitespace (#4397)

* fix(parser): omit decoded empty array entries

Signed-off-by: Rudy Celekli <[email protected]>

* build: ship decoded empty array fix

Signed-off-by: Rudy Celekli <[email protected]>

* build: keep bundled source maps portable

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(stream): release SSE reader when cancellation rejects (#4382)

* fix(stream): release SSE reader lock when cancellation fails

Signed-off-by: Rudy Celekli <[email protected]>

* Rebuild shipped source maps with checkout-local dependencies

Signed-off-by: Rudy Celekli <[email protected]>

* fix(stream): read non-streamed provider bodies with the shared byte-stream reader

responseChunks in streamed-chat-completion.ts was a copy of sse-reader's
iterateByteStream loop with the same bug: when reader.cancel() rejects, which
it always does on an errored body, releaseLock() was skipped. Every send with
liveness null (the cmem gateway, endpoints that refused streaming) reads its
body through responseChunks, so that path kept the bug the reader fix closed.

Export the fixed iterateByteStream and delegate to it, so there is one
implementation. The new test sends a non-streamed request whose JSON body
breaks off mid-read and fails before this change (the body stays locked).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(search): keep FTS capability probes connection-local (#4385)

* fix(search): keep FTS capability probes connection-local

Signed-off-by: Rudy Celekli <[email protected]>

* Rebuild shipped source maps with checkout-local dependencies

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(integrations): verify current DSH profiles and transcript format

* perf(sqlite): covering indexes for projectReadKeys merged-into lookups (#4429)

projectReadKeys runs on every SessionStart render (context cache). Its
`SELECT project ... WHERE merged_into_project COLLATE NOCASE IN (...)`
lookups used the single-column v55 index and then loaded every merged row
from the table to read `project`: 7,499 pages for 31 keys on a 1.2 GB db,
seen in worker stack samples as ~0.9 s on the main thread when cold.

v64 adds (merged_into_project COLLATE NOCASE, project) on observations and
session_summaries. Same keys, 355 pages, 9 ms.


Claude-Session: https://claude.ai/code/session_011rgzkjwPRzo2YH57oEFpaP

Co-authored-by: Claude Opus 5.5 <[email protected]>

* chore: bump version to 13.31.0

* docs: update CHANGELOG.md for v13.31.0

* fix(hooks): skip the pid-file probe once /api/health answered (#4249) (#4426)

An unparseable worker.pid made a healthy worker read as down and got the file deleted.

Co-authored-by: Cassian433 <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(search): finish partial FTS index initialization (#4381)

* fix(search): recover incomplete FTS index setup atomically

Signed-off-by: Rudy Celekli <[email protected]>

* Rebuild shipped source maps with checkout-local dependencies

Signed-off-by: Rudy Celekli <[email protected]>

* fix(fts): reserve writer and recheck missing-index ownership

Signed-off-by: Rudy Celekli <[email protected]>

* Rebuild shipped worker and SQLite artifacts for owned FTS initialization

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(viewer): filter multiline logs with their record (#4417)

* fix(viewer): keep multiline logs with their filtered record

Signed-off-by: Rudy Celekli <[email protected]>

* fix(viewer): hide unknown log-tail fragments under narrower filters

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(pi): accept duplicate anchors and recover after private turns

* fix(search): honor ascending file-summary pagination order (#4386)

* fix(search): honor ascending file-summary pagination order

Signed-off-by: Rudy Celekli <[email protected]>

* Rebuild shipped source maps with checkout-local dependencies

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(parser): retain notes-only summaries and show notes in the viewer (#4388)

* fix(parser): retain summaries containing only notes

Signed-off-by: Rudy Celekli <[email protected]>

* build: ship notes-only summary parser fix

Signed-off-by: Rudy Celekli <[email protected]>

* build: keep bundled source maps portable

Signed-off-by: Rudy Celekli <[email protected]>

* fix(context): preserve summary notes through next-session rendering

Signed-off-by: Rudy Celekli <[email protected]>

* build: include summary notes in delivered context bundles

Signed-off-by: Rudy Celekli <[email protected]>

* fix(viewer): include existing notes in paginated and live summary cards

Signed-off-by: Rudy Celekli <[email protected]>

* build: include summary notes in viewer and worker artifacts

Signed-off-by: Rudy Celekli <[email protected]>

* build(viewer): preserve deployed dependency versions in notes rendering

Signed-off-by: Rudy Celekli <[email protected]>

* revert(context): keep summary notes out of session-start context for now

This reverts commit e40beb620 ("fix(context): preserve summary notes
through next-session rendering").

Rendering Notes in the last-summary block adds tokens to every session's
startup context by default: CLAUDE_MEM_CONTEXT_SHOW_LAST_SUMMARY defaults
to true, and most stored summaries carry notes. Whether that's worth the
tokens is the owner's call, so it stays open as a follow-up decision
(for example, render notes only for notes-only summaries, or behind an
opt-in setting).

The prompt-builder line goes back to asking for one of the five rendered
fields, so the server model isn't steered toward notes-only output that
never reaches session context.

Kept from this PR: notes-only summaries are valid and stored (parser),
and the viewer shows Notes on summary cards.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(smart-search): retain file and directory matches without symbol hits (#4414)

* fix(smart-search): retain matching file paths in results

Signed-off-by: Rudy Celekli <[email protected]>

* build: refresh smart search MCP artifact

Signed-off-by: Rudy Celekli <[email protected]>

* fix(smart-search): reserve symbol file views before path-only results

Signed-off-by: Rudy Celekli <[email protected]>

* fix(smart-search): list path-only matches on one line instead of folding them

Files whose path matches the query but none of whose symbols are shown now
come back in their own `matchingFiles` list, one line each with language,
line count and folded-token estimate, rendered under "Matching Files" after
the folded views. `foldedFiles` and `tokenEstimate` are computed exactly as
before (symbol files only), so a symbol search's folded output is unchanged.

- Only literal substrings qualify: every query part must appear in the
  path. The fuzzy subsequence fallback stays for symbol names; on paths it
  matched most of a large repo for words like "store" or "cli".
- Hits are ranked by matchScore on the file name before capping at
  max_results (every literal hit scores the same on its full path): an
  exact name, then a name containing the query, then a directory hit.
- A query with no searchable parts (" / ") lists nothing instead of every
  file.
- The early return now fires only when both lists are empty, with "No
  matching symbols or files found.".

Measured on src/services/worker (79 files), the previous head grew symbol
searches by up to ~5,200 tokens ("session": 8,278 -> 13,450); this adds
10-266 tokens ("session": 8,544 with 10 listed paths).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* feat(quota): make the quota guard thresholds configurable per window (#4396)

* feat(quota): make the quota guard thresholds configurable per window (#4230)

The utilization thresholds that pause a subscription observer were constants.
They now come from five settings, one per window, whose defaults equal the old
constants, so nothing changes unless a user sets them. A missing or
unparseable value falls back to the default. A provider-side rejection still
stops the observer whatever the threshold, and seven_day_overage_included
keeps having no threshold.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(quota): parse quota thresholds strictly as fractions from 0 to 1

`parseFloat(x) || default` turned '0' into the default and accepted any
number, so '93' (meant as 93%) or '1.5' silently switched a window's
guard off, and a negative value paused the observer at once. Now a blank
value gives the default, a value in [0, 1] is used as-is (0 and 1
included), and anything else gives the default with one CONFIG warning
per key per process.

Tests cover both bounds, the out-of-range, malformed and blank
fallbacks, the warn-once, and thresholds read from settings.json with no
env override. The docs say thresholds are fractions, what an
out-of-range value does, and that the five-hour window still stops at
85% or more within 15 minutes of its reset.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Alex Newman <[email protected]>

* fix(search): honor requested date order in hybrid file results (#4408)

* fix(search): honor explicit date order in hybrid file results

Signed-off-by: Rudy Celekli <[email protected]>

* build(search): ship hybrid file ordering correction

Signed-off-by: Rudy Celekli <[email protected]>

* fix(search): keep tied file-search timestamps in stable ID order

Signed-off-by: Rudy Celekli <[email protected]>

* build: refresh stable file search ordering artifacts

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(report): inherit reviewer in generated review templates (#4392)

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(timeline): select ID-anchor neighbors by capture chronology (#4390)

* fix(timeline): select ID anchor neighbors by capture chronology

Signed-off-by: Rudy Celekli <[email protected]>

* Rebuild shipped source maps with checkout-local dependencies

Signed-off-by: Rudy Celekli <[email protected]>

* Preserve timeline chronology without unnecessary boundary sorts

Signed-off-by: Rudy Celekli <[email protected]>

* Rebuild timeline boundary queries in shipped artifacts

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(cli): skip Qwen sends that omit submitted_prompt entirely (#4215) (#4380)

* fix(cli): skip Qwen sends that omit submitted_prompt entirely (#4215)

#4224 taught session-init to read Qwen's `submitted_prompt` and to skip a
send when the host sends that field empty. One case is left: Qwen's docs
say continuation and ToolResult sends leave `submitted_prompt` out
entirely, so the field arrives absent (`undefined`), the handler falls back
to `prompt`, and an empty `prompt` is stored as `[media prompt]` -- a fake
prompt row once per tool round of an agent loop.

The absence cannot be read as "not a user turn" on every host: Qwen runs the
same `hook claude-code session-init` command as Claude Code, where an empty
prompt is a real image-only submission (#928). So the skip is scoped to
Qwen, recognised from `transcript_path` under `~/.qwen/`, and requires both
an absent field and an empty prompt.

- `isQwenTranscriptPath` matches `.qwen` as a whole path segment, so a
  `~/.qwen-notes/` project directory is not mistaken for the host, and it
  normalises Windows separators.
- Tests cover the Qwen skip, a whitespace-only prompt, a real Qwen text
  submission, the Claude Code #928 image-only turn, and an unidentifiable
  host. The three non-Qwen cases are what fail if the skip is not
  host-scoped.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Signed-off-by: Aniruddha Adak <[email protected]>

* fix(cli): recognise Qwen hooks by QWEN_PROJECT_DIR when transcripts move (#4215)

Qwen keeps transcripts under QWEN_RUNTIME_DIR, advanced.runtimeOutputDir or
QWEN_HOME when one is set, so a `/.qwen/` path check missed users who moved
them and their ToolResult sends kept storing `[media prompt]` rows. Qwen sets
QWEN_PROJECT_DIR for every command hook, so the guard now reads it too.

The check only applies when the event carries a transcript path. The
transcript watcher records prompts without one, from a worker that may have
inherited QWEN_PROJECT_DIR from the Qwen hook that spawned it.

Adds an end-to-end test through the real adapter, session routes and SQLite
(adapted from the reproduction in #4402): a session whose first send has no
submitted_prompt is still created with its prompt, and only the empty
ToolResult send after it is skipped.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Aniruddha Adak <[email protected]>
Co-authored-by: Aniruddha Adak <[email protected]>
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
Co-authored-by: Alex Newman <[email protected]>

* fix(viewer): keep context previews scoped to the current selection (#4398)

* fix(viewer): keep context previews scoped to the current selection

Signed-off-by: Rudy Celekli <[email protected]>

* build(viewer): include scoped context preview responses and native browser regression

Signed-off-by: Rudy Celekli <[email protected]>

* build(viewer): retain deployed React and DOMPurify versions

Signed-off-by: Rudy Celekli <[email protected]>

* test(viewer): wait for context preview browser readiness

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(worker): retain the originating prompt on queued summaries (#4407)

* fix(worker): retain the originating prompt on queued summaries

Signed-off-by: Rudy Celekli <[email protected]>

* build(worker): ship queued summary prompt attribution

Signed-off-by: Rudy Celekli <[email protected]>

* fix(worker): preserve active prompt context for older summaries

Signed-off-by: Rudy Celekli <[email protected]>

* build(worker): ship summary response context isolation

Signed-off-by: Rudy Celekli <[email protected]>

* fix(worker): isolate queued observation prompt attribution

Signed-off-by: Rudy Celekli <[email protected]>

* build(worker): ship queued observation context isolation

Signed-off-by: Rudy Celekli <[email protected]>

* fix(cursor): advance an existing observer on accepted prompts

Signed-off-by: Rudy Celekli <[email protected]>

* build(worker): ship Cursor active prompt advancement

Signed-off-by: Rudy Celekli <[email protected]>

* test(worker): tolerate fixed observer instruction prefixes

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(opencode): retain built-in tool file evidence (#4421)

* fix(opencode): retain built-in tool file evidence

Signed-off-by: Rudy Celekli <[email protected]>

* fix(worker): match CLAUDE_MEM_SKIP_TOOLS case-insensitively; send apply_patch as patch

OpenCode's read/write/edit now arrive as Read/Write/Edit, so a user who
listed `read` in CLAUDE_MEM_SKIP_TOOLS would have had those tools captured
again. The skip check now lowercases both the entries and the tool name. The
exact `Skill` telemetry branch is unchanged.

apply_patch's `patchText` is renamed to the `patch` the worker reads instead
of being copied next to it, so the observer is not sent the whole patch twice.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(gemini): attribute observations to the served model (#4391)

* fix(gemini): attribute observations to the served model

Signed-off-by: Rudy Celekli <[email protected]>

* build: ship Gemini served-model attribution

Signed-off-by: Rudy Celekli <[email protected]>

* build: keep bundled source maps portable

Signed-off-by: Rudy Celekli <[email protected]>

* test: restore Gemini fixture state after setup failure

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(worker): persist the model reported by Claude assistant messages (#4405)

* fix(worker): persist the model reported by Claude assistant messages

Signed-off-by: Rudy Celekli <[email protected]>

* fix(worker): keep the requested model when a Claude frame omits it

The assistant frame's model is read off the CLI's stdout at runtime, so a
gateway or proxy behind ANTHROPIC_BASE_URL can leave it out. Passing it
through unguarded stored NULL in observations.generated_by_model and sent
'unknown' as the telemetry model, a regression from main's configured
value. Fall back to the requested model when the frame's model is missing
or empty, the same guard the Gemini, OpenRouter and OpenAI-compatible
providers use for their served model.

The new `absent` fixture kind drops `message.model` from the fake CLI's
assistant frame and expects the requested `haiku`; it fails without the
fallback (generated_by_model was null).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(worker): preserve captured file path whitespace (#4389)

* fix(worker): preserve captured file path whitespace

Signed-off-by: Rudy Celekli <[email protected]>

* build: ship exact captured file paths

Signed-off-by: Rudy Celekli <[email protected]>

* build: keep bundled source maps portable

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(search): preserve commas in explicit file paths (#4395)

* fix(search): preserve commas in explicit file paths

Signed-off-by: Rudy Celekli <[email protected]>

* build: regenerate portable worker source maps

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(worker): retain file evidence from Codex hook patches (#4411)

* fix(worker): retain file evidence from Codex hook patches

Signed-off-by: Rudy Celekli <[email protected]>

* build(worker): ship Codex hook patch file evidence

Signed-off-by: Rudy Celekli <[email protected]>

* test(worker): exercise the verbatim Codex hook fixture

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(viewer): activate the focused session control with Enter and Space (#4413)

* fix(viewer): keep session keyboard actions on their focused control

Signed-off-by: Rudy Celekli <[email protected]>

* test(viewer): give browser startup and rendering separate bounded waits

Signed-off-by: Rudy Celekli <[email protected]>

* test(viewer): wait for a complete browser debugging port

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(observer): preserve outage evidence after an empty store (#4384)

* fix(observer): report store success only after writing memory

Signed-off-by: Rudy Celekli <[email protected]>

* Rebuild shipped source maps with checkout-local dependencies

Signed-off-by: Rudy Celekli <[email protected]>

* test(observer): isolate and remove each response health ledger

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(viewer): protect settings edits while Save is pending (#4420)

* fix(viewer): prevent settings edits from being discarded during save

Signed-off-by: Rudy Celekli <[email protected]>

* test(viewer): require a browser for settings regressions in CI

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(report): export portable dates and UTF-8 HTML on Windows (#4400)

* fix(cost-report): render portable dates and UTF-8 HTML on Windows

Signed-off-by: Rudy Celekli <[email protected]>

* Continuously exercise report rendering on native Windows

Signed-off-by: Rudy Celekli <[email protected]>

* Include adjacent report formatter controls in native Windows gate

Signed-off-by: Rudy Celekli <[email protected]>

* Run native report regressions in every shipped skill distribution

Signed-off-by: Rudy Celekli <[email protected]>

* fix(report): format the measured bucket date without %-d

measure.py labelled the OpenRouter bucket with strftime('%a %-d %b').
%-d is a glibc/BSD extension, and Windows strftime rejects it with
"ValueError: Invalid format string". rollup reaches this through
measure.apply whenever measured.json has status ok, so a Windows rollup
with an OpenRouter key exited before writing any output. Compose the day
the way render.py now does, and pin both labels (week and month, with an
unpadded single-digit day) in test_measure.py.

Also write measured.json with an explicit UTF-8 encoding instead of the
locale codec.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

* fix(report): keep the last report.html when a render fails

render_file opened report.html for writing, which truncates it, before
page() built the HTML. Any failure while building or encoding the page
left a 0-byte report and wiped the last good one: #4250's
UnicodeEncodeError under cp936, or a KeyError from a malformed
report.json (which acr.py catches and turns into an error exit). Build
and encode first, then write the bytes. Binary mode also gives the same
LF output on every OS.

The new test renders a fixture, then renders a copy without line_items
into the same directory; it fails on main, where report.html is left
empty.

The date and encoding hunks in render.py come from the patch @meng823222
posted in #4250.

Co-authored-by: meng823222 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

* test(report): guard %-d on every OS; run the encoding test on Python 3.9

- The Windows child script asserted locale.getencoding(), which exists
  only on Python 3.11+, while SKILL.md supports Python 3.9+. On Windows
  Python 3.9 and 3.10 the test errored instead of testing. Use
  locale.getpreferredencoding(False), as #4401 does.
- The DateFormatting tests only fail on Windows. Add a guard that runs
  everywhere: no strftime flag of the form %-X in scripts/acr.py or
  scripts/acr/*.py. On main it lists measure.py:61,69 and
  render.py:40,47,48,49.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

* ci(report): prove the date and encoding fixes on Windows Python 3.9 and 3.13

A one-off native run for this PR's new commits: the strftime and
locale-API regressions cannot fail on macOS or Linux. Adds a Python
3.9/3.13 matrix and test_measure.py (which needs the tzdata step). The
workflow itself is removed again before merge.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

* ci(report): leave the agent-cost-report Windows workflow out of this fix

The workflow did its job on this branch: a native windows-2022 run on
Python 3.9 and 3.13 passed the date, encoding and failed-render tests
in all five copies (run 37266351986). It does not ship with the fix:

- It is one workflow per bug. #4404 adds a second one for the PDF
  lookup, and #4401's Windows tests would need a third.
- It re-runs a slice of the skill's tests (test_render*.py) over five
  byte-identical copies. Mirror drift is what `acr.py sync-check`
  catches, and no workflow runs that.
- It installs tzdata from PyPI for tests that do not need it.

Whether the Python skill gets CI at all, and in what shape, is a
follow-up decision for the owner.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

* style(report): restore test_measure comment alignment

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: meng823222 <[email protected]>

* test(viewer): wait for recovery DOM commits in headless CI

* fix(openclaw): capture actual completed tool input and output (#4422)

* fix(openclaw): capture completed tool parameters and results

Signed-off-by: Rudy Celekli <[email protected]>

* fix(openclaw): align completion verification and request deadline

Signed-off-by: Rudy Celekli <[email protected]>

* fix(openclaw): keep failed tools' error text and tolerate a missing params

after_tool_call reports a failed call in `error`, which the handler ignored,
so failed tools lost the error text main's persisted tool-result message
carried. It now leads the response, ahead of any partial result, before the
1000-character cap. A host build that omits `params` no longer throws at
`event.params.path`.

The completion fixture now waits for the worker to finish ingesting the
fire-and-forget POST instead of polling for its arrival. The architecture
diagrams line up again, and the docs mention the error text.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(kimi): preserve Read file paths across hooks (#4416)

* fix(kimi): normalize Read paths for file memory

Signed-off-by: Rudy Celekli <[email protected]>

* build(worker): ship Kimi Read path normalization

Signed-off-by: Rudy Celekli <[email protected]>

* fix(kimi): preserve canonical Read paths

Signed-off-by: Rudy Celekli <[email protected]>

* build(worker): ship Kimi canonical path preservation

Signed-off-by: Rudy Celekli <[email protected]>

* fix(kimi): keep kimi-file:// attachment references out of file reads

Kimi's Read accepts a kimi-file:// session attachment reference as `path`,
not only a file. Aliasing it to `file_path` recorded attachment ids as
files_read entries in the file index. Such a reference is now left as is.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(viewer): show producer logs when all components are selected (#4410)

* fix(viewer): include producer logs when all components are selected

Signed-off-by: Rudy Celekli <[email protected]>

* fix(viewer): filter logger components without a chip under an Other chip

The console's component filter knows 9 chips, but the logger writes 45
components. The all-selected special case only showed the other 36 while
every chip was on: deselecting any one chip (say, noisy HTTP) hid SEARCH,
QUEUE, INGEST, CLOUD_SYNC and the rest again.

Map every component without a chip of its own to a new Other chip, and
build the initial and Select-all sets from LOG_COMPONENTS so Other is on by
default and #4417's headerless-line rule (all chips on) still holds. The
browser test now checks that SEARCH, QUEUE and INGEST stay visible with
only Hook off and that Other alone shows exactly those; both fail on the
previous head. Its timeouts now match #4417's (a cold CI Chrome launch
has taken over 10 s).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

* test(viewer): give the log filter browser test a 25 s browser budget

A cold Chrome start plus the viewer bundle can take more than 9 s on Linux
CI; #4387's pagination test, with the same 9 s race, times out there. Raise
the browser race to 25 s and the test timeout to 40 s. The in-page wait for
the logs stays at the original 6 s: it starts once the page is running, so
the cold start doesn't count against it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(worker): use registered memory identity in response metadata (#4399)

* fix(worker): retain registered identity in response metadata

Signed-off-by: Rudy Celekli <[email protected]>

* build: ship registered response identity fix

Signed-off-by: Rudy Celekli <[email protected]>

* test: scope response fixture cleanup around setup

Signed-off-by: Rudy Celekli <[email protected]>

* test: await response iterator cleanup

Signed-off-by: Rudy Celekli <[email protected]>

* test: verify stored summary identity in response metadata

Signed-off-by: Rudy Celekli <[email protected]>

* fix(sqlite): carry deliberate session rekeys into tool receipts

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* test(viewer): give the pagination browser tests time for a cold Chrome start (#4451)

The first case in pagination-recovery.browser.test.ts bundles the viewer
and launches headless Chrome inside a 9 s window (12 s test timeout). On a
busy CI runner that takes about 8.4-9.8 s, so the test fails on most Linux
runs since #4387 landed, on main and on unrelated PRs alike. Locally it
passes in 3-5 s.

Raise the browser window to 25 s and the test timeout to 40 s in both
pagination browser tests, in line with the other viewer browser tests
(20-45 s). The in-page settle deadlines are unchanged, so a real
regression still fails fast inside the page.


Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(viewer): load older rows after the selected category empties (#4412)

* fix(viewer): keep pagination reachable after filtered rows disappear

Signed-off-by: Rudy Celekli <[email protected]>

* fix(viewer): ignore late load-more notifications from a removed sentinel

The empty feed now renders its pagination sentinel on mount, so the
mount observer can deliver its first notification after the initial
page started loading and failed, but before React's effect cleanup
disconnects it. Its closure still says hasMore && !isLoading &&
!loadError, so it cleared the error and fetched again: the feed retried
a failed page on its own and never showed Retry. #4387's
pagination-recovery browser cases failed in 4 of 5 runs on this branch.

Only act on a notification whose sentinel is still connected. React
renders the sentinel only while loading is allowed, so a connected
sentinel means the closure's state is current. Adds a browser case that
delivers the mount observer's notification inside the commit that
removed the sentinel, before the cleanup.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

* test(viewer): give Chrome startup its own budget in the empty-filter test

empty-filter-pagination runs before the pagination browser files in
`bun test tests`, so its first case pays for Chrome's first launch in
the CI job. That launch took 8-11 s in four of the last six CI runs, and
this branch's run finished the `more` case in 8.1 s against a 9 s
budget. The page now reports /ready before its scenario starts, startup
gets 30 s, and each scenario keeps its 9 s, the same pattern the context
preview test uses in #4398. With a simulated 10.5 s startup, the old
file times out and this one passes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

* test(viewer): give the empty-filter browser test 25 s for a cold Chrome start

A cold Chrome start on CI has taken 8-11 s, and this file's 9 s browser
race left no room for it: this branch's run finished the first case in
8.1 s. Raise the browser race to 25 s and the test timeout to 40 s, the
same budget #4451 gives the sibling pagination browser tests. The
in-page 6 s deadlines stay. This replaces the separate startup handshake
from the previous commit with that one shared budget.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(report): find installed Windows Chrome for PDF export (#4404)

* Find normally installed Windows Chrome for report PDF export

Signed-off-by: Rudy Celekli <[email protected]>

* Skip optional native Chrome fixture on hosts without Chrome

Signed-off-by: Rudy Celekli <[email protected]>

* Continuously prove installed Chrome lookup in all Windows skill mirrors

Signed-off-by: Rudy Celekli <[email protected]>

* Require installed Chrome in the native Windows CI proof

Signed-off-by: Rudy Celekli <[email protected]>

* fix(report): find Chrome's macOS app bundle for PDF export

The default lookup only knew `google-chrome` on PATH (plus, from this
PR, the Windows install locations). On a Mac, Chrome is an app bundle
with no PATH shim, so `acr.py pdf` always skipped the PDF there too.

- Factor the default lookup into _default_chrome(): `google-chrome` on
  PATH; on Windows `chrome` on PATH, then Program Files and
  LocalAppData; on macOS /Applications and ~/Applications. An explicit
  --chrome is still used as given.
- Hand Chrome a real file URI (Path.as_uri()): "file://" + abspath gave
  file://C:\... on Windows and broke on a '#' in the path everywhere.
- Decode Chrome's stderr as UTF-8 with replacement. With the locale
  codec, a decode error on Windows left r.stderr as None, and the
  failure branch raised AttributeError instead of skipping the PDF.
- Regenerate the five CHECKSUMS.txt files with `acr.py sync-check
  --write`: the test_pdf_windows.py entry was out of canonical order, so
  sync-check reported drift in all four mirrors.

The new ChromeLookup tests patch sys.platform, PATH, the install check
and the Chrome process, so the lookup for each platform runs on every
OS. The macOS, Windows and URI cases fail on main.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

* fix(report): stop Chrome once the PDF is written

Found while checking the macOS lookup live: headless Chrome 154 on macOS
writes the PDF in about 2 seconds and then never exits. Its profile
keep-alives go to zero and the profile unloads, but the browser process
stays up under every flag set tried (extensions, component updates,
background networking, mock keychain, Puppeteer's defaults). So
`acr.py pdf` sat for the full 150 s timeout and then said "PDF skipped,
HTML is canonical (chrome timed out)" with a finished report.pdf on
disk.

- Run Chrome with Popen and poll. Once the printed file is a whole PDF
  (%PDF- head, %%EOF trailer), give Chrome CHROME_EXIT_GRACE_S (5 s) to
  exit by itself, as it does on Windows and Linux, then terminate it.
  CHROME_TIMEOUT_S (150 s) still bounds the whole print.
- Print into the private .chrome-profile and move the file to
  report.pdf only when it is whole, so a failed or partial print never
  replaces the last good PDF and a stale one is never reported as new.
- Send stderr to an anonymous temp file instead of a pipe (a helper
  process can hold a pipe open after Chrome exits) and decode it as
  UTF-8 with replacement.

Live on macOS: `acr.py pdf` now prints `pdf: .../report.pdf` in 7 s
(the report's 898 KB PDF), against 150 s and a skip before. New fake
Popen tests cover a Chrome that keeps running after printing, a failed
print that keeps the previous PDF, and one that never prints.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

* ci(report): prove the new Chrome handling on Windows Python 3.9 and 3.13

A one-off native run for this PR's new commits: the default lookup and
the stop-once-printed loop now drive the real Chrome in
test_pdf_windows.py. Adds a Python 3.9/3.13 matrix and -v output. The
workflow itself is removed again before merge.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

* ci(report): leave the agent-cost-report PDF Windows workflow out of this fix

The workflow did its job on this branch: a native windows-2022 run on
Python 3.9 and 3.13 drove the real Chrome through the default lookup and
the new stop-once-printed loop in all five copies (run 37269475239). It
does not ship with the fix, for the same reasons as #4400's:

- It is one workflow per bug; #4400's sibling was left out too.
- It re-runs one test file over five byte-identical copies. Mirror drift
  (like this PR's out-of-order CHECKSUMS.txt entry) is what
  `acr.py sync-check` catches, and no workflow runs that.

Whether the Python skill gets CI at all, and in what shape, is a
follow-up decision for the owner. test_pdf_windows.py keeps its
ACR_EXPECT_WINDOWS_CHROME hook for that.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(context): pair closing tag after opening tag (#4425)

* fix(context): pair closing tag after opening tag

* fix(context): pair the context tags through one helper at every site

The stray-closing-tag bug fixed here for injectContextIntoMarkdownFile was
copied in four more places. The worst was replaceTaggedContent, the runtime
writer behind the folder CLAUDE.md files and AGENTS.md: there the copied text
grew on every refresh. `claude-mem generate` and the Codex and OpenCode
AGENTS.md cleanups had the same pairing.

findContextBlockRange() takes the first closing tag after an opening tag, and
the opening tag nearest to it, so a dangling opening tag earlier in the file
can't swallow the user's text either. The CLI writer now calls
replaceTaggedContent instead of carrying its own copy, and the Codex cleanup
takes its path as a parameter so it can be tested.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Co-authored-by: agammann <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(report): retain UTF-8 transcript and rule evidence on Windows (#4401)

* fix(report): preserve UTF-8 transcript and rule evidence

Signed-off-by: Rudy Celekli <[email protected]>

* Use the native behavior scanner return contract in encoding regression

Signed-off-by: Rudy Celekli <[email protected]>

* test(report): cover supported Windows Python and Codex encoding

Signed-off-by: Rudy Celekli <[email protected]>

* fix(report): name the encoding at every remaining text read and write

The same locale-codec defect as the five transcript and rule reads this
PR fixes remained at sites #4250 did not list. Two break on the
reporter's own locale:

- rules.py seed_rules read the bundled rules.json, which holds an em
  dash, with the locale codec. Under cp936 every period rollup exits 1
  ("'gbk' codec can't decode byte 0x94"); under cp1252 the rule names
  are mojibake.
- wins.py decoded `git` and `gh` output with the locale codec. gh
  prints UTF-8 and merged-PR titles often contain an em dash. On Windows
  the decode error happens in a reader thread, so r.stdout came back as
  None and the GitHub wins were silently empty but reported "ok". These
  now decode as UTF-8 with errors="replace".

Writes that crashed on cp1252: line-items.csv (titles come from prompts,
so emoji, arrows and CJK are normal) and the behavior-sample sheet,
whose own header has a "→".

Files a person or another tool hands us are read as utf-8-sig, so a
Windows editor's BOM no longer breaks them: `review --apply` (json.load
rejects a BOM, and per SKILL.md the reviewer edits titles in that
file), --precision, --prices, and house rule *.md files (where a BOM
hid a HARD header on line 1).

Every other text open now names UTF-8 too, so the rule is uniform and
can be guarded: acr.py collect, devices, prices.write, the rollup
outputs and inputs, sample, and sync, which also writes CHECKSUMS.txt
with LF on every OS.

Tests that run on every OS (TranscriptEncoding stays Windows-only):
- an AST guard: every text-mode open() and every text=True call passes
  encoding=. It lists 32 sites on main.
- review --apply with a reviewed file saved with a BOM, keeping a
  non-ASCII title. It fails on main with "Unexpected UTF-8 BOM".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(windsurf): inherit workspace directory in installed hooks (#4446)

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(gemini): rotate refused keys reported as HTTP 400 (#4450)

* fix(gemini): rotate refused keys reported as HTTP 400

Signed-off-by: Rudy Celekli <[email protected]>

* fix(server): classify Gemini 400 invalid-key refusals as auth_invalid

The worker now reads Google's HTTP 400 API_KEY_INVALID answer as a refused
credential. The self-hosted server's classifier still labeled the same answer
unrecoverable, which the classifier parity test says must not drift. Both
kinds are terminal on the server, so only the failed job's label and message
change.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Xfwhy9juusBwHXUBBZzTS9

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(tool-uses): read case-variant project keys consistently (#4442)

* fix(tool-uses): read case-variant project keys consistently

Signed-off-by: Rudy Celekli <[email protected]>

* perf(tool-uses): index case-insensitive project reads

Signed-off-by: Rudy Celekli <[email protected]>

---------

Signed-off-by: Rudy Celekli <[email protected]>
Co-authored-by: Alex Newman <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>

* fix(openclaw): bracket IPv6 worker addresses in URLs (#4452)

* fix(openclaw): bracket IPv6 worker addresses in URLs

Signed-off-by: Rudy Celekli <[email protected]>

* test(openclaw): skip IPv6 cases when loopback binding is …
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.

2 participants