Commit Graph

18372 Commits

Author SHA1 Message Date
Josh Lehman
c8123c1865 fix: repair stale agent run context sweep 2026-04-09 13:57:34 -07:00
XING
08daee7f75 fix(gateway): honor retainAttachmentsOnKeep in TTL sweep + start sweeper on restore
1. Guard safeRemoveAttachmentsDir with retainAttachmentsOnKeep check
   in the session-mode TTL sweep, matching the existing pattern in
   finalizeSubagentCleanup (Codex P1)

2. Start sweeper unconditionally in restoreSubagentRunsOnce(), matching
   the register paths — ensures TTL cleanup runs after restart even
   when all restored entries are session-mode (Codex P2)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 13:57:34 -07:00
XING
e62d0b3d31 test(agent-events): use toMatchObject for context assertions
The new registeredAt and lastActiveAt fields on AgentRunContext cause
toEqual to fail because it expects exact property counts. Switch to
toMatchObject which validates expected properties without requiring
exact match — the standard pattern for objects with auto-injected
timestamps.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 13:57:34 -07:00
XING
8edb92042b fix(gateway): always start sweeper for session-mode runs
The sweeper was only started when archiveAtMs was truthy, so pure
session-mode workloads (archiveAtMs=undefined) never triggered the
60s sweep interval. This meant the TTL cleanup for session-mode runs,
pending lifecycle errors, and orphaned contexts never executed —
defeating the OOM fix for the exact batch scenario it was designed for.

Remove the if(archiveAtMs) guard at both registration sites so the
sweeper runs for all workloads. startSweeper() is idempotent (returns
immediately if already running) so this is safe.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 13:57:34 -07:00
XING
840ae56cef fix(gateway): address review feedback on memory leak fix
1. clearAgentRunContext now also deletes seqByRun (Greptile P2)
2. TTL constants moved to module scope (Greptile P2)
3. Session-mode TTL uses cleanupCompletedAt instead of endedAt to
   avoid interrupting deferred cleanup flows (Codex P1)
4. Added lastActiveAt to AgentRunContext, refreshed on every
   emitAgentEvent — long-running active agents are not swept (Codex P1)
5. resetAgentRunContextForTest also clears seqByRun (P2 drive-by)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 13:57:34 -07:00
XING
f1faf0c970 fix(gateway): add TTL cleanup for 3 Maps that grow unbounded causing OOM
Gateway crashes with OOM after batch processing ~1000+ agent sessions.
Three Maps accumulate entries without cleanup:

1. subagentRuns: session-mode runs have archiveAtMs=undefined, so the
   60s sweeper skips them forever. Add 5-min absolute TTL for completed
   session runs. Also sweep orphaned pendingLifecycleError entries with
   5-min TTL.

2. runContextById: only cleaned via manual clearAgentRunContext() calls.
   Add registeredAt timestamp and sweepStaleRunContexts() with 30-min
   TTL, called from the existing 60s maintenance timer. Also sweeps
   the companion seqByRun Map for the same runIds.

3. pendingLifecycleErrorByRunId: 15s retry timer but no absolute TTL.
   Now swept in sweepSubagentRuns() after 5 min.

Pre-deploy entries without registeredAt are treated as infinitely old
and swept immediately.

