Commit graph

8681 commits

Author SHA1 Message Date
d40865e2c2 feat(core): Auto-load Event Context on session start (Phase 3)
- Load event context from NATS JetStream on every run
- Inject formatted context into system prompt
- Configurable via gateway.eventStore settings
- Graceful fallback if NATS unavailable

Now every session starts with recent event history!
2026-02-02 17:14:45 +01:00
aea4c823ed feat(prompt): Add eventContextHint parameter for event-sourced memory
System prompt can now include event-based context from NATS JetStream.
Next step: Auto-load context on session start.
2026-02-02 17:14:45 +01:00
37f34e0536 fix(context): Use direct message fetch instead of consumer API
Simpler approach that avoids TypeScript issues with consumer options
2026-02-02 17:14:45 +01:00
093260b47e feat(core): Add Event Context Builder (Phase 2)
- Query events from NATS JetStream
- Extract conversation messages (deduplicated)
- Extract active topics from recent messages
- Format context for system prompt injection
- CLI helper for testing

Phase 2 of RFC-001: Event-Sourced Memory
2026-02-02 17:14:45 +01:00
ba9f76c027 fix(types): Add EventStoreConfig type + fix NATS enum imports 2026-02-02 17:14:45 +01:00
77dbafc77d feat(core): Add Event Store integration with NATS JetStream
Phase 1 of RFC-001: Event-Sourced Memory

- Add event-store.ts module for NATS JetStream integration
- All agent events (messages, tool calls, lifecycle) are published
- Configure via gateway.eventStore in config
- Events are persistent and queryable
- Non-blocking: failures don't affect core functionality

Config example:
  gateway:
    eventStore:
      enabled: true
      natsUrl: nats://localhost:4222
      streamName: openclaw-events
      subjectPrefix: openclaw.events

