37 Commits
Author SHA1 Message Date
74e2c2afdd fix(scripts): preserve surrogate pairs when truncating LLM text in bench dump (#110546)
* fix(scripts): use truncateUtf16Safe for LLM text truncation in bench dump

Three .slice(0, N) calls truncate assistant/tool result/final text for
logging output. Raw String.prototype.slice operates on UTF-16 code
units and can split surrogate pairs (emoji, CJK characters) straddling
the cut boundary, producing invalid Unicode in trail and result output.

Replace with truncateUtf16Safe from @openclaw/normalization-core/utf16-slice,
the same helper already used across the codebase for safe boundary truncation.

Co-Authored-By: nebulacoder-v8.0 <noreply@zte.com.cn>

* test(scripts): add behavioral proof for UTF-16 safe truncation in bench dump

Co-Authored-By: Pick-cat <huang.ting3@xydigit.com>

* test(scripts): replace root proof harness with repository-native bench dump truncation tests

Remove the 163-line root-level proof artifact and add focused vitest
tests in test/scripts/ that exercise the exact truncateUtf16Safe call
sites and format strings used by the bench script — without needing a
live LLM benchmark run.

Co-Authored-By: Pick-cat <huang.ting3@xydigit.com>

* test(scripts): remove redundant UTF-16 helper coverage

---------

Co-authored-by: nebulacoder-v8.0 <noreply@zte.com.cn>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-20 19:25:02 -07:00
Peter SteinbergerandGitHub d371ea1f01 perf(agents): wave-1 tool output contracts for code mode (#110215)
* feat(agents): keep output contracts complete across opaque schema leaves

* test(agents): add code mode schema-hint hot-path micro-benchmark

* test(agents): count raw-first inspection execs per tool in live bench

* feat(agents): expand compact output contract hints

* feat(agents): declare wave one tool output contracts

* docs(tools): list built-in output contracts

* fix(agents): bound union scans before literal-union analysis

* fix(agents): keep wave-1 contract schemas module-local and type-exact
2026-07-18 01:02:18 +01:00
Peter SteinbergerandGitHub b319493a52 improve: let Code Mode use declared tool result shapes (#109813)
* feat(agents): add Code Mode output contracts

* perf(agents): defer untrusted tool schemas

* chore(plugin-sdk): refresh API baseline

* fix(agents): preserve deferred schema markers

* fix(agents): preserve policy-blocked tool results

* fix(agents): preserve nullable output contracts

* fix(agents): reject policy blocks from success contracts

* fix(agents): preserve output contracts through normalization

* test(agents): type normalized tool fixtures

* fix(agents): validate catalog results before projection

* fix(agents): keep result snapshots internal

* fix(agents): fail closed on unrenderable unions

* fix(agents): preserve empty result markers

* test(agents): keep result fixture discriminator literal

* test(agents): use native own-property check
2026-07-17 14:46:37 +01:00
Peter SteinbergerandGitHub 85d375c1b2 chore: add live tool-surface benchmark (#109374)
* test(agents): add tool-surface live benchmark

* chore(agents): narrow live benchmark exports

* fix(agents): pin live bench models
2026-07-16 17:20:47 -07:00
Peter SteinbergerandGitHub 7e1d93d36d refactor(deadcode): enforce full-repository hard zero (#108717)
* refactor(deadcode): enforce full-repository hard zero

* refactor(deadcode): drop rebased test-support leftovers

* refactor(openai): remove stale TTS test bridge

* test(config): cover bundled tuple baseline merging

* fix(deadcode): reject external Windows paths

* test(config): preserve heterogeneous tuple coverage
2026-07-16 00:16:20 -07:00
Peter SteinbergerandGitHub 3b946e09da refactor(logging): trim internal export surface (#107407) 2026-07-14 04:12:23 -07:00
Peter SteinbergerandGitHub fa77fe10d5 chore: migrate active GPT-5.5 references to GPT-5.6 (#104452)
* chore(models): migrate active GPT-5.5 references

* test(workboard): expect GPT-5.6 Sol default

* chore: keep release notes in PR body

* test(models): align picker fixtures with Sol default

* test: update PDF default model expectation

* test(qa): migrate thinking smoke to Luna

* test(gateway): align mock catalog with Sol default

* ci: retrigger exact-head PR checks

* test(gateway): document default catalog invariant
2026-07-11 06:30:57 -07:00
Peter SteinbergerandGitHub fe261b0f59 chore(tooling): typecheck root test/** with a dedicated tsgo lane (#104475)
* chore(types): add declaration files for scripts/lib and scripts/e2e modules

* chore(types): add declaration files for top-level script modules (a-m)

* chore(types): add declaration files for top-level script modules (n-z)

* test: use a non-secret-shaped gateway token fixture

* test: type ci workflow guard helpers for the root test lane

* chore(tooling): typecheck root test/** with a dedicated tsgo lane

- test/tsconfig/tsconfig.test.root.json: root-test program (strict unused checks,
  fixtures excluded; two Docker E2E clients that import built dist/** stay out,
  same rationale as the scripts/e2e exclusion in tsconfig.scripts.json)
- tsgo:test:root wired into tsgo:test, check:test-types, scripts/check.mjs, and
  the ci.yml test-types shard, mirroring the tsgo:scripts lane (#104348)
- changed-lane routing: test/**/*.ts (excluding fixtures) and the lane tsconfig
  now trigger 'typecheck test root' in check:changed; previously test/ paths ran
  lint only, so harness type errors surfaced first in CI (#104287 envDir case)
- burn down all 1071 latent type errors in the program: precise param/local
  types across test/scripts, test/vitest, test/e2e, and transitive scripts/e2e
  program members; 205 sibling .d.mts declaration files for imported .mjs
  modules (committed separately); zero any, zero ts-expect-error
- resolve the pre-existing testing star-export ambiguity in
  scripts/e2e/parallels/common.ts with an explicit re-export

Closes #104388

* chore(types): correct declaration fidelity per structured review

- re-derive 51 .d.mts files from implementation data flow instead of
  initializers: fix a wrong never return (runTestProjectsDelegation returns
  the child), add encoding-sensitive exec/spawn overloads (plain-gh), restore
  the full release profile union, make parsed paths string | null, add missing
  parseArgs fields via help/non-help unions, add a missing sibling declaration
  (budget-number-args), drop 15 unused lint directives
- precise install-record/tuple typing removes the type-aware oxlint
  regressions the first declarations caused in scripts/e2e implementations
- route .mts declaration edits under test/ to the testRoot lane and reference
  the test-root project from tsconfig.projects.json so tsgo:all covers it
  (closes both review findings against the lane wiring)

* chore(scripts): keep telegram runner dist typing structural for the boundary guard

* chore(types): declare runtime pack and gateway readiness exports added on main

* test: pin the importTargetPlan form of the plugin-contract plan import

The guard expectation still referenced the raw await import( form that
7ae5996bb3 (#103975) replaced with the importTargetPlan fallback helper;
the assertion fails on current main.
2026-07-11 06:15:41 -07:00
Peter SteinbergerandGitHub 2e2366b6d3 chore(tooling): typecheck scripts/** with a dedicated tsgo lane (#104348)
* feat(tooling): add tsgo typecheck lane for scripts/**

* fix(scripts): burn down scripts type debt surfaced by the new lane

Typing-only except bugs the lane surfaced: gh-read timeout race,
Discord Headers spread dropping entries, undefined allowedHeadBranches
match, plugin-boundary matchAll crash. Deletes retired config keys from
fixtures/benches (prompt snapshots regenerated, config dump only) and
the orphaned non-runnable sync-moonshot-docs script. Adds full-surface
.d.mts declarations for existing .mjs boundaries.
2026-07-11 02:31:17 -07:00
Ayaan ZaidiandGitHub f351288a0d chore(repo): remove stale repository artifacts (#103152)
* docs: remove merged cron design document
* chore(repo): remove stale planning and proof artifacts

---------

Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-07-10 05:28:12 +05:30
Dallin RomneyandGitHub 18f0eeab20 test: fold webchat auto tts proof into qa (#97632) 2026-06-28 23:20:13 -07:00
maweibinandGitHub 740578b596 fix: assistant reply lost between compaction summary and first kept user in successor transcript (#95484)
Merged via squash.

Prepared head SHA: eff5894fb8
Co-authored-by: maweibin <18023423+maweibin@users.noreply.github.com>
Co-authored-by: vincentkoc <25068+vincentkoc@users.noreply.github.com>
Reviewed-by: @vincentkoc
2026-06-23 17:25:45 +08:00
Darren2030andGitHub c4cac33af6 fix(openrouter): expand short canonical model IDs to upstream API slugs (fixes #95198) (#95268)
- Add OPENROUTER_SHORT_TO_API_MODEL_ID map for short model refs like
  openrouter/deepseek-v4-flash that OpenClaw surfaces but OpenRouter API
  expects as deepseek/deepseek-v4-flash.
- In normalizeOpenRouterApiModelId, expand short refs before falling back
  to the existing namespaced strip logic.
- Add unit tests covering short refs, long refs, native routes, and
  pass-through cases.
- Add standalone reproduction script that verifies all normalization cases.
2026-06-22 19:15:25 +00:00
Vincent Koc 6ddbcbd460 chore(deadcode): remove stale proof scripts 2026-06-21 18:00:25 +08:00
Vincent Koc fd166a5318 fix(qa): reject loose code-mode live task limits 2026-06-16 21:15:55 +02:00
Vincent Koc 6f53f84af3 fix(gateway): normalize paired access lists 2026-06-16 12:31:24 +08:00
wangmiao0668000666andVincent Koc d6eefa191f fix(device-pairing): guard mergeRoles/mergeScopes against non-string entries (#90654) 2026-06-16 12:31:24 +08:00
wangmiao0668000666andVincent Koc 481652d78a fix(gateway): guard formatAuditList against non-string items to prevent handshake trim crash (#90654) 2026-06-16 12:31:24 +08:00
Peter Steinberger 613a2835cb docs: document scoped script helpers 2026-06-04 23:57:22 -04:00
Peter Steinberger b8d08f0cfd docs: document repository scripts 2026-06-04 20:52:50 -04:00
Vincent Koc ef26e8dfce fix(repro): clean webchat tts proof artifacts 2026-06-01 19:04:12 +02:00
Vincent Koc a8bc1716dd fix(usage): skip empty timeseries scans 2026-06-01 18:20:52 +02:00
Peter SteinbergerandGitHub 287687da20 feat: add internal code mode namespaces (#88043)
* feat: add internal code mode namespaces

* test: add code mode namespace live proof

* test: add live code mode Docker repro

* chore: keep code mode docker repro out of package scripts

* fix: break code mode namespace type cycle

* fix: clean code mode namespace ci drift

* fix: route code mode namespaces through tools

* fix: preserve explicit agent global sessions

* docs: explain code mode namespace registry

* test: cap realtime websocket payload

* fix: normalize code mode timeout results

* fix: satisfy code mode timeout lint

* chore: rerun code mode CI

* ci: extend node shard silence watchdog

* test: avoid child process mock deadlocks

* test: fix code mode repro shebang

* fix: scope explicit agent sentinel sessions

* test: preserve child process mock actual loader

* fix: dispatch namespace tools by exact id

* test: satisfy restart execFile mock type
2026-05-30 22:42:57 +01:00
27b15a19e8 refactor(voice): catalog voice models through providers (#87794)
* refactor(providers): catalog voice models

* feat(tts): route speech through voice models

* refactor(tts): rename speaker selection fields

* refactor(tts): mark default speech models

* test(tts): type migrated speaker config assertions

* refactor(providers): avoid catalog merge map spread

* fix(tts): honor voice model fallbacks

* refactor(tts): move speech core into package

* chore(tts): register speech core knip workspace

* fix(tts): show migrated speaker voice in status

* fix(tts): satisfy speech core lint

* fix(tts): preserve explicit model aliases

* test(tts): narrow provider config assertion

* test(doctor): allow slow commitments repair check

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-05-29 04:46:45 +01:00
Peter SteinbergerandGitHub 4f4d108639 chore(lint): remove underscore-dangle allow list (#83542)
* chore(lint): reduce underscore-dangle exceptions

* chore(lint): reduce more underscore exceptions

* chore(lint): remove underscore-dangle allow list

* fix(lint): repair underscore cleanup regressions

* test(lint): track version define suppression
2026-05-18 14:56:06 +01:00
Peter Steinberger e3a248585e fix(cli): preserve scoped secret resolution
Co-authored-by: wuyangfan <1102042793@qq.com>

# Conflicts:
#	src/cli/capability-cli.test.ts
#	src/cli/capability-cli.ts
2026-05-17 10:42:57 +01:00
Peter Steinberger fe680e47ce fix(cli): scope web command secret refs 2026-05-17 10:42:57 +01:00
9e67f53b91 fix(cli): resolve web command SecretRefs
Fix CLI web search/fetch command SecretRef resolution for provider-scoped plugin credentials.

- Carry command provider overrides through gateway and local secret resolution.
- Mark the selected web provider targets active and unrelated plugin refs inactive.
- Cover Tavily, DuckDuckGo, legacy Firecrawl fetch, protocol overrides, and runtime command-secret behavior.
- Add public plugin-sdk test mock exports needed by existing plugin tests after CI boundary enforcement.

Fixes #82621.
Replacement for #82699.

Co-authored-by: 吴杨帆 <39647285+leno23@users.noreply.github.com>
2026-05-17 03:00:39 +01:00
cc9117f729 fix: validate limit edge cases and voicecall numeric flags (#82679)
Fix diagnostics/session usage limit handling and voice-call numeric CLI validation.

- Treat explicit zero, negative, and non-finite diagnostics/session limits as empty results instead of falling back to defaults.
- Reject invalid, non-finite, and fractional voice-call numeric flags.
- Add focused tests and a live repro proof for the canonical edge cases.

Fixes #82646, #82650, #82651, #82653.

Co-authored-by: wuyangfan <1102042793@qq.com>
2026-05-17 00:11:46 +01:00
Peter Steinberger ac99494e44 test: tighten session_status run-session proof (#82696) 2026-05-16 23:27:19 +01:00
361dc69029 chore: add live repro for session_status runSessionKey proof
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-16 23:27:19 +01:00
35e1c7ac41 fix(webchat): keep trustedLocalMedia internal to reply payloads
Restore Omit on public plugin-sdk ReplyPayload; set trustedLocalMedia via
runtime assertion in speech-core and explicitly on dispatch TTS-only finals.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-16 21:18:13 +01:00
eec18fccb4 fix(webchat): forward trustedLocalMedia on accumulated block TTS tail
Avoid per-block final-mode synthesis (duplicate with dispatch tail). Mark
TTS output as trusted local media and pass the flag through the TTS-only
final payload WebChat consumes after block streaming.

Fixes #82628

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-16 21:18:13 +01:00
f8323f8636 chore: add live repro script for WebChat auto-TTS proof
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-16 21:18:13 +01:00
Mason HuangandPeter Steinberger edc6c13f1f plugin-sdk: drop investigative weixin repro harness 2026-04-09 01:35:15 +01:00
Mason HuangandPeter Steinberger ba636d1206 plugin-sdk: keep command status compatibility path light 2026-04-09 01:35:15 +01:00
Peter Steinberger ee380e9ab9 fix: run cli scripts via node build runner 2026-01-18 18:43:39 +00:00