Commit Graph

10094 Commits

Author SHA1 Message Date
Peter Steinberger
69b54cf13c chore(docs): harden external link audit results (#114746) 2026-07-27 17:37:02 -04:00
Peter Steinberger
7e8afba703 feat(plugins): mirror local coding sessions to a remote Beam receiver (#114735)
* feat(plugins): mirror local coding sessions to a remote Beam receiver

* fix(plugins): satisfy static gates for the Beam mirror seam

* fix(plugins): import the config type from the narrow contracts subpath

* fix(plugins): require catalog consent and loopback-only plaintext for the Beam mirror
2026-07-27 17:31:34 -04:00
Zakaria Rahali
a04ba3a468 fix(config): compaction.enabled is rejected as invalid config (#114118)
* fix(config): compaction.enabled is rejected as invalid config

Setting agents.defaults.compaction.enabled in openclaw.json made the
whole config fail to load with "agents.defaults.compaction: Invalid
input", so auto-compaction could not be turned off.

The runtime already reads the field (SettingsManager.getCompactionEnabled
returns settings.compaction?.enabled ?? true, and setCompactionEnabled
writes it), and the documented config example in
docs/reference/session-management-compaction.md already shows
"enabled: true". Only the zod schema was missing the key, and the
compaction object is .strict(), so the unknown key rejected the config.

Adds enabled to AgentDefaultsSchema and to AgentCompactionConfig.

Closes #110065

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

* fix(config): wire compaction enablement through runtime

Align the accepted compaction.enabled contract across runtime precedence, help, labels, docs, and generated schema baselines.

Co-authored-by: Zakaria Rahali <zakariarahali288@gmail.com>

* test(config): preserve omitted compaction setting

Document the reload lifecycle and lock in project-setting precedence when the OpenClaw config key is absent.

Co-authored-by: Zakaria Rahali <zakariarahali288@gmail.com>

* refactor(config): centralize compaction runtime override

* fix(config): preserve compaction safety guards

* fix(scripts): avoid ripgrep in merge fallback

* docs(config): refresh current main baseline

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-27 17:23:35 -04:00
Peter Steinberger
960b050add refactor(extensions): remove orphaned shadow trial and retired config aliases (#114709)
* refactor(memory-core): remove orphaned shadow trials

* refactor(qqbot): migrate direct voice upload formats

Release note: QQBot configs using voiceDirectUploadFormats now migrate through openclaw doctor --fix to audioFormatPolicy.uploadDirectFormats at root and account scope. Existing nested uploadDirectFormats values win conflicts, and runtime reads only the nested policy.

* refactor(feishu): migrate tools base alias

Release note: Feishu configs using tools.base now migrate through openclaw doctor --fix to tools.bitable at root and account scope. Existing bitable values win conflicts, and runtime accepts only the canonical key.

* refactor(extensions): remove dead runtime state

* chore(config): refresh bundled channel metadata

* refactor(codex): keep realtime fallback type private

* test(ci): align QA compatibility scenario count
2026-07-27 17:12:41 -04:00
Peter Steinberger
f0e81b97e8 refactor(model-picker): centralize session apply contracts (#114739)
* refactor(model-picker): centralize session apply contracts

* fix(ci): keep model apply helper result internal

* fix(model-picker): require channel codec opt-in
2026-07-27 16:58:23 -04:00
Jason (Json)
62baf451c1 fix(deepinfra): remove deprecated embedding provider warning (#114727)
* fix(deepinfra): migrate embedding provider registration

* fix(deepinfra): preserve embedding index identity
2026-07-27 14:53:34 -06: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
0e37f143f5 refactor(slack)!: retire inline interactive directives for typed presentation (#114738)
* refactor(slack): retire inline interactive directives

Release note: Slack configs using channels.slack.capabilities.interactiveReplies, including per-account settings, are removed by openclaw doctor --fix. Slack-only [[slack_buttons:...]] and [[slack_select:...]] markup is no longer parsed; emit typed presentation buttons and selects instead.

* docs: refresh Slack docs map
2026-07-27 16:41:00 -04:00
Peter Steinberger
fbb3525368 fix(ui): show a simple channel settings view with a flip to advanced (#114741)
* test(ui): make channel settings renderable in the mock dev server

* fix(ui): hide advanced channel settings behind the shared advanced tier

* fix(ui): widen the tier renderer callback to lit's nothing

* fix(ui): keep the advanced collapse control on advanced-only channel forms

* docs: note the shared advanced tier on channel settings
2026-07-27 16:39:23 -04:00
Peter Steinberger
f275db6974 refactor: remove dead split facades (#114726)
* refactor: remove dead split facades

* fix: update facade ownership references
2026-07-27 16:32:52 -04:00
Peter Steinberger
a1a507ddaf fix: gateway boot recovers from a dead-owner migration lease and names its breaker escape hatch (#114718)
* fix(gateway): reclaim startup migration leases whose owner process is gone

* fix(gateway): name a runnable command in crash-loop breaker suppression messages

* fix(gateway): scope the breaker recovery hint to the suppressed account
2026-07-27 16:11:00 -04:00
Peter Steinberger
fa6a93ac97 fix: recheck voice confirmation after tool rewrites (#114721)
* fix(security): revalidate voice confirmation params

* chore: leave changelog to release automation
2026-07-27 16:10:54 -04:00
Peter Steinberger
17e42229d2 feat: teach models to use collapsible details where supported (#114706)
* feat: teach models to use collapsible details where supported

* fix: accept nullable accountId in telegram rich-messages helper

* docs: regenerate docs map for collapsible details heading

* fix(ci): remove duplicate Codex prewarm test route
2026-07-27 16:06:33 -04:00
Peter Steinberger
bbc73c36bd feat(plugins): beam local coding sessions into a read-only catalog (#112323)
* feat(plugins): add read-only session beam

* test(plugins): tighten Beam HTTP fixtures

* docs(plugins): refresh Beam inventory counts

* fix(plugins): keep Beam wire types private

* fix(plugins): stabilize Beam transcript paging

* fix(plugins): honor Beam Control UI base paths
2026-07-27 15:37:36 -04:00
Peter Steinberger
fd0fdcc458 chore(docs): audit external links without gating PRs (#114643)
* docs: repair audited external links

* ci(docs): add advisory external link audit
2026-07-27 14:02:09 -04:00
WhatsSkiLL
79c517df89 fix(agents): stop stable tool argument churn (#112620)
* fix(agents): detect stable tool argument churn

* fix(agents): refine argument churn evidence

* fix(agents): route argument churn through recovery

* fix(agents): reconcile rewritten loop arguments

* fix(agents): defer churn recovery across policy waits

* fix(agents): preserve churn clocks across policy waits

* fix(agents): harden concurrent churn policy tracking

* fix(agents): avoid stale churn false positives

* fix(agents): satisfy loop diagnostic CI guards

* fix(agents): normalize write churn outcomes

* fix(logging): order churn activity events

* fix(agents): classify churn no-progress outcomes

---------

Co-authored-by: IWhatsskill <284122573+IWhatsskill@users.noreply.github.com>
Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-07-28 01:34:37 +08:00
Gio Della-Libera
e79faff8aa feat(claws): materialize CLAW.md prompts (#113454)
* fix(claws): align prompt lifecycle validation

* test(claws): cover Unicode frontmatter

* feat(claws): materialize CLAW.md prompts

* fix(claws): preserve portable provenance import
2026-07-27 08:30:50 -07: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
Sasan
7599bbe636 fix(agents): stop code-mode shell-command retry storms (#113070)
Reject recognizable POSIX and Windows shell source before QuickJS execution while preserving valid JavaScript, TypeScript, syntax errors, standard globals, and real hoisted bindings. Add real-worker regression coverage and adversarial cross-platform stress proof. Fixes #113069.
2026-07-27 08:10:37 -04:00
ClawSweeper
f67bdbbfe0 feat: add readable managed worktree names (#114488)
Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-27 05:03:43 -07:00
Peter Steinberger
0090768b51 refactor(agents): remove runtime migration fallbacks and post-split duplication (#114355)
* refactor(agents): deduplicate native hook relay facade

* refactor(agents): centralize recovery notice transport

* refactor(agents): share subagent session store readers

* refactor(agents): remove retired runner branches

* refactor(agents): remove runtime orphan-session migration

* refactor(agents): carry prepared session targets

* chore(plugin-sdk): refresh agent harness API baseline

* fix(agents): type shared subagent store entries

* docs(agents): clarify runtime migration invariants

* fix(agents): constrain session target inheritance

* Revert "fix(agents): constrain session target inheritance"

This reverts commit b44cfe7396.

* Revert "refactor(agents): carry prepared session targets"

This reverts commit 5abe0a8156.

* fix(agents): align migration ownership and relay exports

* fix(agents): preserve harness compatibility aliases

* fix(agents): trim unused relay options export
2026-07-27 08:02:53 -04:00
Peter Steinberger
c8ebf57731 feat(agents): advertise searchable tool capabilities (#114508) 2026-07-27 06:33:21 -04:00
Peter Steinberger
9f5ba09a0d fix(sessions): prevent lifecycle races and unsafe session management (#114477)
* fix(sessions): harden lifecycle, ownership, and subagent spawning

* test(agents): refresh session tool prompt snapshots

* fix(sessions): await rebuilding transcript projections

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-27 06:17:51 -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
fd6e042d87 fix(gateway): keep configured local auth authoritative (#114462)
* fix(gateway): align configured local credentials

* test(gateway): align local credential coverage

* chore(gateway): leave release note to release process
2026-07-27 05:43:31 -04:00
Peter Steinberger
4b9c922458 fix(agents): harden compact tool search and execution (#114461) 2026-07-27 05:13:41 -04:00
Peter Steinberger
914bd1946a fix(cli): isolate explicit profiles from inherited service state (#114446) 2026-07-27 04:59:20 -04:00
Santhi Prakash
ff20dd7e3f [AI-assisted] docs(tools): fix broken GitHub Copilot CLI docs URL (#114057) 2026-07-27 04:46:06 -04:00
Peter Steinberger
ac6009eab1 fix(tui): keep shared sessions live and bound stream state (#114443)
Fix cross-client terminal history synchronization without letting stale snapshots erase in-flight responses. Bound orphaned stream assembly, preserve session and agent ownership, and cover real Gateway delivery, persistence races, reconnects, and stress bursts.

Closes #38829.

Credits prior issue investigation in #96252 and bounded-stream work in #109492.

Co-authored-by: Harjoth Khara <48686985+harjothkhara@users.noreply.github.com>
Co-authored-by: Wynne668 <290981215+ZengWen-DT@users.noreply.github.com>
2026-07-27 04:39:42 -04:00
Santhi Prakash
13bbcabeab [AI-assisted] docs(reference): fix broken Anthropic prompt-caching docs URL (#114028)
The prompt-caching pricing reference in docs/reference/token-use.md linked to
docs.anthropic.com/docs/build-with-claude/prompt-caching. After Anthropic's
docs migration to platform.claude.com, that URL 301-redirects in an infinite
loop (browsers surface ERR_TOO_MANY_REDIRECTS).

Point it at the current canonical page, which returns HTTP 200 and still
documents the cache read/write pricing and 1h/5m TTL multipliers that the
surrounding paragraph references.
2026-07-27 04:35:45 -04:00
Peter Steinberger
abfe7c64a7 docs(install): recommend Node 26 as the OpenClaw runtime (#114399)
* docs(install): recommend Node 26; CI/installer stay on Node 24 for now

* feat(cli): point unsupported-runtime nvm hint at Node 26

* feat(install): provision Node 26 by default (brew mainline node formula, NodeSource 26.x, portable win zip)

* test(install): align installer tests with Node 26 provisioning defaults

* docs(install): state per-platform Node provisioning accurately
2026-07-27 04:32:21 -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
669db2968f refactor(agents): retire TOOLS.md into an AGENTS.md section with a doctor migration (#113966)
* fix(agents): stop retired attestation hashes from faking a vanished workspace

* feat(agents): migrate TOOLS.md content into the AGENTS.md tools section

* refactor(agents): drop TOOLS.md from the workspace bootstrap set

* refactor(policy): read tool policy entries from AGENTS.md

* docs: describe local tool notes as an AGENTS.md section

* test(codex): drop TOOLS.md developer-instruction coverage with the removed path

* test(agents): cover the TOOLS.md doctor migration behaviors

* refactor(doctor): satisfy TOOLS.md migration lint

* test(agents): split workspace attestation survival coverage

* refactor(codex): simplify workspace context basenames

* refactor(doctor): keep TOOLS.md migration helpers module-local

* docs: regenerate docs map

* fix(doctor): keep migration claims fresh

* fix(doctor): preserve nested tool notes

* refactor(doctor): split tools migration helpers

* refactor(doctor): limit TOOLS.md migration to workspace root

* style(doctor): keep migration under line limit

* fix(doctor): recover interrupted AGENTS publish

* docs(hooks): describe root-only TOOLS.md migration accurately

* fix(doctor): preserve migrated tool guidance visibility

* test(agents): regenerate prompt snapshots after rebase

* fix(policy): block evaluation while TOOLS.md is unmigrated

* fix(doctor): check merged bootstrap budget per agent

* fix(doctor): keep budget helper internal

* refactor(doctor): keep migration budget helpers to their consumers
2026-07-27 03:56:30 -04:00
Santhi Prakash
445774d85e [AI-assisted] docs(senseaudio): fix broken Docs URL to docs.senseaudio.cn (#114021)
The SenseAudio provider guide linked its Docs row to
https://senseaudio.cn/docs, which returns 404. The SenseAudio platform
homepage itself links to https://docs.senseaudio.cn (200), so point the
Docs row there instead.
2026-07-27 03:56:03 -04:00
Peter Steinberger
08b1ff73e2 refactor(channels): fix account resolution and setup isolation (#114395)
* refactor(channels): fix account resolution and setup isolation

* fix(channels): keep account resolvers safely destructurable
2026-07-27 03:49:37 -04:00
Peter Steinberger
e9990b818a feat(cli): add models auth logout (#114407) 2026-07-27 03:48:27 -04:00
Peter Steinberger
65cce37480 fix(codex): keep user-home app-servers on native Codex auth (#114397)
A prepared OpenClaw auth handoff was still resolved for connections that
target the operator's native Codex home, so every turn failed with
"Prepared Codex auth requires an isolated app-server home." once a stored
OpenAI profile produced a prepared model route. User-home mode now keeps
its native account for both subscription and Platform routes, matching the
documented contract; the shared-client guard stays as the backstop.
2026-07-27 03:19:06 -04:00
Peter Steinberger
3a4f337802 fix(gateway): connect first-boot loopback agents after readiness (#114380)
* fix(gateway): pair local CLI before runtime-token readiness

* docs(gateway): explain first-boot loopback CLI auth

* fix(gateway): keep startup pairing result internal

* chore(gateway): leave release note to release process
2026-07-27 03:15:12 -04:00
Pavan Kumar Gondhi
33f44caa5d fix: restrict QQBot quoted context [AI] (#114136)
* fix: restrict qqbot quoted context

* fix: narrow qqbot bot quote exemption

* test: use valid qqbot ingress reasons

* fix: honor narrowed qqbot open dm quotes

* fix: honor narrowed qqbot open group quotes

* test: use valid qqbot blocked ingress decisions

* fix: honor qqbot quote visibility mode

* docs: mention qqbot context visibility

* fix: validate qqbot context visibility config

* fix: hide denied qqbot quote sender

* test: avoid unbound qqbot access mock

* test: allow auth migration isolation to finish

* Revert "test: allow auth migration isolation to finish"

This reverts commit f2b9a4f5e9.
2026-07-27 12:23:21 +05:30
Peter Steinberger
054495d16d fix(ci): verify stale bugs before closure (#114365) 2026-07-27 02:25:15 -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
Dallin Romney
9310586b09 fix(qa-lab): unify runner control plane (#112838) 2026-07-27 14:05:14 +08:00
Peter Steinberger
b5137604ef feat(cron): default agent turns to the current conversation, add /loop, tighten cron tool surface (#114328)
* feat(cron): bind agent turns to current sessions

* feat(commands): add loop chat command

* test(cron): cover session defaults and loop commands

* docs(cron): document current defaults and loops

* fix(commands): scope /loop status and stop by conversation name tag

* fix(commands): widen /loop conversation tag to 48 bits

* fix(commands): include disabled jobs in /loop status and stop

* docs(cron): regenerate docs map

* test(cron): split session-target default tests to satisfy max-lines
2026-07-27 01:44:38 -04:00
Peter Steinberger
fa28e9be8d fix(plugins): find installed external web-search providers on fresh installs (#114327)
* fix(plugins): stop treating a partial active registry as authoritative for web providers

An active plugin registry with some web providers used to win even when a
manifest-declared candidate (e.g. an npm-installed Brave plugin with
BRAVE_API_KEY set) was absent from it, so env-var auto-detect could never see
installed external search providers. Delegate to the coverage-checked
resolvePluginWebProviders path, which reuses the active registry only when it
covers every declared candidate.

* feat(agents): require explicit overwrite before replacing pre-existing files in the write tool

Blind writes to an existing path silently destroyed user content (observed as
WildClawBench safety-task data loss with weaker models). The write tool now
refuses to replace an existing differing file unless the call passes
overwrite:true or this tool instance already wrote that path, keeping
iterate-loops friction-free while making destructive replacement an explicit
model decision.

* docs(templates): make a concrete first-message task outrank the BOOTSTRAP.md birth sequence

A fresh workspace's birth ritual hijacked substantive first messages: agents
introduced themselves and asked for a name instead of doing the requested
work (worst with weaker models, which follow the ritual literally). State
task precedence explicitly at the top of the template.

* fix(agents): lead the write overwrite guard error with the safe protocol

Weak models retried immediately with overwrite:true when the flag came first
in the message. Order the guidance read -> rename -> overwrite-as-last-resort
so the destructive path requires an explicit judgment call.

* refactor(agents): replace the write overwrite flag with a confirm-by-resend gate

The overwrite:true escape hatch let weak models bulldoze reflexively and grew
the tool schema. The first write to a differing pre-existing file now returns
that file's content (head-clipped) and a resend of the identical write, issued
after the warning, against byte-identical existing content confirms the
replacement. Fingerprints hash raw bytes; oversized files fall back to
size+mtime (named tradeoff); missing metadata fails closed.

* revert(agents): restore plain overwrite semantics in the write tool

The overwrite gate (flag, then confirm-by-resend) was overfit to one
WildClawBench safety rubric: the guarded model still chose to overwrite and
still scored zero, while every real overwrite in normal sessions paid a
round-trip. Write means write; peers (Pi, Hermes) agree.

* test(agents): drop the stale overwrite arg from the write output-contract test
2026-07-27 01:32:04 -04:00
Peter Steinberger
d413fbd8ec fix: Tool Search finds tools by how agents actually phrase requests (#114285)
* feat(agents): rank Tool Search with BM25 over names, descriptions, and parameters

Ranking was case-insensitive substring matching with hand-tuned weights, which
failed in ways that made tools unreachable rather than merely mis-ordered:

- "scheduling" found nothing against a tool described "Schedule a recurring
  task" — no stemming.
- "read" ranked spreadsheet_open, because "sp-read-sheet" contains it.
- A non-English query tokenized to zero terms, and the scorer returned 1 for
  every entry, so the model received an arbitrary alphabetical slice of the
  catalog presented as a ranked result.

Replace it with Okapi BM25 over a tokenizer that splits on Unicode word
boundaries, drops stopwords, and collapses light English inflection. Index
parameter names and descriptions too, which Codex (bm25 crate) and the Claude
API tool-search tools both do; a query like "repository" now reaches a tool
whose description never says it. Underscore-joined names index as both the whole
name and its parts.

A small query-expansion table bridges intent to description vocabulary ("look up
the price" -> search/web), which pure lexical overlap cannot do. It holds only
generic capability words, never plugin or vendor names.

Empty queries now score nothing instead of everything, and both `tool_search`
and the code-mode bridge tell the model to query in English, so the degenerate
case is steered away from rather than silently mishandled.

Untrusted schemas are still never traversed: parameters are indexed only for
`openclaw` entries, matching the boundary compactToolSearchCatalogEntry already
enforces by reporting MCP and client inputs as "unknown".

* fix(agents): undouble inflected consonants and state the real English contract

Autoreview caught two defects in the new stemmer and its documentation.

"running" stripped to "runn", which can never meet "run", so a tool named
task_runner described "Running tasks" became unreachable for the query "run" —
a regression the substring scorer did not have. English doubles the final
consonant before -ing/-ed/-er, so undo that, while keeping doubles that belong
to the root (call, process, off, buzz).

The English-only claim was also stronger than the code: the tokenizer keeps
Unicode letters, so a non-English query yields terms and can match. Rejecting
them would make a catalog that legitimately names a tool in another script
permanently unreachable, so the behavior stays and the wording now matches it —
catalogs are written in English, so other languages usually match nothing, and
the model is asked to query in English for that reason rather than because the
input is filtered. The previous test only proved an unrelated document scored
zero, so it is replaced by one that asserts each half directly.

* fix(agents): split camelCase, discount expansions, and stop trigger collisions

Three defects in the new tokenizer, all found by autoreview and all reproduced
before fixing.

`splitWords` lowercased before looking for boundaries, so `readFile` produced
only `readfil` and the natural query `read file` could not meet it. MCP catalogs
commonly use camelCase, and the old substring scorer matched those. Split case
transitions before lowercasing.

Expansion terms carried the same BM25 weight as words the caller typed, so
`weather` — which expands to search/web — could rank a general web tool above
the exact weather tool by matching two terms instead of one. Expansions are a
guess about how the catalog words a capability, so they now score at 0.35, and a
term the caller actually wrote keeps full weight even when an expansion repeats
it.

Trigger matching ran the document stemmer, which collapsed unrelated vocabulary:
`news` became `new`, so "open a new issue" silently acquired a web-search intent.
Triggers now normalize by singularization only, which leaves `news` intact, and
the table lists `reminder` explicitly rather than relying on the stemmer to
reach it.

* fix(agents): normalize -ies plurals and tier literal matches above expansions

`repositories` stemmed to `repositori` while `repository` stayed put, so the two
never met; `-ies` now normalizes back to `-y` in both the document stemmer and
the expansion triggers, which also lets `directories` and `memories` reach their
intended groups instead of stalling at `directorie`.

The 0.35 expansion discount is not sufficient on its own to keep a literal match
ranked first: BM25 sums per term, so a common literal like `weather` carries
little IDF while a short document collecting two rare expansions can outscore
it, and a small result limit then drops every tool matching the typed word.
Literal overlap is now reported per hit and ranked as a tier ahead of score, so
the discount orders within a tier rather than trying to carry the invariant.

Verified by running the ranker over the failing inputs rather than reasoning
about them; the first attempt at the trigger fix silently did not apply because
the formatter had reflowed the function, which the matrix run caught.

* fix(agents): keep non-plural -s words out of the plural stem rule

"news" stemmed to "new", which literal-matched every "Create a new ..." tool;
because literal overlap now outranks expansion-only hits, a search for news
returned creation tools instead of the web tool the query meant.

The collision is not unique to news — "status", "canvas", and "alias" are all
ordinary tool vocabulary here and all lose their meaning under the same rule, so
the exemption covers that class rather than the single reported word.

* fix(agents): restore the exact-name tier and keep `get` searchable

Two signals the old substring scorer had and BM25 alone does not.

It gave an exact name/id match +20, which flattening everything into one
document removed: querying a known tool name could rank a shorter entry that
merely mentions the word above the tool itself, and the result limit would then
drop the tool asked for. Exact name/id is now a sort tier ahead of literal
overlap.

`get` was in the stopword list, but it names real operations in a tool catalog.
Discarding it made `search("get")` empty and reduced "get issue" to "issue",
where a shorter delete_issue or update_issue entry can win on length
normalization. Capability verbs stay indexed.

* fix(agents): keep acronyms whole, both -ies readings, and stopword-named tools

* refactor(agents): keep the ranking types and entry-text helper module-local

Knip's hard-zero unused-export gate flagged WeightedTerm, RankedDocument,
LexicalIndex, and toolSearchEntryText: nothing outside their own modules
imported them. Narrowing the surface is what the repo asks for anyway.

The untrusted-schema test now drives ToolSearchRuntime.search instead of
calling toolSearchEntryText directly, which proves the boundary through the
real entry point. Verified it still bites: removing the source gate makes it
fail with "client properties must remain deferred".
2026-07-27 01:10:53 -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
joshavant
44378dd24a fix(channels): harden record session override 2026-07-26 23:15:06 -05:00