Commit Graph

81 Commits

Author SHA1 Message Date
Ruida Xu 32ba4d303d feat(timezone): make all user/LLM-facing timestamps timezone-configurable (#129)
Add top-level `timezone` config option (default: "system") supporting
IANA names and UTC offset strings (ECMA-402 2024).

- Introduce unified `src/utils/time.ts` module with formatForLLM,
  formatLocalDate, formatLocalDateTime, startOfLocalDay, nowInstantISO
- Converge 4 scattered time helpers into the single module
- L1 extraction / auto-recall / scene-extraction / persona-generation
  prompts now emit ISO 8601 with explicit UTC offset
- Add timezone declaration to LLM system prompts
- Local-day shard boundaries and cleaner cutoff follow configured tz
- Storage instants (SQLite/TCVDB) remain UTC — no data migration needed
- 38 unit tests covering IANA, offset, DST, half-hour zones, fallback
2026-06-04 11:44:01 +08:00
Akhilesh Arora c6ed755835 fix(recall): truncate recalled context by code point, not code unit (#109)
truncateRecallLine capped lines with line.length and line.slice, which
count and index by UTF-16 code unit. When recall.maxCharsPerMemory or
recall.maxTotalRecallChars is set and the cut lands between the halves of
a surrogate pair, the line keeps a lone surrogate that becomes U+FFFD once
UTF-8 encoded for the request, corrupting any non-BMP character (emoji,
CJK Ext-B) in the injected context. Slice on Array.from(line) code points
instead. Both recall call sites route through this function. Same class as
the sanitizeText fix in #31, reintroduced by the #71 budget path.

Signed-off-by: Akhilesh Arora <akhildawra@gmail.com>
2026-06-02 21:08:59 +08:00
Radian 3d588b0a0f Merge pull request #128 from withRiver/fix/remove-tools-clean-context-runner
fix: pass disableTools:true when enableTools=false in CleanContextRunner
2026-06-02 20:40:24 +08:00
Rocke Dong 15585548ec docs: fix OpenClaw context engine slot (#124) 2026-06-02 17:30:42 +08:00
Yuntong8888 f0c683dc24 Update README_CN.md (#126)
更新 README 中的微信社群二维码图片为最新版本,方便用户扫码加入社群。

Update the WeChat community QR code in README to the latest version, making it easier for users to join the community.

共替换 4 处二维码图片引用,仅修改图片 src 地址,保持原有显示尺寸(width="360" / width="200")和布局(居中对齐)不变。
2026-06-02 17:29:41 +08:00
Andy He d1534e488f refactor: unify duplicate Logger interfaces into single canonical type (#14)
* refactor: unify duplicate Logger interfaces into single canonical type

23 files had local Logger/StoreLogger/PluginLogger/PipelineLogger/RunnerLogger/ExtractorLogger/TriggerLogger
interface definitions with identical shapes ({debug?, info, warn, error}).

Replace all with imports from the canonical `Logger` in `src/core/types.ts`:
- 17 files: local `interface Logger` → `import type { Logger }`
- 6 files: named variants (StoreLogger, PluginLogger, etc.) → `type X = Logger` alias

Two intentionally different interfaces are preserved:
- `CheckpointLogger` (only info + optional warn) — different contract
- `ensure-hook-policy.ts` Logger (no error) — different contract

Net: -120 lines, zero behavioral change.

Signed-off-by: yuanrengu <heyonggang0811@126.com>

* docs: update Logger JSDoc to reflect canonical relationship

StoreLogger, PluginLogger, etc. are now type aliases of Logger, not the
other way around. Update the comment to clarify this inverted relationship.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Signed-off-by: yuanrengu <heyonggang0811@126.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-01 15:12:46 +08:00
chrishuan 438869bec8 feat: release v0.3.6 v0.3.6 2026-05-28 14:32:52 +08:00
YOMXXX 1bdcf28c5e feat(recall): cap injected memory context (#71)
- Add `recall.maxCharsPerMemory` and `recall.maxTotalRecallChars` with defaults of `0`, which do not alter existing behavior. Users can opt in by setting positive values to cap injected memory context.
- Apply the budget after L1 search and before `<relevant-memories>` injection, preserving score order while truncating oversized entries and dropping overflow.
- Document the new guards in README, README_CN, and `openclaw.plugin.json`.
2026-05-26 21:19:38 +08:00
十五便士 d92cbd3840 Increase package size limit from 512KB to 2048KB 2026-05-25 17:26:27 +08:00
Siren.W dc34ec5283 Do not expose tools for standalone text-only LLMRunner tasks (#59)
Removes tool exposure from the standalone `LLMRunner` when `enableTools=false`.

Some standalone text-only tasks, such as L1 extraction, expect plain text output and do not need tool access. Passing even a read-only tool subset can still encourage tool-calling behavior on OpenAI-compatible backends, which makes this path less stable than necessary.

With this change:

- `enableTools=true` keeps the existing sandboxed tool behavior
- `enableTools=false` sends no tools at all
2026-05-25 15:30:54 +08:00
Ruida Xu acc2665389 Merge pull request #85 from YOMXXX/fix/openclaw-state-dir-fallback
fix(plugin): add OpenClaw state dir fallback in ESM-safe method
2026-05-25 15:24:30 +08:00
noFloat e334591bde Merge pull request #81 from yuanrengu/fix/api-key-in-config-yaml
fix: add missing api_key field for custom provider in Dockerfile.hermes
2026-05-25 14:36:59 +08:00
李冠辰 49788fc085 fix(plugin): add OpenClaw state dir fallback 2026-05-25 00:10:57 +08:00
yuanrengu 69a95536ad fix: add missing api_key field for custom provider in Dockerfile.hermes
The CMD script writes MODEL_API_KEY to .env as OPENAI_API_KEY but
does not include it in config.yaml's model section. Hermes with
provider: custom reads api_key from model.api_key in config.yaml,
not from OPENAI_API_KEY in .env. This causes 401 Authentication
Fails when users start a conversation inside the container.

Fix: add api_key field to the generated config.yaml model section.
2026-05-24 11:25:43 +08:00
十五便士 be998adeb2 Replace WeChat group QR code image
Updated the WeChat group QR code image in the README_CN.md file.
2026-05-23 21:20:19 +08:00
honchow bfddda6d3e Merge pull request #31 from akhilesharora/fix/sanitize-text-preserve-non-bmp
fix(offload): preserve non-BMP characters in sanitizeText
2026-05-21 14:46:19 +08:00
chrishuan 0d462e0b63 chore: release v0.3.5 v0.3.5 2026-05-20 22:58:05 +08:00
noFloat f81b79e4ac Merge pull request #55 from YOMXXX/fix/install-root-su-recursion
fix(install): prevent infinite su recursion when running as root
2026-05-20 19:30:55 +08:00
chrishuan 3d965dfbb6 fix(docs): add cd docker/opensource before docker build command 2026-05-20 18:21:34 +08:00
李冠辰 e2223bd532 fix(install): prevent infinite su recursion when running as root
If install_hermes_memory_tencentdb.sh is invoked directly by the root
user (e.g. fresh server with root SSH login), the prior logic:

  USERNAME=$(whoami)             # → "root"
  if [ "$(id -u)" -eq 0 ]; then
      su - $USERNAME -c "bash $TEMP_SCRIPT"   # → su - root → root → loops
  fi

would spin forever: ``su - root`` enters a fresh root shell that re-runs
the script, which sees EUID=0 again and ``su -``-s itself once more.
Symptom (per issue #20):

  [memory-tencentdb] Running as root, switching to root for installation...
  [memory-tencentdb] Running as root, switching to root for installation...
  ...   (only Ctrl+C stops it)

Fix:

  1. ``USERNAME`` resolution adds two precedence steps before
     ``$(whoami)`` so admins running ``sudo bash install.sh`` end up
     installing for the original user instead of for root:
       a. ``INSTALL_AS_USER`` env override (explicit admin choice)
       b. ``SUDO_USER`` (sudo's own record of the calling user)
       c. ``whoami`` (final fallback)

  2. The ``id -u == 0`` branch now skips the ``su -`` step when the
     target user is also root — that's the recursion-trigger case. The
     script proceeds inline as root for the rest of the install.

  3. A new ``elif`` arm logs a clear ``"Running as root; target user is
     also root — installing in place."`` so the operator sees what's
     happening.

Verified by dry-run simulation of 5 scenarios:

  | Case                                    | Branch        | USERNAME |
  | --------------------------------------- | ------------- | -------- |
  | root SSH direct (#20 reproducer)        | INLINE        | root     |
  | non-root user direct                    | NORMAL        | <user>   |
  | sudo bash install.sh from non-root user | SU            | <user>   |
  | root + INSTALL_AS_USER=bar              | SU            | bar      |
  | root + INSTALL_AS_USER=root             | INLINE        | root     |

Closes #20.

Signed-off-by: 李冠辰 <liguanchen@xiaomi.com>
2026-05-19 07:30:35 +08:00
Yuntong8888 c13d020047 Update README_CN.md 2026-05-18 18:22:59 +08:00
Akhilesh Arora bf58853343 fix(offload): preserve non-BMP characters in sanitizeText
UNSAFE_CHAR_RE included the surrogate range [\uD800-\uDFFF] without the `u`
flag, so JS treated strings as UTF-16 code units and stripped each half of
every well-formed non-BMP code point. sanitizeText and sanitizeJsonLine
therefore destroyed emoji, CJK Extension B, math bold, etc. in tool params,
tool results, and ref-md archives.

Adding the `u` flag makes paired surrogates combine into a single code point
before matching, so the [\uD800-\uDFFF] entry now matches only lone (malformed)
surrogates, which is the original intent. All other entries (replacement char,
C0/C1 controls, zero-width chars, line separators, BOM) keep their behavior.

Added a vitest suite covering the preserved and stripped cases.

Closes #30
2026-05-16 22:23:45 +02:00
十五便士 5736acc871 feat: add question/consultation issue template
Add a question template for issue submissions with categories and fields for detailed inquiries.
2026-05-16 20:17:22 +08:00
Yuntong8888 96870953e3 Update README_CN.md 2026-05-16 08:05:38 +08:00
Yuntong8888 4a3f8238d4 Update README_CN.md 2026-05-15 15:12:02 +08:00
Yuntong8888 285896f899 Update README_CN.md 2026-05-14 16:31:56 +08:00
Yuntong8888 e0efaab4db Update README_CN.md 2026-05-14 16:15:13 +08:00
Yuntong8888 0f2894eed9 Update README_CN.md 2026-05-14 15:21:35 +08:00
Yuntong8888 3f69f3c92d Update README.md 2026-05-14 15:21:30 +08:00
Yuntong8888 31d3542ba9 Update README.md 2026-05-14 04:19:15 +08:00
Yuntong8888 d3f220ce15 Update README_CN.md 2026-05-14 04:19:10 +08:00
Yuntong8888 5717b4aab0 Update README.md v0.3.4 2026-05-13 17:51:10 +08:00
Yuntong8888 209420727c Update README_CN.md 2026-05-13 17:51:06 +08:00
Yuntong8888 2488ae2c7a Update README_CN.md 2026-05-13 17:38:18 +08:00
Yuntong8888 7608894156 Update README.md 2026-05-13 17:37:58 +08:00
Yuntong8888 79bf24fbe4 Update README.md 2026-05-13 16:09:43 +08:00
Yuntong8888 a657499c72 Update README_CN.md 2026-05-13 16:01:54 +08:00
十五便士 910be30bbe Change security issue reporting email 2026-05-13 15:40:25 +08:00
十五便士 f6263da67c Change security issue reporting email
Updated the contact method for reporting security issues.
2026-05-13 15:38:19 +08:00
chrishuan f7794f198e docs: sync README, SKILL, and image updates from GitHub 2026-05-13 15:02:10 +08:00
chrishuan d377b09fbc feat: release v0.3.4 — offload local LLM, CLI restore, bugfix scripts 2026-05-13 14:56:56 +08:00
chrishuan 28be408fb8 docs: add Hermes quick start to README and Docker support v0.3.3 2026-05-13 02:14:54 +08:00
chrishuan db8f3e516a feat: release v0.3.3 — Hermes adapter, context offload, core refactor 2026-05-13 01:58:18 +08:00
chrishuan a74b0b3e43 feat: release v0.2.2 — TCVDB backend, BM25 hybrid retrieval, pipeline refactor v0.2.2 2026-05-13 01:23:05 +08:00
chrishuan 5bf5f890a3 docs: rewrite README.md to match README_CN.md structure 2026-05-13 00:16:08 +08:00
chrishuan 3cc6d2aa75 docs: fix benchmark data, replace placeholder links, add EN pyramid image 2026-05-13 00:02:53 +08:00
chrishuan 076fbda195 Merge remote-tracking branch 'github/main' into public 2026-05-12 23:30:25 +08:00
chrishuan 39a8b4c6d7 Update README_CN.md 2026-05-12 23:21:29 +08:00
chrishuan c53eff041e Update README.md 2026-05-12 23:12:54 +08:00
chrishuan 2b6c3e7cd9 Update README_CN.md 2026-05-12 22:56:48 +08:00