Commit Graph

1054 Commits

Author SHA1 Message Date
Peter Steinberger
4273ca9dbd refactor(sessions): remove file-era transcript runtime (#113233)
* refactor(sessions): keep helper transcripts in memory

* refactor(sessions): remove file-era transcript storage

* test(sessions): use SQLite identity in attempt persistence

* test(codex): isolate legacy transcript fixtures

* fix(sessions): preserve SQLite transcript identity

* fix(sessions): harden transcript lifecycle invariants

* fix(sessions): validate transcript identities

* fix(sessions): close identity compatibility gaps

* fix(sessions): preserve leaf and plugin identities

* fix(sessions): retain dispatch transcript targets

* fix(sessions): preserve active transcript context

* fix(sessions): isolate artifact accounting

* fix(sessions): bound SQLite usage accounting

* fix(sessions): retain bounded latest usage

* fix(sessions): align rebased transcript targets

* test(sessions): align accessor scope fixture

* fix(telegram): derive SQLite transcript identity

* refactor(sessions): remove file-era compaction residue

* chore(sessions): lower max-lines baseline

* fix(sessions): preserve structured transcript identity

* test(sessions): align doctor identity assertions

* fix(sessions): isolate default SDK database

* refactor(sessions): remove dead file-era exports

* fix(sessions): reconcile SQLite transcript identity

* fix(sessions): pass checkpoint identity explicitly

* test(sessions): make entry field probe explicit

* test(sessions): satisfy transcript cleanup lint

* test(sessions): align diagnostics identity proof

* fix(sessions): finish transcript runtime teardown

* fix(sessions): preserve transcript identity invariants

* fix(sessions): harden transcript compatibility edges

* fix(sessions): preserve checkpoint transcript anchors

* fix(sessions): preserve SQLite lifecycle invariants

* fix(sessions): retarget compaction successors

* test(sessions): preserve transcript fixture semantics

* feat(plugin-sdk): add command transcript targets

* fix(sessions): serialize transcript rewrites

* fix(sessions): validate legacy successor identity

* fix(sessions): normalize compaction ownership

* fix(sessions): validate successor identity before adoption

* fix(sessions): preserve plugin transcript ownership

* fix(sessions): carry transcript identity through commands

* fix(sessions): import legacy checkpoint artifacts into SQLite

* fix(sessions): preserve successor transcript ownership

* fix(sessions): align transcript consumers with target identity

* fix(sessions): scope transcript token estimates

* fix(sessions): retain agent identity across lifecycle hooks

* fix(sessions): resolve scoped SQLite targets

* fix(sessions): isolate lifecycle transcript targets

* fix(sessions): validate compaction agent ownership

* fix(sessions): preserve reset and cleanup lifecycle

* fix(sessions): serialize prompt cleanup lifecycle

* fix(sessions): remove stale lock import

* fix(sessions): preserve reset target context

* fix(sessions): fence prompt reload takeover

* fix(sessions): unblock abort and default lifecycle reads

* fix(sessions): validate legacy successor scope

* fix(sessions): reject metadata-only runtime rows

* fix(sessions): propagate custom transcript stores

* fix(sessions): preserve adopted retry targets

* fix(sessions): allow unkeyed usage reads

* fix(sessions): harden runtime target boundaries

* fix(sessions): serialize retry transcript writes

* fix(sessions): bound prompt reload disposal

* fix(sessions): complete retry marker identity

* fix(sessions): keep legacy marker identity minimal

* test(sessions): tighten teardown fixture types

* fix(sessions): preserve compatibility target identity

* test(sessions): persist post-checkpoint boundary turn

* test(sessions): align runtime store mock contracts

* style(sessions): simplify persisted identity guard

* fix(sessions): prefer complete typed targets

* fix(sessions): recover legacy marker targets

* test(sessions): align marker lookup fixture scope

* fix(sessions): validate partial transcript targets

* fix(sessions): reconcile partial transcript identities

* fix(sessions): canonicalize compatibility identities

* test(sessions): cover compatibility aliases

* fix(sessions): adopt legacy successor identity

* fix(sessions): preserve usage read identity

* fix(sessions): preserve partial marker compatibility

* fix(sessions): validate legacy successor mappings

* fix(sessions): reconcile marker store mappings

* fix(sessions): preserve legacy fallback identity

* fix(sessions): harden marker alias resolution

* fix(sessions): prefer verified successor aliases

* fix(sessions): resolve preferred marker aliases

* fix(sessions): serialize cleanup admission

* fix(sessions): align marker lookup scopes

* fix(codex): type marker alias summaries

* style(sessions): satisfy changed lint

* test(sessions): align structured target assertions

* fix(sessions): reconcile latest identity contracts

* fix(sessions): validate transcript identity boundaries

* docs(sessions): explain stable registry keys

* fix(sessions): harden compatibility target round trips

* fix(sessions): port usage identity to split modules

* test(sessions): align subagent transcript identity

* fix(sessions): finish transcript identity migration

* fix(agents): route subagent completion capture through transcript targets

* fix(agents): settle SQLite prompt handoff during cleanup

* chore: shrink max-lines baseline after teardown

* fix(sessions): port teardown across split runtime owners

* fix(sessions): carry transcript targets through split owners

* test(agents): use SQLite compaction target in abort coverage

* chore: retain unrelated max-lines suppressions

* chore: shrink max-lines baseline after main splits

* style(agents): const compaction checkpoint locals

* fix(sessions): harden SQLite teardown boundaries

* test(sessions): use typed metadata in predicate isolation fixture

* test(agents): cover malformed settlement rejections lint-safely

* fix(sessions): close remaining SQLite identity races

* fix(agents): fail closed on incomplete successor targets

* fix(sessions): preserve transcript identity fallbacks

* fix(agents): preserve session-key abort admission

* fix(trajectory): validate incomplete export targets

* test(sessions): drop retired pricing cache imports

* fix(sessions): validate partial transcript identities

* fix(sessions): close transcript identity edge cases

* fix(plugins): reserve retired transcript locator slot

* fix(sessions): scope transcript locks by target

* style(sessions): simplify SDK initialization error

* fix(sessions): preserve initialized transcript state

* fix(codex): verify mirrored history session keys

* fix(sessions): reject stale transcript ownership

* fix(sessions): anchor asynchronous transcript ownership

* fix(sessions): measure active transcript state

* fix(sessions): preserve scoped transcript compaction

* fix(sessions): harden transcript identity and lifecycle

* fix(sessions): resolve scoped command transcript stores

* fix(sessions): make transcript appends failure-atomic

* fix(sessions): enforce scoped transcript ownership

* fix(sessions): reject cross-owner transcript handoffs

* fix(sessions): fence cleanup transcript ownership

* fix(sessions): retire stale write ownership contexts

* fix(sessions): preserve pending session migration state

* fix(sessions): validate migrated transcript ownership

* fix(sessions): validate usage transcript targets

* fix(sessions): clear predecessor transcript metadata

* fix(sessions): align durable session event targets

* fix(sessions): fence late prompt handoffs

* fix(sessions): fence lifecycle transcript fallbacks

* fix(sessions): bound zero-length memory capture

* fix(sessions): preserve transcript teardown ownership

* fix(sessions): reject duplicate cleanup ownership

* fix(sessions): serialize runtime writes with sqlite leases

* fix(sessions): close sqlite teardown concurrency gaps

* fix(sessions): preserve nested lifecycle failures

* fix(sessions): canonicalize sqlite transcript ownership

* fix(sessions): settle disposed prompt handoffs

* fix(sessions): resolve canonical attempt lock targets

* test(sessions): align canonical target fixtures

* test(sessions): retire redundant jsonl parser coverage

* refactor(sessions): split active transcript cursors

* test(memory): retire legacy marker fixture

* fix(sessions): preserve canonical transcript access after rebase

* fix(sessions): fence prompt lease and return transcript targets

* fix(sessions): colocate transcript leases with target store

* fix(sessions): canonicalize transcript lease and worker targets

* fix(sessions): preserve plugin and fork identity markers

* fix(sessions): complete sqlite transcript target migration

* fix(sessions): integrate canonical followup identity

* fix(sessions): preserve bounded transcript topology

* fix(sessions): validate transcript identity boundaries

* fix(context): separate caller and successor targets

* test(sessions): split persistence compatibility coverage

* test(sessions): preserve fixture topology efficiently

* chore(sdk): refresh plugin api baseline

* test(agents): align compaction lock target mocks

* test(sessions): seed malformed transcript fixtures directly

* fix(agents): canonicalize transcript compatibility inputs

* fix(agents): type optional tool result ids

* test(ci): stabilize loaded process timing

* test(tui): wait for collect queue admission
2026-07-27 22:33:24 -04:00
Peter Steinberger
d5e46646f2 refactor(gateway-protocol): derive schema registries from owner fragments (#114817)
* refactor(protocol): share schema owner barrel

* refactor(protocol): extract ordered schema fragments

* refactor(protocol): compose public schema registry

* docs(protocol): document schema fragments

* ci(protocol): guard schema registry structure

* style(protocol): satisfy registry guard lint
2026-07-27 21:08:20 -04:00
Peter Steinberger
a1e0c9ea09 refactor(packages): DM-policy contract suite, dead routes, package folds (#114776)
* test(channels): share DM policy contract suite

* refactor(memory): remove dead host CLI routes

* refactor(acp): use canonical normalization helpers

* refactor(web): fold provider runtime into core

* refactor(packages): remove dead runtime exports

* chore(knip): drop retired ACP entry roots
2026-07-27 20:20:13 -04:00
Peter Steinberger
313daad549 perf(gateway): warm handler families and cache identity avatars (#114754)
* perf(gateway): warm handler families and cache identity avatars

* chore: drop changelog edit (release-generation-owned)

* fix(ci): regenerate protocol models, satisfy knip, absorb sidecar drift

- commit regenerated Swift GatewayModels for the additive cron.list param
- split the avatar data-url cache into assistant-avatar-cache.ts so its
  factory has a production consumer (knip production scan)
- de-export prewarm family names/type; test now drives fake families only
- postReadySidecarCount 2 -> 3: main added a post-ready sidecar in parallel
2026-07-27 19:37:13 -04:00
Peter Steinberger
b5bb29a36e fix(code-mode): preserve direct tools and secure suspended runs (#114778)
Preserve trusted policy-required message delivery and native image/computer tools across Code Mode catalogs and provider transports. Keep preferred Gemini capability metadata during live discovery, escape MCP declaration keywords, and reject suspended-run resumes with missing owner identity. Add before-and-after regressions for each user path. Closes #114753.
2026-07-27 18:47:33 -04:00
Peter Steinberger
7394262cd1 feat: per-model code-mode capability flags with an "auto" master-switch tier (#114695)
* feat(tools): per-model code-mode capability flags and auto master-switch tier

* feat(anthropic): flag claude-sonnet-4-6 as code-mode preferred

* revert(anthropic): drop claude-sonnet-4-6 from the code-mode preferred set

* test(anthropic): type the manifest compat field in the catalog contract test

* fix(anthropic): carry catalog compat onto hand-built forward-compat model rows
2026-07-27 16:47:41 -04:00
Peter Steinberger
9588a10f12 refactor(ai): unify Responses transport factories (#114357)
* refactor(ai): unify Responses transport factories

* style(ai): format Responses transport executor
2026-07-27 12:40:48 -04:00
Onur Solmaz
89c5b02832 revert(openai): remove loopback Codex proxy support (#114616)
Reverting PR from runaway clanker, sorry! Won't happen again!
2026-07-27 23:15:42 +08:00
Peter Steinberger
17ed69e103 fix(agents): preserve prompt caches across tool discovery (#114572) 2026-07-27 09:58:19 -04:00
Onur Solmaz
6f8a67120c feat(openai): support loopback Codex proxies (#114555)
* feat(openai): support loopback Codex proxies

* fix(openai): preserve Codex proxy routes

* fix(openai): enforce canonical Codex proxy path

* fix(openai): support opaque proxy capabilities

* test(openai): isolate proxy capability coverage

* fix(openai): confine proxy capabilities

* test(openai): type proxy image config
2026-07-27 13:31:04 +00:00
Harjoth Khara
92eb942822 fix(ai): safely format circular provider stream errors (#107800)
* fix(ai): terminate Anthropic streams on circular error objects

* test(ai): reject with a plain circular object without Promise.reject

* test(ai): pin Anthropic error-message semantics and drop totality overclaim

* test(ai): assert terminal event type in Anthropic error-message test

* fix(ai): preserve circular provider error details

---------

Co-authored-by: Altay <altay@hey.com>
2026-07-27 16:28:40 +03:00
Peter Steinberger
14d8c2439f feat(ui): offer normally-absent core files instead of flagging them missing (#114559)
* feat(ui): offer normally-absent core files instead of flagging them missing

The Agents core-files editor rendered every unwritten workspace file as a
permanently-badged MISSING tab, so an ordinary workspace looked broken. Absence
is only a fault for required files; SOUL.md, USER.md, and MEMORY.md are normal
to be absent until written.

agents.files.list now marks those entries expectedAbsent, and the editor keeps
them out of the tab strip behind an add picker that creates the file on save.
A missing AGENTS.md still shows as a fault.

* chore(protocol): regenerate Swift gateway models for expectedAbsent

* fix(gateway): carry expectedAbsent through agents.files.get

Clients merge the get response over the listed entry, so a missing-file get
that dropped the flag made a file picked from the add picker re-render as a
MISSING fault. Caught by live Control UI proof, not by the unit tests.
2026-07-27 09:16:10 -04:00
Peter Steinberger
43ff420492 fix(providers): preserve local model discovery and retry ownership (#114582) 2026-07-27 09:14:23 -04:00
qingminlong
a01319b27f fix: account for CJK text in compaction estimates (issue #103930) (#114386)
* fix: account for CJK text in compaction estimates

* fix: share CJK compaction estimator

* fix: format CJK compaction estimator

* fix: make CJK regexes lint-safe

Co-authored-by: qingminlong <qing.minlong@xydigit.com>

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-27 08:51:44 -04:00
Peter Steinberger
1564e86fcf refactor(ai): consolidate Anthropic streaming regression fixtures (#114511) 2026-07-27 08:36:34 -04:00
licheer-zte
97d3d60b51 fix(markdown): unify reasoning tag parsing (#113205)
Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-27 07:48:57 -04:00
Peter Steinberger
91f04499f5 fix(sessions): defer agent self-archive until run completion (#114522) 2026-07-27 07:46:22 -04:00
Peter Steinberger
c6b2ec28c8 refactor: mechanical dedup batch (protocol types, update-cli bridge, talk fallback) (#114432)
* refactor(onboarding): remove search setup barrel

* refactor(plugins): reuse detected package manifest

* test(update): replace global helper bridges

* refactor(talk): remove dead legacy response fallback

* refactor(protocol): derive root types from schema

The maintainer approved broadening the additive schema-backed type surface without a protocol version bump.

* fix(plugins): drop stale package path import

* test(protocol): type dynamic registry lookups

* docs(talk): explain canonical response boundary

* refactor(talk): enforce canonical response input

* fix(protocol): keep root type exports registry-free

* refactor(update): expose helpers through test facades

* fix(protocol): keep result types on leaf schema modules
2026-07-27 06:55:07 -04:00
Peter Steinberger
b8e7f27ff2 feat(ui): let a link's slug settle a shared short-id prefix (#114486)
* feat(ui): let a link's slug settle a shared short-id prefix

Two sessions can share the first block of their uuid, which sent an otherwise
exact link to the disambiguation view even though the slug in that link already
said which session was meant. Capture the slug on short references and use it to
break the tie.

It can only narrow: a slug matching none or several of the tied sessions leaves
the chooser alone, and a reference that already resolves uniquely is untouched.
Generated links stay at their normal length instead of growing a full uuid.

* fix(ui): never settle a slug tie from an incomplete search

A truncated candidate set is an unfinished search, not a tie: an unexamined page
could hold the same short-id prefix under the same slug. Settling there would be
the guess the bounded search exists to avoid, so keep the chooser.
2026-07-27 06:08:51 -04:00
Peter Steinberger
269bc5c89e fix(cli): preserve machine-readable stdout (#113654)
Co-authored-by: 1052326311 <65798732+1052326311@users.noreply.github.com>
2026-07-27 05:44:16 -04:00
Peter Steinberger
51f228f6fe fix(ui): preserve agent-owned session navigation
Add agent ownership to observer digests, scope global observer delivery and reconciliation, and centralize application session selection across navigation and reconnects.

Co-authored-by: xbrxr03 <abrarhabib03@gmail.com>
2026-07-27 05:43:19 -04:00
Peter Steinberger
af552d4bc6 feat(ui): resolve session URLs through the gateway with best-effort slug matching (#114422)
* feat(ui): resolve session URLs through the gateway with best-effort slug matching

Session URLs now resolve a stored board face and a display-name slug through
the gateway instead of guessing from the browser's cached session page.

- An uncached open marks only the in-app navigation, never the shareable href,
  so the chat loader can re-derive the face and replace the URL.
- A cached row settles the lookup locally, keeping navigation off the wire.
- A one-segment reference resolves short id, then literal key, then display-name
  slug; ties reuse the existing disambiguation view.

* refactor(ui): keep slug ties on short disambiguation prefixes

Slug candidates reused the full uuid, which produced 32-character links in the
disambiguation view. uniqueShortIdPrefix already falls back to the full id when
the bounded search was truncated, so reuse it and drop the flag.

* fix(ui): navigate worktree owner links in-app so the face marker survives

The Worktrees owner link was a bare anchor consuming only the shareable href,
so preferenceDerivedFace was a no-op there and an uncached owner always opened
on chat. Match the other session surfaces: keep the clean href and navigate
with the options on plain clicks.

* fix(ui): search the first uuid block so long session references resolve

The gateway matches sessions.list search as a plain substring and stored keys
hold a hyphenated uuid, so any hyphen-stripped reference past the first block
matched nothing and 404'd. This hit disambiguation links, which offer prefixes
longer than eight characters. Send the first block and keep applying the full
prefix per row.

A resolved slug now canonicalizes to that same short reference instead of a
full uuid, so /chat/main/deploy-monitor settles on -6db92d48.

* docs(ui): record why the face marker stays out of shareable hrefs
2026-07-27 04:31:33 -04:00
Peter Steinberger
b461ae6de8 test(model-catalog): cover normalization and routing boundaries (#114384) 2026-07-27 02:56:59 -04:00
Peter Lee
0406e66369 fix(ui): keep stable chat rows in insertion order and only sort live tool/stream items by timestamp (#113266)
* fix(ui): keep stable chat rows in insertion order and only sort live tool/stream items by timestamp

* fix(ui): keep live rows within current turn

* fix(ui): keep current work above queued turns

* fix(ui): keep streamed replies above queued turns

* fix(ui): preserve reconnecting run order

* fix(ui): preserve causal terminal ordering

* fix(ui): bound replay rows to owning turns

* fix(ui): keep question summaries in owning turns

* fix(ui): scope question run ownership to session

* fix(ui): restore reconnecting chat run identity

* fix(ui): remove unused chatItemTimestamp import in chat-thread-build.ts

* fix(ui): correlate question summaries with agent runs

Co-authored-by: Peter Lee <li.xialong@xydigit.com>

* chore(i18n): refresh native source baseline

Co-authored-by: Peter Lee <li.xialong@xydigit.com>

* fix(ui): remove unused chatItemTimestamp export and split tool-stream test file

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-27 02:08:22 -04:00
Peter Steinberger
8b66fc103d feat(ui): durable session board face and dashboards index (#114262)
* feat(ui): durable session board face and dashboards index

Board face lived only in client-side boardSessionViews, capped at 50 entries,
so the preference never followed the user to another device, evicted as
sessions accumulated, and could not be seen as a set.

Persist it as SessionEntry.boardFace, which rides the existing entry_json blob
and so needs no SQLite schema change or version bump. Expose it on the session
list row and add it to the sessions.patch write-scope allowlist alongside label,
pinned, and archived: setting your own view preference is user-level chat
organization, not policy. Unknown patch fields still fail closed to
operator.admin.

Generic navigation now reads the stored face, so the sidebar and session list
open a thread on the face you left it on. boardSessionViews keeps only
activeTabId and reopenDockByTab, which are genuinely per-device.

Add /dashboards listing threads whose preferred face is dashboard. Filtering
runs server-side in filterSessionEntries before pagination, because the client
holds only a capped page and a client-side filter would silently omit
dashboards.

* test(protocol): assert the pre-rename face param is rejected

The gateway-protocol validator test still passed the pre-rename 'face' key,
which the closed schema rejects. Use boardFace, and pin the old name as a
negative case so it cannot silently return.

* chore(protocol): regenerate Swift bindings and docs map for boardFace

Adding boardFace to the sessions schema changes two committed generated
artifacts: the Swift gateway models (pnpm protocol:gen:swift) and the docs map
(pnpm docs:map:gen), which now lists the dashboards index section.
2026-07-27 00:35:34 -04:00
Peter Steinberger
fdfe5125a3 fix(ai): unify Responses stream processing (#114263)
* refactor(ai): unify Responses stream processing

* fix(ai): preserve unindexed output boundaries

* refactor(ai): remove obsolete Responses helpers

* refactor(ai): trim canonical stream surface
2026-07-27 00:28:07 -04:00
Peter Steinberger
1759f4d5e6 refactor(ai): unify OpenAI completions compatibility (#114236)
* refactor(ai): unify OpenAI completions compatibility

* refactor(ai): make cache compat resolution explicit

* fix(ai): keep ModelStudio token field canonical
2026-07-26 22:59:15 -04:00
Peter Steinberger
7846a32757 test(ai): freeze Responses stream processor parity (#114230)
* test(ai): freeze Responses stream processor parity

* test(ai): align parity adapter output type
2026-07-26 22:13:18 -04:00
Peter Steinberger
a348a63cda refactor(ai): preserve abort reasons so restart recovery reads a code (#114219)
* refactor(ai): preserve abort reasons so restart recovery reads a code

* fix(ai): rethrow only coded abort reasons from transports

* test(agents): prove restart abort code reaches the recovery verdict
2026-07-26 21:54:44 -04:00
Jesse Merhi
d7627d6f4c refactor(prompt): use plain inbound context labels and drop system-tag sanitizer (#112000)
* refactor(prompt): plain inbound context labels with a provenance marker

Replaces trust-worded inbound context labels ("(untrusted metadata)",
"(untrusted, for context)") with plain labels plus a fixed provenance
marker suffix appended to every OpenClaw-injected context header.

Detection keys on the marker, not label text, so strippers stay correct
across UI, TUI, replay, /trace segmentation, memory recall, and the Swift
chat preprocessor. Drops sanitizeInboundSystemTags in favor of the marker
boundary plus trusted system-prompt narration.

Renames the untrusted-named plugin SDK context identifiers to
channel-provenance names, keeping deprecated aliases registered for
removal after 2026-09-08.

Adds `openclaw doctor --fix` migrations that rewrite legacy inbound
labels in stored SQLite transcripts and purge legacy envelope-
contaminated LanceDB recall rows.

* fix(ci): resolve gate failures for plain inbound context labels

- doctor sqlite readers: open read-only connections via openNodeSqliteDatabase
  so the Kysely connection-boundary guardrail holds; unexport the now-internal
  transcript snapshot type (Knip unused-export gate).
- compat registry: split the record table into registry-records.ts and
  plugin-sdk-subpath-records.ts. The new compat record pushed registry.ts past
  the 700-line oxlint cap; suppressions are disallowed, so follow the existing
  sibling record-module pattern. Public exports and PluginCompatCode literals
  unchanged.
- acp-runtime test: assert current finalization behavior (newline normalization
  only). The bracket de-fang and System: rewrite it expected were removed with
  sanitizeInboundSystemTags; forged system lines are neutralized at the
  system-event queue, the single chokepoint feeding the System:-per-line render.
- regenerate docs_map and the plugin SDK API baseline manifest.

* fix(prompt): harden inbound context label migration and drop in-band sanitizer

Review follow-ups on the plain-label + provenance-marker change:

- Remove src/security/system-tags.ts. Rewriting inbound text to neutralize
  look-alike `System:`/`[System]` markers corrupted legitimate user text and is
  not a real injection boundary; role separation plus external-content wrapping
  is. Explicit product decision, recorded at the system-event queue.
- Narrow the LanceDB legacy-row purge so it cannot delete benign memories. It
  now requires a complete known legacy sentinel line, a legacy label followed by
  a fenced JSON body, or the complete legacy external-content header. The prior
  predicates matched ordinary prose such as `Notes (untrusted metadata):`, and
  deletion is irreversible.
- Make explicit-empty canonical ChannelStructuredContext win over the deprecated
  alias via a present/absent result instead of collapsing `[]` to undefined.
- Keep `\r?` in the active-memory doctor rule. It is the only rule spanning the
  header's line break, migrated assistant rows skip newline normalization, and
  without it the marked-header replace wins and the body strips to empty. Added
  a CRLF regression test.
- Fix stale comments that described removed behavior, and cover the Swift
  prose-block strip path.

Claude-Session: https://claude.ai/code/session_01WNzsPddQmxy9Y7jKD4wAxH
2026-07-27 11:27:53 +10:00
Peter Steinberger
cca5b14785 feat(ui): path-based session and dashboard URLs (#113883)
* feat(ui): path-based session and dashboard URLs

* docs(ui): document control UI URLs

* fix(ui): finalize session path routing

* feat(ui): anchor session URLs on stable keys

* docs(ui): clarify stable session URL identity

* fix(ui): resolve session prefixes with full prefix and pagination

Query sessions.list with the full supplied prefix instead of an eight-char
truncation, and paginate up to a bounded page count so longer disambiguation
links resolve instead of being reported ambiguous. Zero strict-prefix matches
now fall through to literal-key resolution rather than rendering an empty
ambiguity view.

Also document the ~dot/~dotdot segment escape: peer ids reach session keys
trimmed and lowercased only (src/routing/session-key.ts), so a literal '.' or
'..' segment is reachable and browsers would normalize it away.

* fix(ui): synchronize committed session routes

* test(ui): split native shell host coverage

* fix(ui): thread configured mainKey through session URL builders

Reserved-set disambiguation needs the operator-configured mainKey at runtime, so
thread it from agentsList through every session path builder and the ClickClack
control URL. Unambiguous non-hex single-segment rests now resolve literally while
short-id-shaped rests still fail closed, which restores ClickClack channel
compatibility detection and control-link reconciliation.

Also bound prefix-resolution retries, preserve catalog thread identity, and keep
draft state on ambiguous candidate links.

* fix(ui): repair session URL CI integration

* perf(ui): lazy-load session route resolution

* perf(ui): isolate session prefix resolution

* perf(ui): defer session path parsing

* perf(ui): defer session navigation startup

* fix(ui): preserve first-run and literal session navigation

* fix(ui): satisfy session routing type and export gates

* fix(clickclack): preserve unscoped control link agent

* style(ui): satisfy chat page line limit

* refactor(ui): move chat page helpers to owning modules

* fix(ui): preserve destination session route identity

* fix(ui): preserve agent identity in session routes

* fix(ui): escape dots in literal session path segments

encodeURIComponent leaves periods intact, so a literal key segment like
channel:release.js produced /chat/main/channel/release.js. In-app navigation is
intercepted by the SPA, but a refresh, an external link, or a ClickClack link
would be served as a static asset request and never reach the app.

pathForWorkboardBoard already escapes dots for this reason; mirror it in both the
session URL contract and the ClickClack encoder, route the agent id through the
same segment encoder, and pin the case in both shared vector tables.

* fix(ui): stop bootstrap after teardown race

* refactor(ui): centralize session navigation targets

* fix(ui): consume bootstrap teardown abort

* fix(ui): canonicalize configured main session routes

* fix(ui): preserve distinct session references

* fix(ui): redirect released session query links

* fix(ui): make bootstrap teardown abort-safe
2026-07-26 12:46:04 -04:00
Peter Steinberger
cd5a5ecb4c fix(ui,gateway): make catalog sidebar sections drag-reorderable (#114074)
* fix(ui,gateway): make catalog sidebar sections drag-reorderable

* test(ui): split sidebar section-reordering cases under max-lines

* perf(ui): keep catalog section rendering out of startup bundle
2026-07-26 05:31:33 -04:00
Peter Steinberger
5347285d6b improve(models): source pricing from hosted catalog (#114060)
* feat(model-catalog): serve hosted fallback pricing

* refactor(config): retire client pricing bootstrap settings

* refactor(gateway): delete client pricing refresh runtime

* docs(models): explain hosted catalog pricing

* fix(model-catalog): preserve pricing privacy and aliases

* fix(model-catalog): fingerprint pricing eligibility

* fix(model-catalog): harden pricing endpoint checks

* fix(model-catalog): materialize source-safe pricing aliases

* fix(model-catalog): keep unknown pricing fallbacks safe

* fix(model-catalog): reject zero-only hosted prices

* fix(model-catalog): fail closed without pricing policy metadata

* refactor(utils): extract usage pricing normalization

* fix(model-catalog): rebuild policy-owned pricing namespaces

* test(model-catalog): type publisher cost fixtures

* chore(config): regenerate schema baselines

* fix(utils): keep raw pricing tiers private
2026-07-26 03:48:25 -04:00
yt2102
6bd8e0387c fix(memory): close previous embedding provider before replacement (#113471)
* fix(memory): close previous embedding provider before replacement

* fix(memory): increase embedding worker close grace period for slow hosts

* fix(memory): clear this.provider after close in resetProviderInitializationForRetry

Co-authored-by: Sanjay Santhanam <notifications@github.com>

* fix(memory): serialize embedding provider replacement

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(memory): unify provider transition lifecycle

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(memory): join worker shutdown lifecycle

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(memory): block worker restart during close

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(memory): retain failed provider retirements

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(memory): drain retirements on manager close

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(memory): make worker close joinable

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(memory): preserve sync before provider retirement

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(memory): separate worker exit from disposal errors

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(memory): avoid shutdown admission gap

Co-authored-by: yt2102 <yt2102@qq.com>

* style(memory): format provider lifecycle fix

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(memory): bound embedding worker termination

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(memory): fail closed on fallback initialization errors

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(memory): retry primary after fallback creation failure

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(memory): retain disconnected embedding workers until exit

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(memory): isolate shared fallback transition failures

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(memory): serialize scoped manager retirement

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(memory): retain failed global manager closes

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(memory): serialize manager admission with teardown

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(memory): serialize outer manager lifecycle

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(gateway): close request-scoped embedding providers

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(memory): retire qmd managers before replacement

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(gateway): support synchronous embedding cleanup

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(memory): isolate manager lifecycle scopes

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(cli): close request-scoped embedding providers

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(memory): canonicalize manager lifecycle ownership

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(memory): retry primary after null fallback result

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(gateway): retain failed embedding provider closes

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(gateway): lease closable embedding providers

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(gateway): drain retained embedding providers

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(memory): join lazy fallback teardown

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(gateway): drain embedding providers after HTTP close

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(memory): retain failed qmd candidate cleanup

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(memory): aggregate retained qmd teardown failures

Co-authored-by: yt2102 <yt2102@qq.com>

* refactor(memory): keep qmd lifecycle policy unchanged

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(memory): retain failed worker construction clients

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(gateway): scope local embedding retirement by provider

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(memory): drain provider generations before retirement

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(memory): drain admitted operations before teardown

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(memory): preserve provider identity through vector search

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(memory): lease provider generation through embedding

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(memory): lease provider through index publication

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(memory): keep sync harness hooks optional

Co-authored-by: yt2102 <yt2102@qq.com>

* refactor(memory): own generations in sync lifecycle

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(memory): preserve query runtime across retirement

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(memory): pin FTS-only sync generations

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(memory): retry failed worker construction cleanup

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(memory): drain admitted searches before closing

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(memory): close manager and gateway admission races

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(memory): serialize qmd wrapper replacement

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(memory): serialize failed qmd retirement

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(memory): satisfy qmd lifecycle type and deadcode gates

Co-authored-by: yt2102 <yt2102@qq.com>

* test(memory): type qmd lifecycle doubles

Co-authored-by: yt2102 <yt2102@qq.com>

* style(gateway): clarify created embedding provider

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(memory): drain availability probes before close

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(memory): preserve cleanup ownership without blocking fallback

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(memory): retire lancedb embedding providers

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(memory): preserve generic provider cleanup receiver

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(memory): close lancedb CLI embeddings

Co-authored-by: yt2102 <yt2102@qq.com>

* test(memory): normalize abort rejection reason

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(memory): retain lancedb provider retirements

Co-authored-by: yt2102 <yt2102@qq.com>

* fix(memory): drain lancedb embedding uses

Co-authored-by: yt2102 <yt2102@qq.com>

---------

Co-authored-by: Sanjay Santhanam <notifications@github.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-26 03:00:22 -04:00
Peter Steinberger
f6131a4fbf build(deps): remove npm shrinkwrap; mirror pnpm lock into transient package locks (#114006)
* build(deps): remove npm shrinkwrap; mirror pnpm lock into transient package locks

npm 12 removed shrinkwrap (command + tarball/root loading). Delete all 82
committed npm-shrinkwrap.json files and stop publishing lockfiles; keep
pnpm-lock.yaml as the single reviewed dependency boundary. The generator
becomes scripts/generate-npm-package-lock.mjs and feeds plugin bundling via
a transient package-lock.json + npm ci (works on npm 11 and 12). Tarball
validation treats the published 2026.7.2 beta train as a shrinkwrap
transition; self-update npm detection now uses install topology instead of
the shipped shrinkwrap.

* fix(deps): repair lint, deadcode, and test-type lanes for the npm 12 migration

- sort integrity comparisons with an explicit comparator (oxlint)
- keep resolveBunGlobalNodeModules module-local (knip unused-export gate)
- model npm pack --json as npm<=11 array / npm 12 name-keyed object
- default calver destructuring in the tarball test fixture
2026-07-26 01:29:55 -04:00
Peter Steinberger
2de58d408a Control UI: gateway-owned sidebar section order (#113930)
* feat(ui): gateway-owned sidebar section order with hover-only drag grips

* fix(ui): repair sidebar section order CI gates

* fix(protocol): keep sectionOrder optional for older gateways

Native Swift clients ship separately from gateways, so new clients must decode older gateway responses that omit sectionOrder.

* fix(ui): reconcile gateway section ordering with main

* fix(state): allow lazy tables in v5 maintenance

* refactor(ui): retire prefs session section order in favor of gateway-owned order

Supersedes #113948 by deleting the unreleased ui.prefs.sessionSectionOrder key and its browser plumbing. Gateway SQLite sidebar_sections remains the single canonical store.
2026-07-26 01:15:19 -04:00
Peter Steinberger
b2f6ecc2a9 chore(compat): date the annotated deprecation families and expose removal-pending debt (#114002)
* chore(compat): date the annotated deprecation families and expose removal-pending debt

Adds 10 dated compat-registry records for shipped deprecated surfaces that
previously had @deprecated annotations only (removeAfter 2026-10-01 per the
approved 60-day window), extends the beta5 session-store record with the
package-root aliases, surfaces removal-pending records with due dates,
blockers, and readers in the plugin boundary report, and converts undated
cleanup obligations (CI timing job, zizmor excessive-permissions, staged
Codex CI auth, memory-host legacy state dir, agent-DB schema-ladder floors)
into dated markers visible to the weekly dated-TODO sweep. Metadata,
diagnostics, and docs only - no runtime behavior change.

* fix(compat): keep extension src test paths out of core string literals

The core import guardrail forbids extensions/*/src/ path shapes in core
production string literals; cite the package-root google-meet test and the
registry test for official-plugin-export-aliases instead.
2026-07-25 21:01:20 -07:00
Peter Steinberger
852a686a1b feat(chat): restore prompt image attachments on rewind/fork (#113945)
* feat(chat): restore prompt image attachments on rewind/fork

* chore(i18n): refresh native source inventory anchors

* fix(gateway): restore media-store images on rewind/fork

* fix(gateway): bound and dedupe rewind media reads

* fix(sessions): bound inline editor attachments in message cut

* fix(ui): align restored attachment cap with gateway 5 MiB limit

* fix(gateway): dedupe rewind media refs by resolved id

* fix(sessions): lint-safe __openclaw access in message cut
2026-07-25 20:32:16 -07:00
Peter Steinberger
8b9314b7e6 refactor(protocol): split gateway protocol registries (#113941) 2026-07-25 18:03:42 -07:00
Peter Steinberger
ce5ab8adb8 refactor(gateway): remove dead sessions.observer.ask rpc (#113791)
* refactor(gateway): remove dead sessions.observer.ask rpc

* docs: record btw and companion contract split

* fix(gateway): unexport observer model sanitizer after ask removal
2026-07-25 14:44:02 -07:00
Peter Steinberger
be6ec97e11 refactor(providers): manifest-declared default models and unified onboarding presets (#113794)
* feat(model-catalog): declare provider default models

* refactor(providers): source onboarding defaults from manifests

* fix(cohere): remove unused model id export

* fix(chutes): preserve public default model id

* fix(model-catalog): accept provider default models
2026-07-25 12:54:53 -07:00
Peter Steinberger
bde7033ac4 feat(models): dynamic model catalogs via hosted refresh overlay (#113660)
* feat(models): add remote catalog core

* feat(config): add model catalog refresh settings

* feat(models): wire remote catalog refresh

* ci(models): publish hosted catalog

* docs(models): document catalog refresh

* test(models): allow catalog count growth

* refactor(models): preserve safe catalog merge

* ci(models): publish catalog through GitHub

* docs(models): link public catalog history

* fix(model-catalog): enforce Kysely store access

* fix(model-catalog): trim unused catalog exports

* docs(models): refresh generated docs map
2026-07-25 12:15:05 -07:00
Peter Steinberger
a95486cefc feat: session rail with read-only session companion in Control UI chat (#113698)
* feat(protocol): add session companion schemas

* feat(gateway): add session companion service

* feat(gateway): expose session companion rpc

* fix(gateway): harden companion runtime limits

* test(gateway): fix companion type assertions

* test(gateway): align companion test target

* feat(ui): replace observer HUD and side chat with session rail

* docs: session rail companion for control ui

* test(ui): align session rail client mock

* fix(ui): drop stale chat search import

* fix: satisfy session companion lint contracts

* refactor(gateway): isolate companion state contract

* fix(ui): keep session rail reachable while idle

* fix(agents): clamp derived openai prompt cache keys at boundary

* fix(ai): clamp chatgpt responses session_id affinity header

* fix(ci): align session companion branch gates

* fix(ui): require run id for sessionless terminal chat events

* fix(agents): scope internal run events to transcript

* chore: revert changelog edit (release generation owns changelog)
2026-07-25 08:14:32 -07:00
zengLingbiao
cff22e83ca fix(xiaomi): reject malformed base64 audio in TTS responses (#113106)
* fix(xiaomi): reject malformed TTS audio

Co-authored-by: zenglingbiao <zeng.lingbiao@xydigit.com>

* fix(media): reject noncanonical base64 padding

* style(xiaomi): format malformed audio test

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-25 07:52:23 -07:00
ralf003
123ba75ff0 fix(agents): extract Undici cause.code for ECONNRESET/ECONNREFUSED/ETIMEDOUT (#110485)
* fix(transport): extract error code from cause.code for Undici network errors

* fix(transport): traverse nested error causes

---------

Co-authored-by: Altay <altay@hey.com>
2026-07-25 15:47:41 +03:00
Vincent Koc
e94ece85b6 fix(anthropic): preserve opus fallback pricing 2026-07-25 19:30:49 +08:00
Vincent Koc
4df130d0be fix(anthropic): honor opus 5 aliases 2026-07-25 19:30:49 +08:00
Vincent Koc
8373a55116 fix(anthropic): trust fallback boundary events 2026-07-25 19:30:49 +08:00
Vincent Koc
a69001850b fix(anthropic): canonicalize fallback model identities 2026-07-25 19:30:49 +08:00
Vincent Koc
aaea5c67ab test(anthropic): cover fallback serving transitions 2026-07-25 19:30:49 +08:00