Fixes #52725

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 13:57:34 -07:00
Josh Lehman
2d846e1f1a fix: coerce integer plugin config input (#63346)
* Wizard: coerce integer plugin config input

Regeneration-Prompt: |
  Fix the interactive plugin-config wizard so JSON Schema fields declared as type "integer" are coerced from text input the same way type "number" already is. Keep the change narrow in src/wizard/setup.plugin-config.ts rather than refactoring the broader prompt flow. Add a focused regression test in src/wizard/setup.plugin-config.test.ts that exercises setupPluginConfig with an integer-typed schema field, verifies the text response "3" is stored as numeric 3, and run only the relevant wizard test slice before committing.

* Wizard: type select mock in setup plugin config test

Regeneration-Prompt: |
  Fix the CI type failure on PR #63346 in src/wizard/setup.plugin-config.test.ts with the smallest possible change. The new integer-coercion test needs its mocked prompter to satisfy the generic WizardPrompter select signature, matching the surrounding test style without changing production code or test behavior. After the one-line test fix, rerun pnpm tsgo --pretty false and pnpm test src/wizard/setup.plugin-config.test.ts on branch aristotle-3f605963-fix-config-integer-coercion.

* Wizard: coerce integer plugin config input

* Changelog: remove stray conflict marker
2026-04-09 13:57:06 -07:00
Mariano
6af17b39e1 fix(dreaming): require admin for persistent gateway toggle (#63872)
Merged via squash.

Prepared head SHA: 2dfd2ee7a7
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Co-authored-by: mbelinky <132747814+mbelinky@users.noreply.github.com>
Reviewed-by: @mbelinky
2026-04-09 21:21:01 +02:00
Tak Hoffman
b83726d13e Feat: Add Active Memory recall plugin (#63286)
* Refine plugin debug plumbing

* Tighten plugin debug handling

* Reduce active memory overhead

* Abort active memory sidecar on timeout

* Rename active memory blocking subagent wording

* Fix active memory cache and recall selection

* Preserve active memory session scope

* Sanitize recalled context before retrieval

* Add active memory changelog entry

* Harden active memory debug and transcript handling

* Add active memory policy config

* Raise active memory timeout default

* Keep usage footer on primary reply

* Clear stale active memory status lines

* Match legacy active memory status prefixes

* Preserve numeric active memory bullets

* Reuse canonical session keys for active memory

* Let active memory subagent decide relevance

* Refine active memory plugin summary flow

* Fix active memory main-session DM detection

* Trim active memory summaries at word boundaries

* Add active memory prompt styles

* Fix active memory stale status cleanup

* Rename active memory subagent wording

* Add active memory prompt and thinking overrides

* Remove active memory legacy status compat

* Resolve active memory session id status

* Add active memory session toggle

* Add active memory global toggle

* Fix active memory toggle state handling

* Harden active memory transcript persistence

* Fix active memory chat type gating

* Scope active memory transcripts by agent

* Show plugin debug before replies
2026-04-09 11:27:37 -05:00
Mason
2954c7235b test+ui: fix persistent main CI regressions (#63825) 2026-04-10 00:00:57 +08:00
Pavan Kumar Gondhi
635bb35b68 fix(agents): guard nodes tool outPath against workspace boundary [AI-assisted] (#63551)
* fix: address issue

* fix: address review feedback

* fix: finalize issue changes

* fix: address PR review feedback

* fix: address PR review feedback

* docs: add changelog entry for PR merge
2026-04-09 20:42:49 +05:30
zsx
1fede43b94 fix: exclude workspace shadows from channel setup catalog lookups 2026-04-09 22:46:39 +08:00
Neerav Makwana
2645ed154b fix: provider-qualified session context limits (#62493) (thanks @neeravmakwana)
* fix(sessions): provider-qualified context limits (#62472)

* fix(sessions): honor agent context cap in memory-flush gate

* refactor(sessions): unify context token resolution

* fix: keep followup snapshot freshness on the active provider (#62493) (thanks @neeravmakwana)

---------

Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-04-09 17:25:34 +05:30
Ayaan Zaidi
b8af4d6739 fix: start tailscale exposure before sidecars 2026-04-09 17:21:56 +05:30
Neerav Makwana
7f714609f7 fix: allow CLI task cancel for stuck background tasks (#62506) (thanks @neeravmakwana)
* Tasks: allow openclaw tasks cancel for CLI runtime (#62419)

Made-with: Cursor

* Tasks: address review — changelog order, CLI cancel without session, lock terminal status

Made-with: Cursor

* fix: freeze terminal task listener updates

* fix: clean changelog block for CLI task cancel (#62506) (thanks @neeravmakwana)

---------

Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-04-09 17:16:07 +05:30
Neerav Makwana
5577e2d441 fix: keep gateway RPC up during startup (#63480)
Thanks @neeravmakwana.
2026-04-09 17:09:18 +05:30
Neerav Makwana
12544e24d7 fix: stable auth profile resolution for isolated cron jobs (#62797) (thanks @neeravmakwana)
* Cron: stable auth profile resolution for isolated jobs (#62783)

* Tests: clearer assertion for isolated cron auth profile spy (#62797)
2026-04-09 16:48:05 +05:30
Mulualem Eshetu
4977c4ab82 fix(control-ui): preserve configured model metadata in picker (#61382)
Merged via squash.

Prepared head SHA: c738f6f146
Co-authored-by: Mule-ME <83214007+Mule-ME@users.noreply.github.com>
Co-authored-by: mukhtharcm <56378562+mukhtharcm@users.noreply.github.com>
Reviewed-by: @mukhtharcm
2026-04-09 16:28:43 +05:30
Peter Steinberger
828c64e6b5 style: format web fetch ssrf test 2026-04-09 10:18:32 +01:00
Aftab
fa2fab7060 fix(plugins): prevent schema load from re-activating plugin registry (#54971)
Merged via squash.

Prepared head SHA: dd1ed1d519
Co-authored-by: Aftabbs <112916888+Aftabbs@users.noreply.github.com>
Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com>
Reviewed-by: @altaywtf
2026-04-09 10:17:26 +01:00
Peter Steinberger
7497abc124 test: stabilize gateway background tests 2026-04-09 10:13:20 +01:00
Justin Song
1b24560392 fix(status): show configured fallback models in /status output (#33111)
Merged via squash.

Prepared head SHA: 5e590aa68c
Co-authored-by: AnCoSONG <32268203+AnCoSONG@users.noreply.github.com>
Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com>
Reviewed-by: @altaywtf
2026-04-09 10:13:09 +01:00
WarrenJones
905e56d191 fix: treat zero nextRunAtMs as invalid (#63507) (thanks @WarrenJones)
* fix(cron): repair nextRunAtMs=0 on non-schedule edits

Treat nextRunAtMs <= 0 as invalid during non-schedule updates so editing
a description or other metadata field recomputes the next run time instead
of silently keeping the corrupt value.

Made-with: Cursor

* fix(cron): treat zero nextRunAtMs as invalid

* fix: treat zero nextRunAtMs as invalid (#63507) (thanks @WarrenJones)

---------

Co-authored-by: WarrenJones <8704779+WarrenJones@users.noreply.github.com>
Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-04-09 14:39:53 +05:30
WarrenJones
40c5edb5b1 fix: preserve safe gateway env vars on reinstall (#63136) (thanks @WarrenJones)
* fix(daemon): preserve safe env vars on gateway reinstall

Pass the existing service environment into gateway reinstall planning so safe custom variables survive LaunchAgent rewrites and existing PATH entries are merged instead of being silently dropped.

Made-with: Cursor

* fix(daemon): track managed env keys on reinstall

* fix: preserve safe gateway env vars on reinstall (#63136) (thanks @WarrenJones)

* fix: validate preserved PATH entries on reinstall (#63136) (thanks @WarrenJones)

---------

Co-authored-by: WarrenJones <8704779+WarrenJones@users.noreply.github.com>
Co-authored-by: Ayaan Zaidi <hi@obviy.us>
2026-04-09 14:29:54 +05:30
HollyChou
ab49afcd27 fix: surface specific sub-issue for config validation union errors (#40841)
Merged via squash.

Prepared head SHA: 6d7da51629
Co-authored-by: Hollychou924 <128659251+Hollychou924@users.noreply.github.com>
Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com>
Reviewed-by: @altaywtf
2026-04-09 09:40:22 +01:00
Vincent Koc
38100a098e fix(qa): route cli registration through facade 2026-04-09 09:27:55 +01:00
Vincent Koc
2a372577d4 fix(memory-core): route bundled helpers through facade 2026-04-09 09:21:33 +01:00
Ayaan Zaidi
ac3999ac8c refactor(web-fetch): distill rfc2544 policy handling 2026-04-09 13:50:18 +05:30
xing-xing-coder
9ed448088b fix(web-fetch): finalize RFC2544 SSRF policy support 2026-04-09 13:50:18 +05:30
Vincent Koc
62eca3770f test(boundary): guard sdk and package imports from bundled plugin paths 2026-04-09 09:10:05 +01:00
Vincent Koc
c87994bc9a fix(plugins): split registry type surface 2026-04-09 09:05:11 +01:00
Vincent Koc
7d6af7e154 fix(agents): split sandbox backend handle types 2026-04-09 08:52:14 +01:00
Vincent Koc
f374fff3bd fix(browser): move browser sdk helper seams into core 2026-04-09 08:48:49 +01:00
Vincent Koc
77e0e3bac5 fix(memory): split embedding provider types 2026-04-09 08:32:32 +01:00
Vincent Koc
c1969ebf2a fix(agents): split sandbox fs bridge types 2026-04-09 08:26:41 +01:00
Vincent Koc
dbcc574e1f fix(agents): split embedded run shared types 2026-04-09 08:24:22 +01:00
Peter Steinberger
8a07ac510b test: isolate tasks reply registry state 2026-04-09 08:23:53 +01:00
Vincent Koc
3d60ed0544 fix(infra): split restart attempt types 2026-04-09 08:17:53 +01:00
Vincent Koc
04f9cc9f6c fix(config): remove schema hints type cycle 2026-04-09 08:15:04 +01:00
Vincent Koc
2ac71d9488 fix(config): split plugin auto enable types 2026-04-09 08:13:41 +01:00
Vincent Koc
714adcb124 fix(commands): split doctor allow-from mode types 2026-04-09 08:08:25 +01:00
Vincent Koc
5ece17a865 fix(plugin-sdk): route opencode shim through core onboard helper 2026-04-09 07:57:12 +01:00
Vincent Koc
a81dc153c6 fix(cron): split isolated run result types 2026-04-09 07:50:14 +01:00
Vincent Koc
b7cc36161c fix(agents): split skill install result types 2026-04-09 07:45:18 +01:00
Vincent Koc
ea54beb08a fix(gateway): split hook channel types 2026-04-09 07:41:40 +01:00
manuel-claw
e30d0cffc4 fix(whatsapp): drain reconnect queue after WhatsApp reconnects (#30806) (#46299)
Merged via squash.

Prepared head SHA: 5ce763406e
Co-authored-by: manuel-claw <268194568+manuel-claw@users.noreply.github.com>
Co-authored-by: mcaxtr <7562095+mcaxtr@users.noreply.github.com>
Reviewed-by: @mcaxtr
2026-04-09 02:33:36 -03:00
Peter Steinberger
0461341613 test: avoid provider runtime in models list e2e 2026-04-09 06:20:13 +01:00
Peter Steinberger
9b8eb10196 test: isolate doctor state integrity note capture 2026-04-09 06:16:03 +01:00
Peter Steinberger
2ee39fab83 test: run Ollama stream coverage inside plugin 2026-04-09 06:13:39 +01:00
Peter Steinberger
f0ddbb4619 test: keep Ollama runtime helpers out of attempt tests 2026-04-09 06:11:16 +01:00