Co-authored-by: Albert Hild <albert@vainplex.de>
2026-02-02 17:14:45 +01:00
Josh Palmer
991ed3ab58 Tests: stub SSRF DNS pinning (#6619) (thanks @joshp123) 2026-02-02 16:38:25 +01:00
Josh Palmer
5676a6b38d Docs: normalize zh-CN terminology + tone
What: switch to 你/你的 tone; standardize Skills/Gateway网关/local loopback/私信 wording
Why: align zh-CN docs with issue 6995 feedback + idiomatic tech style
Tests: pnpm docs:build
2026-02-02 16:38:25 +01:00
Josh Palmer
2b1f68c928 Docs i18n: tune zh-CN prompt + glossary
What: enforce zh-CN tone (你/你的), Skills/local loopback/Tailscale terms, Gateway网关
Why: keep future translation output consistent with issue feedback
Tests: not run (prompt/glossary change)
2026-02-02 16:38:25 +01:00
Josh Palmer
673583a38b Docs: use explicit ClawHub markdown link
What: switch clawhub.com reference to explicit Markdown link syntax
Why: MDX parser rejects angle-bracket autolinks
Tests: not run (doc text change)
2026-02-02 16:38:25 +01:00
Josh Palmer
b4cce3ac7a Docs: fix zh-CN ClawHub link
What: wrap clawhub.com in an explicit URL link in zh-CN skills doc
Why: avoid Mintlify broken-link parser treating trailing punctuation as part of the URL
Tests: not run (doc text change)
2026-02-02 16:38:25 +01:00
CLAWDINATOR Bot
4023b76ed3 docs: add changelog for zh-CN translations (#6619) (thanks @joshp123) 2026-02-02 16:38:25 +01:00
Josh Palmer
e9d117d221 Docs: fix zh-CN template time wording
What: replace <2/<30 text in zh-CN AGENTS template with safe wording
Why: avoid MDX parse errors during docs build
Tests: not run (doc text change)
2026-02-02 16:38:25 +01:00
Josh Palmer
149dc7c4e7 Docs: add zh-CN translations 2026-02-02 16:38:25 +01:00
Josh Palmer
e70984745b Docs i18n: harden doc-mode pipeline 2026-02-02 16:38:25 +01:00
Shadow
da9f28d270 CI: label maintainer issues 2026-02-02 09:26:46 -06:00
Christian Klotz
99b4f2a24e
fix(telegram): handle Grammy HttpError network failures (#3815) (#7195)
* fix(telegram): handle Grammy HttpError network failures (#3815)

Grammy wraps fetch errors in an .error property (not .cause). Added .error
traversal to collectErrorCandidates in network-errors.ts.

Registered scoped unhandled rejection handler in monitorTelegramProvider
to catch network errors that escape the polling loop (e.g., from setMyCommands
during bot setup). Handler is unregistered when the provider stops.

* fix(telegram): address review feedback for Grammy HttpError handling

- Gate .error traversal on HttpError name to avoid widening search graph
- Use runtime logger instead of console.warn for consistency
- Add isGrammyHttpError check to scope unhandled rejection handler
- Consolidate isNetworkRelatedError into isRecoverableTelegramNetworkError
- Add 'timeout' to recoverable message snippets for full coverage
2026-02-02 15:25:41 +00:00
Peter Steinberger
f9fae2c439 fix: stabilize docker e2e flows 2026-02-02 13:11:55 +00:00
Peter Steinberger
9bd64c8a1f fix: expand SSRF guard coverage 2026-02-02 04:58:32 -08:00
cpojer
c429ccb64f
chore: fix broken test. 2026-02-02 21:51:37 +09:00
Peter Steinberger
57d008a33d fix(update): harden global updates 2026-02-02 04:45:14 -08:00
cpojer
6b0d6e2540
chore: We have a sleep at home. The sleep at home: 2026-02-02 21:44:02 +09:00
Peter Steinberger
dfef943f0a fix: polish docker setup flow 2026-02-02 04:26:03 -08:00
Peter Steinberger
39c682219e test: cover SSRF blocking for attachment URLs 2026-02-02 04:21:10 -08:00
Ayaan Zaidi
66307695eb fix: start gateway in docker CMD (#6635) (thanks @kaizen403) 2026-02-02 17:38:37 +05:30
Ayaan Zaidi
d134a8c7f3 docs: note docker allow-unconfigured behavior 2026-02-02 17:38:37 +05:30
Rishi Vhavle
bb3d7343f4 fix(docker): remove --bind lan from default CMD to work out of the box
Addresses review feedback: --bind lan requires auth token, so default
CMD should bind to loopback only.

For container platforms needing LAN binding for health checks:
1. Set OPENCLAW_GATEWAY_TOKEN env var
2. Override CMD: ["node","dist/index.js","gateway","--allow-unconfigured","--bind","lan"]
2026-02-02 17:38:37 +05:30
Rishi Vhavle
1a05ee941e fix(docker): add gateway subcommand and cloud-compatible flags
The Dockerfile CMD runs without arguments, causing the CLI to print
help and exit with code 1. This breaks deployment on container
platforms (Render, Railway, Fly.io, etc.) that rely on the CMD.

Changes:
- Add `gateway` subcommand to start the server
- Add `--allow-unconfigured` to allow startup without config file
- Add `--bind lan` to bind to 0.0.0.0 instead of localhost
  (required for container health checks)

Fixes #5685
2026-02-02 17:38:37 +05:30
Peter Steinberger
1b3f987c4d style: format fetch guard signatures 2026-02-02 04:07:29 -08:00
Peter Steinberger
81c68f582d fix: guard remote media fetches with SSRF checks 2026-02-02 04:07:29 -08:00
Peter Steinberger
d842b28a15 docs: update appcast for 2026.2.1 2026-02-02 03:53:21 -08:00
Peter Steinberger
ed4529e246 docs: update 2026.2.1 changelog 2026-02-02 03:25:32 -08:00
Peter Steinberger
bf08b485bd fix: satisfy tool adapter lint 2026-02-02 03:14:34 -08:00
Peter Steinberger
845d97b6a5 fix: handle legacy tool execute signatures 2026-02-02 02:51:52 -08:00
Peter Steinberger
8b64705e05 docs: fold 2026.2.2 into 2026.2.1 2026-02-02 02:43:54 -08:00
Peter Steinberger
bcb0ed0866 fix: normalize tool execute args 2026-02-02 02:41:21 -08:00
Peter Steinberger
9ae1b732ef fix: align tool definition adapter 2026-02-02 02:28:22 -08:00
Peter Steinberger
385e66cbd5 Docs: expand ClawHub overview 2026-02-02 02:26:11 -08:00
Peter Steinberger
2d317ce423 fix: align tool execute parameter order 2026-02-02 10:20:13 +00:00
Peter Steinberger
284d24209b fix: align tool execute signature 2026-02-02 10:14:29 +00:00
Peter Steinberger
b8174decf3 fix: resolve system prompt overrides 2026-02-02 02:10:13 -08:00
Peter Steinberger
41cc5bcd4f fix: gate Teams media auth retries 2026-02-02 02:08:13 -08:00
Peter Steinberger
f6d98a908a docs: add changelog entry for plugin install hardening 2026-02-02 02:07:47 -08:00
Peter Steinberger
d03eca8450 fix: harden plugin and hook install paths 2026-02-02 02:07:47 -08:00
Peter Steinberger
be9a2fb134 docs: clarify docker power-user setup 2026-02-02 02:07:08 -08:00
Tyler Yust
8d2f98fb01
Fix subagent announce failover race (always emit lifecycle end + treat timeout=0 as no-timeout) (#6621)
* Fix subagent announce race and timeout handling

Bug 1: Subagent announce fires before model failover retries finish
- Problem: CLI provider emitted lifecycle error on each attempt, causing
  subagent registry to prematurely call beginSubagentCleanup() and announce
  with incorrect status before failover retries completed
- Fix: Removed lifecycle error emission from CLI provider's attempt-level
  .catch() in agent-runner-execution.ts. Errors still propagate to
  runWithModelFallback for retry, but no intermediate lifecycle events
  are emitted. Only the final outcome (after all retries) emits lifecycle
  events.

Bug 2: Hard 600s per-prompt timeout ignores runTimeoutSeconds=0
- Problem: When runTimeoutSeconds=0 (meaning 'no timeout'), the code
  returned the default 600s timeout instead of respecting the 0 setting
- Fix: Modified resolveAgentTimeoutMs() to treat 0 as 'no timeout' and
  return a very large timeout value (30 days) instead of the default.
  This avoids setTimeout issues with Infinity while effectively providing
  unlimited time for long-running tasks.

* fix: emit lifecycle:error for CLI failures (#6621) (thanks @tyler6204)

* chore: satisfy format/lint gates (#6621) (thanks @tyler6204)

* fix: restore build after upstream type changes (#6621) (thanks @tyler6204)

* test: fix createSystemPromptOverride tests to match new return type (#6621) (thanks @tyler6204)
2026-02-02 02:06:14 -08:00
Peter Steinberger
d5f6caba3f docs: merge 2026.2.2 changelog into 2026.2.1 2026-02-02 01:31:24 -08:00
Peter Steinberger
4682c2e3e2 docs: add ClawHub registry overview 2026-02-02 01:26:29 -08:00
Peter Steinberger
34dd7324d9 fix: restore lint/build gates 2026-02-02 01:25:40 -08:00
Tyler Yust
9ef24fd400
fix: flush block streaming on paragraph boundaries for chunkMode=newline (#7014)
* feat: Implement paragraph boundary flushing in block streaming

- Added `flushOnParagraph` option to `BlockReplyChunking` for immediate flushing on paragraph breaks.
- Updated `EmbeddedBlockChunker` to handle paragraph boundaries during chunking.
- Enhanced `createBlockReplyCoalescer` to support flushing on enqueue.
- Added tests to verify behavior of flushing with and without `flushOnEnqueue` set.
- Updated relevant types and interfaces to include `flushOnParagraph` and `flushOnEnqueue` options.

* fix: Improve streaming behavior and enhance block chunking logic

- Resolved issue with stuck typing indicator after streamed BlueBubbles replies.
- Refactored `EmbeddedBlockChunker` to streamline fence-split handling and ensure maxChars fallback for newline chunking.
- Added tests to validate new chunking behavior, including handling of paragraph breaks and fence scenarios.
- Updated changelog to reflect these changes.

* test: Add test for clamping long paragraphs in EmbeddedBlockChunker

- Introduced a new test case to verify that long paragraphs are correctly clamped to maxChars when flushOnParagraph is enabled.
- Updated logic in EmbeddedBlockChunker to handle cases where the next paragraph break exceeds maxChars, ensuring proper chunking behavior.

* refactor: streamline logging and improve error handling in message processing

- Removed verbose logging statements from the `processMessage` function to reduce clutter.
- Enhanced error handling by using `runtime.error` for typing restart failures.
- Updated the `applySystemPromptOverrideToSession` function to accept a string directly instead of a function, simplifying the prompt application process.
- Adjusted the `runEmbeddedAttempt` function to directly use the system prompt override without invoking it as a function.
2026-02-02 01:22:41 -08:00