Peter Steinberger
b1c30f0ba9
refactor: dedupe cli config cron and install flows
2026-03-02 19:57:33 +00:00
Peter Steinberger
18f8393b6c
fix: harden sandbox writes and centralize atomic file writes
2026-03-02 16:45:12 +00:00
Peter Steinberger
b02b94673f
refactor: dedupe runtime and helper flows
2026-03-02 12:55:47 +00:00
Vignesh Natarajan
c58d2aa99e
Sessions: fix sessions_list transcriptPath path resolution
2026-02-28 14:42:14 -08:00
Peter Steinberger
c397a02c9a
fix(queue): harden drain/abort/timeout race handling
...
- reject new lane enqueues once gateway drain begins
- always reset lane draining state and isolate onWait callback failures
- persist per-session abort cutoff and skip stale queued messages
- avoid false 600s agentTurn timeout in isolated cron jobs
Fixes #27407
Fixes #27332
Fixes #27427
Co-authored-by: Kevin Shenghui <shenghuikevin@github.com >
Co-authored-by: zjmy <zhangjunmengyang@gmail.com >
Co-authored-by: suko <miha.sukic@gmail.com >
2026-02-26 13:43:39 +01:00
Onur Solmaz
a7d56e3554
feat: ACP thread-bound agents ( #23580 )
...
* docs: add ACP thread-bound agents plan doc
* docs: expand ACP implementation specification
* feat(acp): route ACP sessions through core dispatch and lifecycle cleanup
* feat(acp): add /acp commands and Discord spawn gate
* ACP: add acpx runtime plugin backend
* fix(subagents): defer transient lifecycle errors before announce
* Agents: harden ACP sessions_spawn and tighten spawn guidance
* Agents: require explicit ACP target for runtime spawns
* docs: expand ACP control-plane implementation plan
* ACP: harden metadata seeding and spawn guidance
* ACP: centralize runtime control-plane manager and fail-closed dispatch
* ACP: harden runtime manager and unify spawn helpers
* Commands: route ACP sessions through ACP runtime in agent command
* ACP: require persisted metadata for runtime spawns
* Sessions: preserve ACP metadata when updating entries
* Plugins: harden ACP backend registry across loaders
* ACPX: make availability probe compatible with adapters
* E2E: add manual Discord ACP plain-language smoke script
* ACPX: preserve streamed spacing across Discord delivery
* Docs: add ACP Discord streaming strategy
* ACP: harden Discord stream buffering for thread replies
* ACP: reuse shared block reply pipeline for projector
* ACP: unify streaming config and adopt coalesceIdleMs
* Docs: add temporary ACP production hardening plan
* Docs: trim temporary ACP hardening plan goals
* Docs: gate ACP thread controls by backend capabilities
* ACP: add capability-gated runtime controls and /acp operator commands
* Docs: remove temporary ACP hardening plan
* ACP: fix spawn target validation and close cache cleanup
* ACP: harden runtime dispatch and recovery paths
* ACP: split ACP command/runtime internals and centralize policy
* ACP: harden runtime lifecycle, validation, and observability
* ACP: surface runtime and backend session IDs in thread bindings
* docs: add temp plan for binding-service migration
* ACP: migrate thread binding flows to SessionBindingService
* ACP: address review feedback and preserve prompt wording
* ACPX plugin: pin runtime dependency and prefer bundled CLI
* Discord: complete binding-service migration cleanup and restore ACP plan
* Docs: add standalone ACP agents guide
* ACP: route harness intents to thread-bound ACP sessions
* ACP: fix spawn thread routing and queue-owner stall
* ACP: harden startup reconciliation and command bypass handling
* ACP: fix dispatch bypass type narrowing
* ACP: align runtime metadata to agentSessionId
* ACP: normalize session identifier handling and labels
* ACP: mark thread banner session ids provisional until first reply
* ACP: stabilize session identity mapping and startup reconciliation
* ACP: add resolved session-id notices and cwd in thread intros
* Discord: prefix thread meta notices consistently
* Discord: unify ACP/thread meta notices with gear prefix
* Discord: split thread persona naming from meta formatting
* Extensions: bump acpx plugin dependency to 0.1.9
* Agents: gate ACP prompt guidance behind acp.enabled
* Docs: remove temp experiment plan docs
* Docs: scope streaming plan to holy grail refactor
* Docs: refactor ACP agents guide for human-first flow
* Docs/Skill: add ACP feature-flag guidance and direct acpx telephone-game flow
* Docs/Skill: add OpenCode and Pi to ACP harness lists
* Docs/Skill: align ACP harness list with current acpx registry
* Dev/Test: move ACP plain-language smoke script and mark as keep
* Docs/Skill: reorder ACP harness lists with Pi first
* ACP: split control-plane manager into core/types/utils modules
* Docs: refresh ACP thread-bound agents plan
* ACP: extract dispatch lane and split manager domains
* ACP: centralize binding context and remove reverse deps
* Infra: unify system message formatting
* ACP: centralize error boundaries and session id rendering
* ACP: enforce init concurrency cap and strict meta clear
* Tests: fix ACP dispatch binding mock typing
* Tests: fix Discord thread-binding mock drift and ACP request id
* ACP: gate slash bypass and persist cleared overrides
* ACPX: await pre-abort cancel before runTurn return
* Extension: pin acpx runtime dependency to 0.1.11
* Docs: add pinned acpx install strategy for ACP extension
* Extensions/acpx: enforce strict local pinned startup
* Extensions/acpx: tighten acp-router install guidance
* ACPX: retry runtime test temp-dir cleanup
* Extensions/acpx: require proactive ACPX repair for thread spawns
* Extensions/acpx: require restart offer after acpx reinstall
* extensions/acpx: remove workspace protocol devDependency
* extensions/acpx: bump pinned acpx to 0.1.13
* extensions/acpx: sync lockfile after dependency bump
* ACPX: make runtime spawn Windows-safe
* fix: align doctor-config-flow repair tests with default-account migration (#23580 ) (thanks @osolmaz)
2026-02-26 11:00:09 +01:00
byungsker
177386ed73
fix(tui): resolve wrong provider prefix when session has model without modelProvider ( #25874 )
...
Merged via /review-pr -> /prepare-pr -> /merge-pr.
Prepared head SHA: f0953a7284
Co-authored-by: lbo728 <72309817+lbo728@users.noreply.github.com >
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com >
Reviewed-by: @gumadeiras
2026-02-25 00:36:27 -05:00
Peter Steinberger
fefc414576
fix(security): harden structural session path fallback
2026-02-24 02:52:48 +00:00
Gustavo Madeira Santana
eff3c5c707
Session/Cron maintenance hardening and cleanup UX ( #24753 )
...
Merged via /review-pr -> /prepare-pr -> /merge-pr.
Prepared head SHA: 7533b85156
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com >
Co-authored-by: shakkernerd <165377636+shakkernerd@users.noreply.github.com >
Reviewed-by: @shakkernerd
2026-02-23 22:39:48 +00:00
Vincent Koc
6a0fcf6518
Sessions: consolidate path hardening and fallback resilience ( #24657 )
...
* Changelog: credit session path fixes
* Sessions: harden path resolution for symlink and stale metadata
* Tests: cover fallback for invalid absolute sessionFile
* Tests: add symlink alias session path coverage
* Tests: guard symlink escape in sessionFile resolution
2026-02-23 12:36:01 -05:00
Vignesh Natarajan
9ea740afb6
Sessions: canonicalize mixed-case session keys
2026-02-22 23:27:08 -08:00
Peter Steinberger
1c753ea786
test: dedupe fixtures and test harness setup
2026-02-23 05:45:54 +00:00
Peter Steinberger
7b229decdd
test(perf): dedupe fixtures and reduce flaky waits
2026-02-22 22:06:01 +00:00
Vincent Koc
5e73f33448
fix(slack): keep thread session fork/history context after first turn ( #23843 )
...
* Slack thread sessions: keep forking and history context after first turn
* Update CHANGELOG.md
2026-02-22 14:39:00 -05:00
Peter Steinberger
34ea33f057
refactor: dedupe core config and runtime helpers
2026-02-22 17:11:54 +00:00
Peter Steinberger
1ad284a85f
test: move local cli and config scenario suites out of e2e
2026-02-22 10:58:04 +00:00
Frank Yang
1051f42f96
fix(stability): patch regex retries and timeout abort handling
2026-02-22 10:59:34 +01:00
Peter Steinberger
ce09fe2bb7
test(config): use lightweight clear in session pruning e2e setup
2026-02-22 08:30:47 +00:00
Peter Steinberger
b109fa53ea
refactor(core): dedupe gateway runtime and config tests
2026-02-22 07:44:57 +00:00
Peter Steinberger
98790339ef
test: dedupe repeated validation and throw assertions
2026-02-21 23:28:07 +00:00
Gustavo Madeira Santana
2f46308d5a
refactor(logging): migrate non-agent internal console calls to subsystem logger ( #22964 )
...
Merged via /review-pr -> /prepare-pr -> /merge-pr.
Prepared head SHA: b4a5b12422
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com >
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com >
Reviewed-by: @gumadeiras
2026-02-21 17:44:00 -05:00
Peter Steinberger
861718e4dc
test: group remaining suite cleanups
2026-02-21 21:44:57 +00:00
Onur
8178ea472d
feat: thread-bound subagents on Discord ( #21805 )
...
* docs: thread-bound subagents plan
* docs: add exact thread-bound subagent implementation touchpoints
* Docs: prioritize auto thread-bound subagent flow
* Docs: add ACP harness thread-binding extensions
* Discord: add thread-bound session routing and auto-bind spawn flow
* Subagents: add focus commands and ACP/session binding lifecycle hooks
* Tests: cover thread bindings, focus commands, and ACP unbind hooks
* Docs: add plugin-hook appendix for thread-bound subagents
* Plugins: add subagent lifecycle hook events
* Core: emit subagent lifecycle hooks and decouple Discord bindings
* Discord: handle subagent bind lifecycle via plugin hooks
* Subagents: unify completion finalizer and split registry modules
* Add subagent lifecycle events module
* Hooks: fix subagent ended context key
* Discord: share thread bindings across ESM and Jiti
* Subagents: add persistent sessions_spawn mode for thread-bound sessions
* Subagents: clarify thread intro and persistent completion copy
* test(subagents): stabilize sessions_spawn lifecycle cleanup assertions
* Discord: add thread-bound session TTL with auto-unfocus
* Subagents: fail session spawns when thread bind fails
* Subagents: cover thread session failure cleanup paths
* Session: add thread binding TTL config and /session ttl controls
* Tests: align discord reaction expectations
* Agent: persist sessionFile for keyed subagent sessions
* Discord: normalize imports after conflict resolution
* Sessions: centralize sessionFile resolve/persist helper
* Discord: harden thread-bound subagent session routing
* Rebase: resolve upstream/main conflicts
* Subagents: move thread binding into hooks and split bindings modules
* Docs: add channel-agnostic subagent routing hook plan
* Agents: decouple subagent routing from Discord
* Discord: refactor thread-bound subagent flows
* Subagents: prevent duplicate end hooks and orphaned failed sessions
* Refactor: split subagent command and provider phases
* Subagents: honor hook delivery target overrides
* Discord: add thread binding kill switches and refresh plan doc
* Discord: fix thread bind channel resolution
* Routing: centralize account id normalization
* Discord: clean up thread bindings on startup failures
* Discord: add startup cleanup regression tests
* Docs: add long-term thread-bound subagent architecture
* Docs: split session binding plan and dedupe thread-bound doc
* Subagents: add channel-agnostic session binding routing
* Subagents: stabilize announce completion routing tests
* Subagents: cover multi-bound completion routing
* Subagents: suppress lifecycle hooks on failed thread bind
* tests: fix discord provider mock typing regressions
* docs/protocol: sync slash command aliases and delete param models
* fix: add changelog entry for Discord thread-bound subagents (#21805 ) (thanks @onutc)
---------
Co-authored-by: Shadow <hi@shadowing.dev >
2026-02-21 16:14:55 +01:00
Shadow
8c9f35cdb5
Agents: sanitize skill env overrides
2026-02-20 12:38:54 -06:00
Vishal
f1e1cc4ee3
feat: surface cached token counts in /status output (openclaw#21248) thanks @vishaltandale00
...
Verified:
- pnpm build
- pnpm check
- pnpm test:macmini
Co-authored-by: vishaltandale00 <9222298+vishaltandale00@users.noreply.github.com >
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com >
2026-02-19 21:06:13 -06:00
Josh Avant
c2876b69fb
feat(auto-reply): add model fallback lifecycle visibility in status, verbose logs, and WebUI ( #20704 )
2026-02-19 14:33:02 -08:00
Peter Steinberger
0dc004fd21
refactor(sessions): share session thread/topic parsing
2026-02-18 18:25:25 +00:00
Peter Steinberger
112f8250fc
test: dedupe registry/session tests and add install source coverage
2026-02-18 05:05:04 +00:00
Peter Steinberger
8407eeb33c
refactor: extract shared string normalization helpers
2026-02-18 03:17:54 +00:00
Peter Steinberger
b8b43175c5
style: align formatting with oxfmt 0.33
2026-02-18 01:34:35 +00:00
Peter Steinberger
31f9be126c
style: run oxfmt and fix gate failures
2026-02-18 01:29:02 +00:00
Sebastian
3f66280c3c
test(sessions): add delivery info regression coverage
2026-02-17 10:00:08 -05:00
cpojer
d0cb8c19b2
chore: wtf.
2026-02-17 13:36:48 +09:00
Sebastian
ed11e93cf2
chore(format)
2026-02-16 23:20:16 -05:00
Sebastian
826e62a3bc
fix(sessions): purge deleted transcript archives
2026-02-16 22:35:27 -05:00
cpojer
90ef2d6bdf
chore: Update formatting.
2026-02-17 09:18:40 +09:00
Peter Steinberger
12a947223b
fix(ci): restore main checks after bulk merges
2026-02-16 23:47:27 +00:00
Peter Steinberger
eaa2f7a7bf
fix(ci): restore main lint/typecheck after direct merges
2026-02-16 23:26:11 +00:00
Xinhua Gu
90774c098a
fix(sessions): allow cross-agent session file paths in multi-agent setups
...
When OPENCLAW_STATE_DIR changes between session creation and resolution
(e.g., after reinstall or config change), absolute session file paths
pointing to other agents' sessions directories were rejected even though
they structurally match the valid .../agents/<agentId>/sessions/... pattern.
The existing fallback logic in resolvePathWithinSessionsDir extracts the
agent ID from the path and tries to resolve it via the current env's
state directory. When those directories differ, the containment check
fails. Now, if the path structurally matches the agent sessions pattern
(validated by extractAgentIdFromAbsoluteSessionPath), we accept it
directly as a final fallback.
Fixes #15410 , Fixes #15565 , Fixes #15468
2026-02-17 00:00:54 +01:00
Winston
94eecaa446
fix: atomic session store writes to prevent context loss on Windows
...
On Windows, fs.promises.writeFile truncates the target file to 0 bytes
before writing. Since loadSessionStore reads the file synchronously
without holding the write lock, a concurrent read can observe the empty
file, fail to parse it, and fall through to an empty store — causing the
agent to lose its session context.
Changes:
- saveSessionStoreUnlocked (Windows path): write to a temp file first,
then rename it onto the target. If rename fails due to file locking,
retry 3 times with backoff, then fall back to copyFile (which
overwrites in-place without truncating to 0 bytes).
- loadSessionStore: on Windows, retry up to 3 times with 50ms
synchronous backoff (via Atomics.wait) when the file is empty or
unparseable, giving the writer time to finish. SharedArrayBuffer is
allocated once and reused across retry attempts.
2026-02-16 23:57:21 +01:00
Hudson
93fbe6482b
fix(sessions): archive transcript files when pruning stale entries
...
pruneStaleEntries() removed entries from sessions.json but left the
corresponding .jsonl transcript files on disk indefinitely.
Added an onPruned callback to collect pruned session IDs, then
archives their transcript files via archiveSessionTranscripts()
after pruning completes. Only runs in enforce mode.
2026-02-16 23:50:56 +01:00
Gustavo Madeira Santana
8a67016646
Agents: raise bootstrap total cap and warn on /context truncation ( #18229 )
...
Merged via /review-pr -> /prepare-pr -> /merge-pr.
Prepared head SHA: f6620526df
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com >
Co-authored-by: gumadeiras <5599352+gumadeiras@users.noreply.github.com >
Reviewed-by: @gumadeiras
2026-02-16 12:04:53 -05:00
brandonwise
095d522099
fix(security): create session transcript files with 0o600 permissions ( #18066 )
...
Merged via /review-pr -> /prepare-pr -> /merge-pr.
Prepared head SHA: 962f497d24
Co-authored-by: brandonwise <21148772+brandonwise@users.noreply.github.com >
Co-authored-by: sebslight <19554889+sebslight@users.noreply.github.com >
Reviewed-by: @sebslight
2026-02-16 08:33:40 -05:00
Peter Steinberger
d3ddf893c2
test: remove redundant store-rotation integration prune case
2026-02-16 09:39:48 +00:00
Peter Steinberger
e30900f93e
test: remove low-value deprecated pruneDays e2e mapping case
2026-02-16 09:20:40 +00:00
Peter Steinberger
22c53af604
test: remove redundant saveSessionStore cap e2e case
2026-02-16 09:13:56 +00:00
Peter Steinberger
54948a1d44
test: remove redundant maintenance config mapping e2e case
2026-02-16 09:13:05 +00:00
Peter Steinberger
22a1a56e7e
test: remove low-value maintenance defaults e2e assertion
2026-02-16 09:11:17 +00:00
Peter Steinberger
404a8bc35f
test: remove redundant pruning-plus-capping e2e case
2026-02-16 09:07:24 +00:00
Peter Steinberger
7a4c131d6b
test: remove low-value mirrored-text media-filename unit case
2026-02-16 09:05:38 +00:00